mrc-ide / odin.dust

Compile odin to dust
https://mrc-ide.github.io/odin.dust
Other
3 stars 1 forks source link

static solution of non linear equations for discrete time recurence equations #84

Open xtimbeau opened 3 years ago

xtimbeau commented 3 years ago

Imagine I have the following non linear problem in discrete time, where z is a exogeneous signal: image To solve it, and, not wanting or not able to inverse the equation, I'd like to use a numerical solver. Given x[t-1] and z[t]; it is starighfoward to solve for x[t] and thus being able to simulate the following discrete equation where f~ stand for the inverse of the inital function (x-sqrt(x+z)): image In odin, may be such non linearity could be detected or written explicitly by the user:

odin({ solve({ update(x) <- x + sqrt(update(x) + z[step] }, x)

I think that with continuous time, there is not such a problem as the equation can be written this way: image