Comparison of odeint's runge_kutta4 with Matlab's ode45
I would like to use runge_kutta4 method in the odeint C++ library . I've solved the problem in Matlab. My following code in Matlab to solve x'' = -x - g*x' , with initial values x1 = 1 , x2 = 0 , is as follows main.m clear all clc t = 0:0.1:10; x0 = [1; 0]; [t, x] = ode45('ODESolver', t, x0); plot(t, x(:,1)); title('Position'); xlabel('time (sec)'); ylabel('x(t)'); ODESolver.m function dx = ODESolver(t, x) dx = zeros(2,1); g = 0.15; dx(1) = x(2); dx(2) = -x(1) - g*x(2); end I've installed the odeint Library. My code for using runge_kutta4 is as follows #include <iostream> #include <boost