Finite difference method to solve a nonlinear eqn?
이전 댓글 표시
Hello,
I have a second order nonlinear question and I need to solve it for different times by using finite difference method but I don't know how to start it. I am quite new in Matlab. Is there anyone who can help me or at least show me a way to do this?
thank you
댓글 수: 6
Torsten
2022년 3월 25일
If we knew the equation, maybe we could help.
Onur Metin Mertaslan
2022년 3월 25일
편집: Onur Metin Mertaslan
2022년 3월 25일
Onur Metin Mertaslan
2022년 3월 25일
Torsten
2022년 3월 25일
g = 9.81;
L = 1.0;
T = 1.0;
dT = 0.01;
y_0 = pi/2;
v_0 = 0;
f = @(t,y)[y(2);-g/L*sin(y(1))];
tspan = 0:dT:T;
y0 = [y_0;v_0];
[t,y] = ode45(f,tspan,y0);
plot(t,y)
Onur Metin Mertaslan
2022년 3월 25일
편집: Onur Metin Mertaslan
2022년 3월 25일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
