Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to handle large number of equations in ODE system?

Subject: How to handle large number of equations in ODE system?

From: Hatoddyam Toto

Date: 10 Jul, 2012 22:07:38

Message: 1 of 3

 Hi All,
           I have a system of ODE which has 900 equations. I used for loop to write it (because of similarity in equations, I can group them in 10 or so and used FOR loops to write them).

It is taking much longer than I expect to simulate.

Is there any other way (without using FOR-loop) that I can simulate this large system.

thanks,
Hato

Subject: How to handle large number of equations in ODE system?

From: Torsten

Date: 11 Jul, 2012 06:58:23

Message: 2 of 3

On 11 Jul., 00:07, Hatoddyam Toto <bhattacharyya.sa...@gmail.com>
wrote:
> Hi All,
> I have a system of ODE which has 900 equations. I used for loop to write it (because of similarity in equations, I can group them in 10 or so and used FOR loops to write them).
>
> It is taking much longer than I expect to simulate.
>
> Is there any other way (without using FOR-loop) that I can simulate this large system.
>
> thanks,
> Hato

How can we tell if we don't know the system you are trying to solve ?
If e.g. your system reads dy_i/dt = y_i (i=1,...,900), you can of
course supply
the derivatives just as
dydt = y;
so no for loop would be needed.
If your system is more complicated, more information is needed to give
any advice.

Best wishes
Torsten.

Subject: How to handle large number of equations in ODE system?

From: Bjorn Gustavsson

Date: 11 Jul, 2012 10:36:12

Message: 3 of 3

Hatoddyam Toto <bhattacharyya.samit@gmail.com> wrote in message <e159994a-a8d3-4370-bf4f-bc4e4faf1a41@googlegroups.com>...
> Hi All,
> I have a system of ODE which has 900 equations. I used for loop to write it (because of similarity in equations, I can group them in 10 or so and used FOR loops to write them).
>
> It is taking much longer than I expect to simulate.
>
> Is there any other way (without using FOR-loop) that I can simulate this large system.
>
> thanks,
> Hato
>
Hato, if it so happens that some of your equations makes the solver take short steps in time during one time interval and some other equations forces the solver to take short steps in time during another time interval, then the solver will take short time-steps for all 900 equations during both those intervals. So if you've grouped several sets of ODEs to solve simultaneously even though there is no coupling between the sets, you might be better off calling the solver for each set separately and not combine them into one 900-equation ODE. I once had a problem where I needed to solve the equations of motion for a number of independent particles - way slower to combine them into one ODE, better to solve for each particle individualy.

Very general and vague...

HTH
Bjeorn

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us