Search All of the Math Forum:

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

Topic: (yet unsolved) how to Solve coupled ODEs
Replies: 4   Last Post: Feb 13, 2013 4:11 AM

 Messages: [ Previous | Next ]
 Torsten Posts: 1,631 Registered: 11/8/10
Re: (yet unsolved) how to Solve coupled ODEs
Posted: Feb 13, 2013 3:01 AM

"Henry" wrote in message <kfeavo\$2f\$1@newscl01ah.mathworks.com>...
> I modified the code to:
>
> tspan = linspace(1, 2,100);
> y = 0.0001*ones(1,200);
> [T,sols] = ode45(@yprime, tspan,y);
> and
> dyds = [dyds1' ; dyds2'];
>
> and it now runs, thanks.
>
> But I have this question: My odes are time-independent, function of "s" which is a distance, but since the ode45 will not work without a tspan, I came up with an arbitrary tspan. It looks as if ode45 interprets that "s" is a time? I'm confused as to how interpret the result of the routine which has dimensions of 100x200. I was expecting 1 x 200, i.e. independent of time.
> thanks

Just interpret your results for y(1) and y(2) as functions of distance, not of time.
So "tspan" in your case is a distance vector, not a time vector.

Best wishes
Torsten.

Date Subject Author
2/12/13 Steven Lord
2/13/13 Torsten
2/13/13 Torsten