Nonlinear differential equations

440 views (last 30 days)
Zaynab
Zaynab on 6 Apr 2012
Commented: linger on 10 Oct 2021
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!

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 6 Apr 2012
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 Comment
linger
linger on 10 Oct 2021
how about using other methods to solve this example ? such as Euler method and Midpoint method. Could you solve it?

Sign in to comment.

More Answers (3)

Zaynab
Zaynab on 6 Apr 2012
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!

seelam sreekanth
seelam sreekanth on 27 Mar 2015
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 Comment
Torsten
Torsten on 27 Mar 2015
One additional boundary condition is missing ...
Best wishes
Torsten.

Sign in to comment.


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

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!