I Rosenbrock method ODE : Abrupt increase during First iteration

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.
 
I have the equation ##F^x=m\frac {d}{dt}(\gamma v^x)##, where ##\gamma## is the Lorentz factor, and ##x## is a superscript, not an exponent. In my textbook the solution is given as ##\frac {F^x}{m}t=\frac {v^x}{\sqrt {1-v^{x^2}/c^2}}##. What bothers me is, when I separate the variables I get ##\frac {F^x}{m}dt=d(\gamma v^x)##. Can I simply consider ##d(\gamma v^x)## the variable of integration without any further considerations? Can I simply make the substitution ##\gamma v^x = u## and then...

Similar threads

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