http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374
MATLAB Central Newsreader  Solving system of ODEs
Feed for thread: Solving system of ODEs
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sun, 29 Jan 2012 11:14:10 +0000
Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865122
Apon Mohaimen
Dear all,<br>
I was just wondering if anyone knows how to solve a system of ODE's of the following form:<br>
dx/dt=f(x)<br>
dy/dt=g(x)<br>
x0=0,y0=0<br>
note that both x' and y' prime are only functions of x only. <br>
Do i need to include '0*h(y)' in one of the equations so that Matlab understands that it needs to solve for both x and y?

Sun, 29 Jan 2012 11:47:30 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865125
Nasser M. Abbasi
On 1/29/2012 5:14 AM, Apon Mohaimen wrote:<br>
> Dear all,<br>
> I was just wondering if anyone knows how to solve a system of ODE's of the following form:<br>
> dx/dt=f(x)<br>
> dy/dt=g(x)<br>
> x0=0,y0=0<br>
> note that both x' and y' prime are only functions of x only.<br>
> Do i need to include '0*h(y)' in one of the equations so that Matlab understands that<br>
>it needs to solve for both x and y?<br>
<br>
<br>
dy/dt=g(x)? I do not underatand this one. is y here a function<br>
of t and x?<br>
<br>
Nasser

Sun, 29 Jan 2012 15:08:09 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865134
Apon Mohaimen
"Nasser M. Abbasi" <nma@12000.org> wrote in message <jg3bki$uu5$1@speranza.aioe.org>...<br>
> On 1/29/2012 5:14 AM, Apon Mohaimen wrote:<br>
> > Dear all,<br>
> > I was just wondering if anyone knows how to solve a system of ODE's of the following form:<br>
> > dx/dt=f(x)<br>
> > dy/dt=g(x)<br>
> > x0=0,y0=0<br>
> > note that both x' and y' prime are only functions of x only.<br>
> > Do i need to include '0*h(y)' in one of the equations so that Matlab understands that<br>
> >it needs to solve for both x and y?<br>
> <br>
> <br>
> dy/dt=g(x)? I do not underatand this one. is y here a function<br>
> of t and x?<br>
> <br>
> Nasser<br>
Thanks for your reply. Actually both x and y are indeed functions of t. dy/dt is a function of x and t. Does it make sense if I write it this way?<br>
dx(t)/dt=f(x(t),t)<br>
dy(t)/dt=g(x(t),t)<br>
x(0)=0,y(0)=0

Sun, 29 Jan 2012 19:49:57 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865147
TideMan
On Jan 30, 4:08 am, "Apon Mohaimen" <mohaimen.man...@gmail.com> wrote:<br>
> "Nasser M. Abbasi" <n...@12000.org> wrote in message <jg3bki$uu...@speranza.aioe.org>...> On 1/29/2012 5:14 AM, Apon Mohaimen wrote:<br>
> > > Dear all,<br>
> > > I was just wondering if anyone knows how to solve a system of ODE's of the following form:<br>
> > > dx/dt=f(x)<br>
> > > dy/dt=g(x)<br>
> > > x0=0,y0=0<br>
> > > note that both x' and y' prime are only functions of x only.<br>
> > > Do i need to include '0*h(y)' in one of the equations so that Matlab understands that<br>
> > >it needs to solve for both x and y?<br>
><br>
> > dy/dt=g(x)? I do not underatand this one. is y here a function<br>
> > of t and x?<br>
><br>
> > Nasser<br>
><br>
> Thanks for your reply. Actually both x and y are indeed functions of t. dy/dt is a function of x and t. Does it make sense if I write it this way?<br>
> dx(t)/dt=f(x(t),t)<br>
> dy(t)/dt=g(x(t),t)<br>
> x(0)=0,y(0)=0<br>
<br>
So, dy/dt must be a partial derivative, not ordinary derivative, and<br>
that's a whole different ballgame.

Sun, 29 Jan 2012 20:25:10 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865150
Bruno Luong
"Apon Mohaimen" wrote in message <jg39m2$m4$1@newscl01ah.mathworks.com>...<br>
> Dear all,<br>
> I was just wondering if anyone knows how to solve a system of ODE's of the following form:<br>
> dx/dt=f(x)<br>
> dy/dt=g(x)<br>
> x0=0,y0=0<br>
> note that both x' and y' prime are only functions of x only. <br>
> Do i need to include '0*h(y)' in one of the equations so that Matlab understands that it needs to solve for both x and y? <br>
<br>
I don't agree with Tideman, there is no partial derivative here. I propose two ways of solving the problem:<br>
<br>
1. 1st Option<br>
<br>
Let's define<br>
<br>
X = [x; y]<br>
H(X) = [f(x); g(x)];<br>
X0 = [x0; y0];<br>
<br>
Then solve <br>
dX/dt = H(X)<br>
X(t=0) = X0<br>
<br>
using Matlab ode solver.<br>
<br>
2nd option:<br>
<br>
Because x does not depend on y. Solve for x the system:<br>
dx/dt=f(x)<br>
x(t=0) = x0=0<br>
<br>
using MATLAB ode solver.<br>
<br>
Then compute y as integral:<br>
<br>
y(t) = y0 + integral_on (0,t) (g(x(s)) ds.<br>
<br>
Using numerical integration.<br>
<br>
Bruno

Sun, 29 Jan 2012 20:34:19 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865151
TideMan
On Jan 30, 9:25 am, "Bruno Luong" <b.lu...@fogale.findmycountry><br>
wrote:<br>
> "Apon Mohaimen" wrote in message <jg39m2$m...@newscl01ah.mathworks.com>...<br>
> > Dear all,<br>
> > I was just wondering if anyone knows how to solve a system of ODE's of the following form:<br>
> > dx/dt=f(x)<br>
> > dy/dt=g(x)<br>
> > x0=0,y0=0<br>
> > note that both x' and y' prime are only functions of x only.<br>
> > Do i need to include '0*h(y)' in one of the equations so that Matlab understands that it needs to solve for both x and y?<br>
><br>
> I don't agree with Tideman, there is no partial derivative here. I propose two ways of solving the problem:<br>
><br>
> 1. 1st Option<br>
><br>
> Let's define<br>
><br>
> X = [x; y]<br>
> H(X) = [f(x); g(x)];<br>
> X0 = [x0; y0];<br>
><br>
> Then solve<br>
> dX/dt = H(X)<br>
> X(t=0) = X0<br>
><br>
> using Matlab ode solver.<br>
><br>
> 2nd option:<br>
><br>
> Because x does not depend on y. Solve for x the system:<br>
> dx/dt=f(x)<br>
> x(t=0) = x0=0<br>
><br>
> using MATLAB ode solver.<br>
><br>
> Then compute y as integral:<br>
><br>
> y(t) = y0 + integral_on (0,t) (g(x(s)) ds.<br>
><br>
> Using numerical integration.<br>
><br>
> Bruno<br>
<br>
But if y(x,t), then:<br>
dy/dt=pdy/pdt + dx/dt pdy/pdx where pd=> partial derivative

Sun, 29 Jan 2012 20:53:10 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865152
Bruno Luong
TideMan <mulgor@gmail.com> wrote in message <f70bc1a9d16746e49b7bb54afbdfa2d1@1g2000yqv.googlegroups.com>...<br>
<br>
> <br>
> But if y(x,t), then:<br>
> dy/dt=pdy/pdt + dx/dt pdy/pdx where pd=> partial derivative<br>
<br>
The PDE implies the unknown is multivariate function with system involving the partial derivative of the unknown.<br>
<br>
The relation you show is how to compute the derivative from a composed function TideMan. This does not change the fact that the system is simply an ODE, no more.<br>
<br>
Bruno

Sun, 29 Jan 2012 22:25:09 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865154
Roger Stafford
TideMan <mulgor@gmail.com> wrote in message <bffb24abe1bb4c179f26da4abfbf485e@h6g2000yqk.googlegroups.com>...<br>
> So, dy/dt must be a partial derivative, not ordinary derivative, and<br>
> that's a whole different ballgame.<br>
         <br>
In a sense both statements are true. There is a partial derivative involved. However when we write<br>
<br>
dy/dt=g(x,t)<br>
<br>
for solution by 'ode' it is the total derivative that is meant:<br>
<br>
dy/dt = g(x(t),t)<br>
<br>
regarding g(x(t),t) as a function solely of t and not the partial derivative with respect to the second argument. Hence it is perfectly acceptable as a problem for the 'ode' routines.<br>
<br>
Roger Stafford

Sun, 29 Jan 2012 23:07:10 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865157
Michael Bernard
<br>
Dear Apon Mohaimen<br>
<br>
You will need to solve your own problem. Go to the website <a href="http://www.freebookspot.es/Default.aspx">http://www.freebookspot.es/Default.aspx</a><br>
Download a book called Solving ODEs with MATLAB by Shampine Gladwell Thompson.<br>
<br>
Just copy the title of this book and U will find it. This book has the answer to your problems and many more.You can use it to help yourself.I hope I tried.<br>
<br>
All the best<br>
<br>
Cheers!!!<br>
<br>
<br>
<br>
<br>
"Apon Mohaimen" wrote in message <jg39m2$m4$1@newscl01ah.mathworks.com>...<br>
> Dear all,<br>
> I was just wondering if anyone knows how to solve a system of ODE's of the following form:<br>
> dx/dt=f(x)<br>
> dy/dt=g(x)<br>
> x0=0,y0=0<br>
> note that both x' and y' prime are only functions of x only. <br>
> Do i need to include '0*h(y)' in one of the equations so that Matlab understands that it needs to solve for both x and y?

Sun, 29 Jan 2012 23:09:10 +0000
Re: Solving system of ODEs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/316374#865158
Michael Bernard
Dear Nasser<br>
<br>
I guess you and Apon have the same problem so I will send the same message.<br>
<br>
You will need to solve your own problem. Go to the website <a href="http://www.freebookspot.es/Default.aspx">http://www.freebookspot.es/Default.aspx</a><br>
Download a book called Solving ODEs with MATLAB by Shampine Gladwell Thompson.<br>
<br>
Just copy the title of this book and U will find it. This book has the answer to your problems and many more.You can use it to help yourself.I hope I tried.<br>
<br>
All the best<br>
<br>
Cheers!!!<br>
<br>
<br>
<br>
<br>
<br>
"Nasser M. Abbasi" <nma@12000.org> wrote in message <jg3bki$uu5$1@speranza.aioe.org>...<br>
> On 1/29/2012 5:14 AM, Apon Mohaimen wrote:<br>
> > Dear all,<br>
> > I was just wondering if anyone knows how to solve a system of ODE's of the following form:<br>
> > dx/dt=f(x)<br>
> > dy/dt=g(x)<br>
> > x0=0,y0=0<br>
> > note that both x' and y' prime are only functions of x only.<br>
> > Do i need to include '0*h(y)' in one of the equations so that Matlab understands that<br>
> >it needs to solve for both x and y?<br>
> <br>
> <br>
> dy/dt=g(x)? I do not underatand this one. is y here a function<br>
> of t and x?<br>
> <br>
> Nasser