Solve differential equation using ode23 and ode45
Show older comments
Question: solve the differential equation
regarding y as the independent variable rather than x. Also find solution for x(0)=1. Finally plot y vs x(y). Also use ode23 and ode45 to solve the equation and plot again.
My approach:
code:
syms x(y);
eqn=diff(y,x)==(x+y*exp(y));
cond=x(0)==1;
dsolve(eqn,cond)
But now how to use ode23 or ode45 and how to plot? Any solution will be appreciated .
Thanks in advance .
3 Comments
Star Strider
on 24 Jun 2019
This does not appear to be the same expression as the one you posted in LaTeX:
eqn=diff(x,y)==(x+y*exp(y));
One of them is in error.
emonhossain roy
on 24 Jun 2019
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations 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!