I have a stiff system which I want to integrate with integrate_adaptive and a controlled rosenbrock4 stepper from (boost::) odeint.
For the most conditions I can predict a good first time step, but for some it fails "for sure"
I assume the problem ist that one change does depend on a constant:
Change[0]=f(States,Changes) + C
The dependence on the States does show up in the Jacobian, C does not. But C can have a significant influence. I there a way to make the stepper know of the influence of C ?
To clarify the error I get is:
Integrate adaptive : Maximal number of iterations reached. A step size could not be found.
An other guess would is that is caused by the different magnitudes of States[0] and the other states
I try to give an structural example, the full example would be to big, all factors are set to one:
class system{
void operator(const state_type &states, state_type &changes, const doulbe t){
changes[0]=0.0;
for( int i =1; i<states.size();++i){
changes[i]=(states[0]-exp(-1/states[i])/states[i];
changes[0]-=states[i]*states[i]*changes[i];
}
changes[0]+=C;
}
C
may in some cases be more bigger than the contribution from the states
The Jacobian is set up accordingly.