Hi,
I currently trying to simulate a simple spring to compare two
solver/simulation.
We have a complex biological simulation working with IDA and C++ code,
but we want to move to an other physical simulator. Since there is
some difference with the two simulator, we want to compare them with a simple spring.

The code is in C++ and we use Sundial IDA DAE solver (it's the solver used in the reference simulation)
It is a perfect spring with no damping:
d^2x/dt^2 = k/m*x
Where k is the stiffness (10)
and m the mass (1)
I use yy = [x]

My residual function currently look like this :

Code:
```/* Residual function, see sundial ida doc */
int res_func(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr,
void *data)
{
// Import data from vectors
realtype *yval,
*ypval,
*rval;
realtype x,
v,
Fspring,
Fdamping ;

yval = NV_DATA_S(yy);
ypval = NV_DATA_S(yp);
rval = NV_DATA_S(rr);

x = yval ;
v = ypval ;
Fspring = STIFFNESS * x ;
Fdamping = DAMPING * v;

rval = Fspring - Fdamping - ypval ;

return(0);
}```
Since it is almost new to me to work with spring (last time was close to
a decade ago...) I may have forget something.
Thanks for all possible help.

-- Mayeu