Undergrad Rosenbrock method ODE : Abrupt increase during First iteration

Click For Summary
The discussion revolves around the application of the Rosenbrock method to solve a set of ordinary differential equations (ODEs) related to elemental abundances during Big Bang Nucleosynthesis. Initial conditions were set to their thermal equilibrium values, which is crucial for accurate modeling. An unexpected resolution of the problem occurred while the user was addressing a different issue, highlighting the sometimes unpredictable nature of computational problem-solving. The conversation emphasizes the importance of initial conditions in ODE solutions. Overall, the thread illustrates both the challenges and surprises encountered in numerical methods for ODEs.
gurbir_s
Messages
11
Reaction score
4
TL;DR
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
 
Physics news on Phys.org
How are you setting your initial conditions for this solution?
 
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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K