Solve set of 8 first order ODE's in Octave (matlab)
$10-30 USD
In Progress
Posted over 9 years ago
$10-30 USD
Paid on delivery
I have a set of 8 ODE's such that
dT/ds = H T and T(a) = I (Indentity)
H is an 8x8 constant matrix included below.
I am looking for the Octave code to solve for
T(b)
where for example a = 5, b = 20
I would also be interested in having the solution coded in c++ using the Eigen library ([login to view URL]).
If this goes well I have a couple more very similar projects. One would be where the matrix H(s) is a 4x4 matrix but not constant. It would be a function of s.
function ret = H(s)
% This function in constant! Not a function of s
ret = zeros (8, 8);
m = 1;
R = 27;
E = 20E6;
t = 1.5;
nu = 0.3;
ret(2,1) = m/R;
ret(1,2) = -nu*m*R;
ret(6,2) = 2*pi*E*t*m*m/R;
ret(7,2) = 2*pi*E*t*m/R;
ret(1,3) = -nu/R;
ret(4,3) = -nu*m*m/(R*R);
ret(6,3) = 2*pi*E*t*m/R;
ret(7,3) = 2*pi*E*t/R*(1+t*t*m*m*m*m/(12*R*R));
ret(3,4) = -1;
ret(8,4) = pi*E*t*t*t*m*m/(3*(1+nu)*R);
ret(1,5) = (1-nu*nu)/(2*pi*E*t*R);
ret(6,5) = nu*m/R;
ret(7,5) = nu/R;
ret(2,6) = (1+nu)/(pi*E*t*R);
ret(5,6) = -m/R;
ret(8,7) = 1;
ret(4,8) = 6*(1-nu*nu)/(pi*E*t*t*t*R);
ret(7,8) = nu*m*m/(R*R);
% Everything else is zero
endfunction