I am wondering if there is a module that plays with second order ODE in ROMS
I made one but have difficulty in stability. I tried many methods but the time step is still too small
Any suggestion will be appreciated
second order ODE in ROMS
-
- Posts: 39
- Joined: Wed Jun 25, 2008 2:49 am
- Location: Georgia Institute of Technology
Re: second order ODE in ROMS
The problem you are having is not clear from your message. Any 2nd order ode can be set up as two coupled 1st order ode.
Have you tried solving the ODE with a different solver independent of ROMS? How small must the time step be to get a stable solution? If all else fails, code your own 2nd order Runge Kutta solver and see how the equation behaves. Does it have singularities?
Are you sure that you don't have a coding error setting up the equation? This is the most common problem for the symptoms you report.
John
Have you tried solving the ODE with a different solver independent of ROMS? How small must the time step be to get a stable solution? If all else fails, code your own 2nd order Runge Kutta solver and see how the equation behaves. Does it have singularities?
Are you sure that you don't have a coding error setting up the equation? This is the most common problem for the symptoms you report.
John
-
- Posts: 39
- Joined: Wed Jun 25, 2008 2:49 am
- Location: Georgia Institute of Technology
Re: second order ODE in ROMS
Thank you for your reply John
I used predictor-corrector method to solve these two first order ODEs and tried different predictors and correctors. I think 2nd RK is one kind of them but I didnt try.
Let's say the equations are dx/dt=u, du/dt=RHS. The RHS comes from the instantaneous result of previous subroutines
The maximum stable time step is around 1 sec and the result is correct (or by accident). One of successful methods is Leap-Frog predictor, Adam-Moulton corrector (I used Euler predictor and trapzoid corrector to initialize first few steps, if I used this method for all steps, it doesnt work).
I used predictor-corrector method to solve these two first order ODEs and tried different predictors and correctors. I think 2nd RK is one kind of them but I didnt try.
Let's say the equations are dx/dt=u, du/dt=RHS. The RHS comes from the instantaneous result of previous subroutines
The maximum stable time step is around 1 sec and the result is correct (or by accident). One of successful methods is Leap-Frog predictor, Adam-Moulton corrector (I used Euler predictor and trapzoid corrector to initialize first few steps, if I used this method for all steps, it doesnt work).
-
- Posts: 39
- Joined: Wed Jun 25, 2008 2:49 am
- Location: Georgia Institute of Technology
Re: second order ODE in ROMS
If adding FB feedback as wikiroms says, the maximum step can reach about 1.4 sec, still very short, how can I improve this?
The only two ways I can think out are 1, doing iteration, 2, separate this time step from momentum timestep. Is there anyone can give me professional suggestion.
Thanks very much!!
The only two ways I can think out are 1, doing iteration, 2, separate this time step from momentum timestep. Is there anyone can give me professional suggestion.
Thanks very much!!
Re: second order ODE in ROMS
The requirement of a very short time step must be due to a fast rate in your equations. First order schemes (like Euler) are almost always poor performers. That is, they give bad solutions but are not unstable for a short enough time step. Any of the schemes you mention should behave. The ~1 sec time step has to be due to a fast rate.
It seems to me that 1) there is something pathological about the equation you are trying to solve, or 2) there is a very fast rate in some term. I don't think the basic problem is the solver that you are using.
Can you provide details of the equation that you are trying to solve? We can talk offline if you want.
John
It seems to me that 1) there is something pathological about the equation you are trying to solve, or 2) there is a very fast rate in some term. I don't think the basic problem is the solver that you are using.
Can you provide details of the equation that you are trying to solve? We can talk offline if you want.
John