ode45 or oder15s any idea for solving the second order wave equation?
15 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Torsten
2015-3-27
function wave
x10=...;
x20=...;
[T,Y] = ode45(@rhs,[0 12],[x10 x20]);
plot(T,Y(:,1),'-',T,Y(:,2),'-.');
function dy = rhs(t,y)
w0=...;
n=...;
x=...;
L=...;
An=...;
Ant=...;
Ft=...;
dy = zeros(2,1); % a column vector
dy(1) = y(2);
dy(2) = -w0^2*(n*x/L)^2*y(1)+(An+Ant)*Ft;
end
Best wishes
Torsten.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!