Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: diff eq
Replies: 8   Last Post: Apr 11, 2013 2:27 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Torsten

Posts: 1,454
Registered: 11/8/10
Re: diff eq
Posted: Apr 11, 2013 2:27 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


> >
> > By the way:
> > You should call ODE45 with a row vector of inital values, i.e.
> > [t,a] = ode45(@eq1, [0:.1:10], [1 0 0 0])
> >
> > Best wishes
> > Torsten.

>
> Are you sure that the initial conditions need to be a row vector?
> This seems to work for row and column vectors:
>
> A = [-2.4712 0.005 0.56 0.1; 0.385 -0.1002 0 0; 0 0.002 -0.6462 0; 0 0.007 0 -0.2042]
> tstDV = @(t,x) A*x;
> x0 = [1;2;3;4]
> tspan = [0 10]
> [t,y] = ode45(tstDV, tspan,x0);
> plot(t,y)
>
> Gives the same as
> [t2,y2] = ode45(tstDV, tspan,x0');
> plot(t2,y2)


I don't know - I just saw that in all the examples, row vectors are used for the initial conditions. Although this is inconsistent with the prescription of derivatives which have to be supplied as column vector ...

Best wishes
Torsten.


Date Subject Author
4/7/13
Read diff eq
Guest
4/8/13
Read Re: diff eq
Bruno Luong
4/10/13
Read Re: diff eq
Guest
4/10/13
Read Re: diff eq
Torsten
4/10/13
Read Re: diff eq
Guest
4/10/13
Read Re: diff eq
Torsten
4/10/13
Read Re: diff eq
Bart
4/11/13
Read Re: diff eq
Torsten
4/10/13
Read Re: diff eq
richard

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.