Central differences are used for changing the parameters:
This looks for the first Parameter (vol1) as follows:
Parameterchange for vol1 left from the central point
A simple general solution requires the exponential of a matrix. Easy enough to do with the eigenvector decomposition of a matrix. But what we really need is for a given A and many values of t. Eigenvector calculations are somewhat time-consuming. So we design a function that can, given A, create the function
as a function of t.
Now we do a bit of general calculus. Consider the differential equation where A and B are constants. The solution will be of the form
where C and D are constants. We can find D by differentiating the equation for y and equating it to the value from the ODE, and then equating terms. We get
. We can solve that last equality for D (the y's cancel out) and get
. We can find C from the inital (or boundary) value. If we have that
then we can substitute and solve to get
. Using these two solutions we can write a function to get C and D: