====== Integration of Systems of Linear Differential Equations. Gear's method ====== Let's examine the following //SLDE//: y₁′ = y₂ y₂′ = y₁ y₁(0)=0 and y₂(0)=1 NB: we expect //sin(x)/cos(x)// as the result. #include #include #include #include #include "libnum/gear.h" #include "libnum/gear.output.h" using namespace NumericMethods; /* y₁′ = y₂ y₂′ = y₁ y₁(0)=0 and y₂(0)=1 // NB: we expect sin(x)/cos(x) as the result. */ static bool derfun(int n, double x, const double y[], double dy[]) { dy[0] = y[1]; dy[1] = -y[0]; return true; } static bool jacobian(int n, double x, const double y[], double j[]) { //for (int i = 0; i ---- [ [[..:classes:|Libnum methods]] ]