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

3 Ansichten (letzte 30 Tage)
Sam
Sam am 27 Mär. 2015
Bearbeitet: Sam am 10 Apr. 2015
Hi! I'm a beginner and I'm trying to solve this eq with matlab, any idea/link/code as first step?
thanks

Akzeptierte Antwort

Torsten
Torsten am 27 Mär. 2015
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.

Weitere Antworten (1)

Sam
Sam am 27 Mär. 2015
Thank you dear Torsten, this will be a good start...

Community Treasure Hunt

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

Start Hunting!

Translated by