I want to solve a 3rd order differential equation,and plot it,what will be the code?
Show older comments
X''' +(1+cos(t))X'+sin(t)X=0
X(0)=0, X'(0)=1,X''(0)=0
1 Comment
David After
on 4 Sep 2020
How can i solve this eqaution?
F''' (eta)+ F(eta)F"(eta) + F'^2(eta) = 0
with the boundary conditions
F(0)=F''(0)=0 and F'(infinity)=0 and eta is 0:0.1:6
i want to plot it and create a table for it (eta-f-f'-f'')
I am new to using the ode solver in matlab and am not sure how to make it solve a equation. Any suggestion would be appreciated.
thank you
my email : ff223325@gmail.com
Answers (1)
Torsten
on 27 Nov 2015
0 votes
Use MATLAB's ODE45.
Best wishes
Torsten.
4 Comments
Subhadip
on 27 Nov 2015
Torsten
on 27 Nov 2015
function dy = myfun(t,y)
dy=zeros(3,1);
dy(1)=y(2);
dy(2)=y(3);
dy(3)=-(1-cos(t))*y(2)-sin(t)*y(1);
Best wishes
Torsten.
Joy Salomi
on 13 Feb 2020
Hello Mr.Torsen,

What is wrong in this coding? I got some error. Please help me in this. I have attached the problem and code below. Thanks in advance.
My equation and bcs are:
f'''+f f'' -1.3333 (f')^2 - f' = 0
f(0)=0 , f'(0)=1 , f'(infinity)=0
function heattransfernew
options=bvpset('stats','off','RelTol',1e-6);
solinit=bvpinit(linspace(0,6,20),[0,6]);
sol=bvp4c(@f, @OdeBC, solinit, options);
plot(sol.x,sol.y(1,:));
end
function dydx = f(x,y)
dydx(1) = y(2);
dydx(2) = y(3);
dydx(3) = -y(1).*y(3)+1.3333.*(y(2).^2)+y(2);
end
function res = OdeBC(ya,yb)
res = [ya(1)
ya(2)-1
yb(2)
];
end
Suresh Biradar
on 9 Jun 2023
Replace [0,6] by initial guess [1 1 1]
then your problem is solved
Categories
Find more on Solver Outputs and Iterative Display 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!