Algorithm 1.
Combining model equations and numerical integration method description to yield abstract code. Here, the differential equations in vector form are dx/dt = f(x, t) where x is the vector of state variables with components xv for variable v, and f is a vector function with corresponding components fv. All statements in the numerical integration method should be understood as referring to vectors of variables and vector functions.
for all statements σ in the numerical integration method do |
Expand f in σ |
Replace xnew in σ by y |
for all state variables v do |
Append component σv of the transformed σ to code |
end for |
end for |
for all state variables v do |
Append xv = yv to code |
end for |