Nonlinear differential equations

조회 수: 43 (최근 30일)
Zaynab
Zaynab 2012년 4월 6일
댓글: linger 2021년 10월 10일
Hi,
How can i solve a system of nonlinear differential equations using Matlab?? here is an example of what i'm talking about it's not the problem that i'm working in but it had the same form. //// x'=3x+y//// y'=y-x+y^4+z^4//// z'=y+z^4+y^4+3/// the ' means the derivative. i'll appreciate your help, best regards!

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 4월 6일
eg for your case
f1 = @(t,y)[3*y(1)+y(2);y(2)-y(1)+y(2).^4+y(3).^4;y(2)+y(2).^4+y(3).^4+3]
[T,Y] = ode45(f1,[0 .1],zeros(3,1))
  댓글 수: 1
linger
linger 2021년 10월 10일
how about using other methods to solve this example ? such as Euler method and Midpoint method. Could you solve it?

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Zaynab
Zaynab 2012년 4월 6일
Thanks andrei bobrov,
Actually the link is verry helpful, i used the ode45 solver too and i print the system.Here is the programme
function dy = zin(t,y)
dy = zeros(3,1);
dy(1) = 3*y(1)+y(2);
dy(2) = y(2)-y(1)+y(2).^4+y(3).^4;
dy(3) = y(2)+y(3).^4+3+y(2).^4;
end
options = odeset('RelTol',1e-2,'AbsTol',[1e-2 1e-2 1e-2]);
[T,Y] = ode45(@zin,[0 12],[0 1 1],options);
plot(T,Y(:,1),'-',T,Y(:,2),'-.',T,Y(:,3),'.');
is there a way to have the analytical solutions or just the graphs. Thank you!
  댓글 수: 1
Drake Sorkhab
Drake Sorkhab 2021년 2월 25일
Omg this code saved me ty

댓글을 달려면 로그인하십시오.


seelam sreekanth
seelam sreekanth 2015년 3월 27일
Hi how can i solve the following equation 2f"'-(f')^2+f”-f’=0 f(0)=0, f’(0)=0 by using MAT lab
note: the ' means the derivative
  댓글 수: 1
Torsten
Torsten 2015년 3월 27일
One additional boundary condition is missing ...
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.


Aikumys Arkenova
Aikumys Arkenova 2020년 5월 4일
Hello!!!
How i can solve this equaion?
y'(t)=-y(t)+e^tauy(t-tau)g(x(t-tau))

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by