When I use ode45 to solve a state space equation, the solution will be diverge. Interestingly, if I set the ma (which I've overstriked) to zero, the result will be converge.
Show older comments
clear
clc
xm_init = [0.09 0 0 0 0 0];
[t, xm] = ode45(@simplified_model, [0,200], xm_init);
plot(t,xm(:,1))
function dxm = simplified_model(t,xm)
kt = 1.8406e9;
kp = 1.3386e10;
ct = 5.2321e7;
cp = 2.35951e7;
It = 2.0444e9;
Ip = 3e9;
g = 9.8;
ma = 20000;
ka = 5000;
ca = 9000;
mt = 347460;
mp = 5452000;
Rt = 40;
Rp = 0.28;
Ra = 90;
M = [Ip 0 0
0 It 0
0 0 ma];
K = [kp+kt+mp*g*Rp -kt 0
-kt -mt*g*Rt+kt+ka*Ra*Ra+ma*g*Ra -ka*Ra-ma*g
0 -ka*Ra-ma*g ka];
C = [cp+ct -ct 0
-ct ct+ca*Ra*Ra -ct*Ra
0 -ct*Ra ca];
Am = zeros(6,6);
Am(1:3,4:6) =...
[1 0 0
0 1 0
0 0 1];
Am(4:6,1:3) =-M\K;
Am(4:6,4:6) =-M\C;
xm = [xm(1) xm(2) xm(3) xm(4) xm(5) xm(6)]';
dxm = Am*xm;
end

Accepted Answer
More Answers (0)
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
