I Rosenbrock method ODE : Abrupt increase during First iteration

gurbir_s
Messages
11
Reaction score
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
 
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.
 
Thread 'Direction Fields and Isoclines'
I sketched the isoclines for $$ m=-1,0,1,2 $$. Since both $$ \frac{dy}{dx} $$ and $$ D_{y} \frac{dy}{dx} $$ are continuous on the square region R defined by $$ -4\leq x \leq 4, -4 \leq y \leq 4 $$ the existence and uniqueness theorem guarantees that if we pick a point in the interior that lies on an isocline there will be a unique differentiable function (solution) passing through that point. I understand that a solution exists but I unsure how to actually sketch it. For example, consider a...
Back
Top