Rosenbrock method ODE : Abrupt increase during First iteration

In summary, the conversation discusses solving a set of equations by removing components and setting initial conditions. The initial conditions were set to thermal equilibrium values and the problem was solved automatically while attempting to solve another problem.
  • #1
gurbir_s
11
4
TL;DR Summary
I am using Rosenbrock4 method from Odeint library in C++ to solve a set of differential equations. However, I see that it gives an unusual change in the result for first iteration but afterwards, gives good results. How can I solve it?
The set of equations is
1682164625015.png

I have first tried to solve only first two equations (removing the components of other 4 equations from them.)

This is the output, where first column is the time, 2nd - X_p, and 3rd - X_n

1682164726299.png
 
  • Like
Likes Theia
Physics news on Phys.org
  • #2
How are you setting your initial conditions for this solution?
 
  • #3
berkeman said:
How are you setting your initial conditions for this solution?
The ##X_i##'s are elemental abundances during Big Bang Nucleosynthesis. I set the initial conditions equal to their thermal equilibrium values at that point.

I don't know how, but the problem got solved automatically while I was trying to solve another problem. Idk how. Thanks for your reply.
 
  • Like
Likes berkeman
Back
Top