[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: How to pass output of one lsode as input to other lsode at a given t

**From**: |
Juan Pablo Carbajal |

**Subject**: |
Re: How to pass output of one lsode as input to other lsode at a given time step |

**Date**: |
Tue, 24 Feb 2015 00:32:43 +0100 |

On Mon, Feb 16, 2015 at 12:19 PM, scjoshi
<address@hidden> wrote:
>* Hello All,*
>* I have a set of two ODE in which output of one has to be passed on as input*
>* to the other.*
>* Say the first ODE is:*
>* xdot = f1(x,t) whose outputs are x(1), x(2) and x(3). These are to be passed*
>* on as inputs to other ODE....*
>* say*
>* ydot = f2(y,t,x(1),x(2),x(3))*
>
>* Both these equations are to be solved simultaneously.*
>* Any examples would be appreciated.*
>
>
>
>* --*
>* View this message in context: *
>* http://octave.1599824.n4.nabble.com/How-to-pass-output-of-one-lsode-as-input-to-other-lsode-at-a-given-time-step-tp4668611.html*
>* Sent from the Octave - General mailing list archive at Nabble.com.*
>
>
>* _______________________________________________*
>* Help-octave mailing list*
>* address@hidden*
>* https://lists.gnu.org/mailman/listinfo/help-octave*
What you have is a coupled system of equations and one way to solve it
is to create a bigger system and solve it with lsode.
Something like (pseudo-code)
function dx = bigSYS(x,t)
[dx(1),dx(2),dx(3)] = f1(x(1:3),t)
[dx(4),dx(5),dx(6)] = f2(x,t);
endfunction
You have to realize that the current output of the system of ODEs
comes in the input vector x.
If, however, your second ODE, is not really an "ODE" but is a
functional of the solution trajectory of your first ODE, more details
are needed to now how to express the whole system as an ODE...if
possible.