Numerical simulation (source code)

= Numerical simulation

A <numerical simulation> evolves or solves a <mathematical model> by numerical approximation to study its predicted behavior. Its outputs combine the model assumptions with the properties of the discretization and implementation.

For the decay equation $y'=-ky$, $k>0$, explicit Euler gives $y_{n+1}=(1-kh)y_n$. If $0<kh<1$, positive values decay monotonically; if $1<kh<2$, the approximation alternates sign even though its magnitude decreases. The exact solution remains positive for positive initial data. This shows that bounded numerical output can still contain behavior absent from the model, so convergence checks and physical interpretation must accompany a simulated trajectory.