ode45 or oder15s any idea for solving the second order wave equation?

2 ビュー (過去 30 日間)
Sam
Sam 2015 年 3 月 27 日
編集済み: Sam 2015 年 4 月 10 日
Hi! I'm a beginner and I'm trying to solve this eq with matlab, any idea/link/code as first step?
thanks

採用された回答

Torsten
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.

その他の回答 (1 件)

Sam
Sam 2015 年 3 月 27 日
Thank you dear Torsten, this will be a good start...

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by