function dx = ODE_ProchiralPing(t,x,k,EobySo) % Now just calculate the derivatives for the evolution of the state variables % - this is for prochiral Ping model % x_dot = F*theta % s_dot = J*s + F - now removed % Check input and output arguments are correctly supplied if nargin~=4 error('Four input arguments are required'); end % Index to k's %1 2 3 4 5 6 7 8 9 10 11 12 %k1n k2 k3Rn k4R k3Sn k4S km1 km2n km3R km4Rn km3S km4Sn %Index to x's %1 2 3 4 5 6 7 8 9 10 %En EDn Esn ESRn ESSn Dn Qn Sn PRn PSn F = [-x(1)*x(6), 0, 0, x(4), 0, x(5), x(2), 0, 0, -x(1)*x(9), 0, -x(1)*x(10); x(1)*x(6), -x(2), 0, 0, 0, 0, -x(2), x(3)*x(7), 0, 0, 0, 0; 0, x(2), -x(3)*x(8), 0, -x(3)*x(8), 0, 0, -x(3)*x(7), x(4), 0, x(5), 0; 0, 0, x(3)*x(8), -x(4), 0, 0, 0, 0, -x(4), x(1)*x(9), 0, 0; 0, 0, 0, 0, x(3)*x(8), -x(5), 0, 0, 0, 0, -x(5), x(1)*x(10); -EobySo*x(1)*x(6), 0, 0, 0, 0, 0, EobySo*x(2), 0, 0, 0, 0, 0; 0, EobySo*x(2), 0, 0, 0, 0, 0, -EobySo*x(3)*x(7), 0, 0, 0, 0; 0, 0, -EobySo*x(3)*x(8), 0, -EobySo*x(3)*x(8), 0, 0, 0, EobySo*x(4), 0, EobySo*x(5), 0; 0, 0, 0, EobySo*x(4), 0, 0, 0, 0, 0, -EobySo*x(1)*x(9), 0, 0; 0, 0, 0, 0, 0, EobySo*x(5), 0, 0, 0, 0, 0, -EobySo*x(1)*x(10)]; dx = F*k;