Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Differential equation and ode45 or ode15i
Replies: 10   Last Post: Jan 28, 2014 3:14 AM

 Messages: [ Previous | Next ]
 Steven Lord Posts: 2,237 Registered: 9/26/13
Re: Differential equation and ode45 or ode15i
Posted: Jan 27, 2014 2:56 PM

"shatrah " <shatrah1978@gmail.com> wrote in message
news:lc63k7\$dh3\$1@newscl01ah.mathworks.com...
> "Torsten" wrote in message <lc5tqg\$495\$1@newscl01ah.mathworks.com>...
>> "shatrah " <shatrah1978@gmail.com> wrote in message
>> <lc5sso\$kdh\$1@newscl01ah.mathworks.com>...

>> > "Torsten" wrote in message <lc5r64\$o8h\$1@newscl01ah.mathworks.com>...
>> > > "shatrah " <shatrah1978@gmail.com> wrote in message
>> > > <lc5q4c\$4a9\$1@newscl01ah.mathworks.com>...

>> > > > "Torsten" wrote in message
>> > > > <lc5mi0\$n5t\$1@newscl01ah.mathworks.com>...

>> > > > > "shatrah " <shatrah1978@gmail.com> wrote in message
>> > > > > <lc35in\$d3g\$1@newscl01ah.mathworks.com>...

>> > > > > > dq/dz=dy/dz+q dy/dz=z*y
>> > > > > > ds/dz=dy/dz+dq/dz y=10, dy/dz=0 for z=0
>> > > > > > z=15, dz/dz=0 for z=0
>> > > > > > q=11, dq/dz=0 for z=0

*snip*

> Please just answe this questin ( my clear one ) Can I use this on matlab
> ode45 , dy(1)=dy(2)+d(3) ???? Or must left side contain only dy and right
> side don't contain dy ??? Clear question !!! Thanks

For a system like this, use a mass matrix. See the "Mass Matrix and DAE

http://www.mathworks.com/help/matlab/ref/odeset.html

dq/dz - dy/dz = q
dy/dz = z*y
- dy/dz - dq/dz + ds/dz = 0

For this system, your mass matrix would be:

[1 -1 0; 0 1 0; -1 -1 1]

Your f(t, y) would then return [q; z*y; 0], and the solutions would be
[dqdz; dydz; dsdz].

--
Steve Lord
slord@mathworks.com
http://www.mathworks.com

Date Subject Author
1/26/14 shatrah
1/27/14 Torsten
1/27/14 shatrah
1/27/14 Torsten
1/27/14 shatrah
1/27/14 Torsten
1/27/14 shatrah
1/27/14 Steven Lord
1/27/14 shatrah
1/28/14 Torsten
1/28/14 shatrah