ode23 , matrix equation , 2nd order DE

1 view (last 30 days)
Gloria
Gloria on 14 Jun 2019
Commented: darova on 19 Jun 2019
How I will solve this matrix in Matlab ?
w=10.02;
p= 7850; %%%Kg/m^3;
g=9.81;
G=77*10^9; %%% N/m^2
E=206*10^9; %%% N/m^2
L=9.6; %%%m
D=0.15 ; %%m
m=pi*(D/2)^2*L*p;
A=pi*D^2/4 ; %%m2
J=m*D^2/8; %%Kg*m^2
Ip=pi*D^4/32 ; %% m^4
I=pi*D^4/64 ;
cx=0.05*m*w;
cy=0.05*m*w;
ct=0.08*J*w;
kx=3*E*I/L;
ky=3*E*I/L;
kt=G*Ip/L;

Accepted Answer

darova
darova on 14 Jun 2019
You can find roots for x'', y'' and dtheta'' every iteration solving matrix equation
function du = func(t,u)
u1 = u(1:3)'; % [x y theta]'
du1 = u(4:6)'; % [dx dy dtheta]'
dth = u(6); % dtheta
C = [cx 0 0; 0 cy 0; 0 0 cz]; % C matrix
K = ... % K matrix
F = [me(w+dth)^2+Fx; ...] % force vector
A = [m 0 -mesin(wt)...] % mass matrix
B = -C*du1 -K*u1 + F;
du = zeros(6,1);
du(1:3) = u(4:6);
du(4:6) = A\B;
end
  7 Comments
Gloria
Gloria on 19 Jun 2019
Error using ode45
Too many input arguments.
Error in Untitled2 (line 10)
[t,u] = ode45(@dokuz,tspan,IC);
BUT WITH ODE23 IT GIVES THE ANSWERS, THANK YOU SO MUCH
darova
darova on 19 Jun 2019
Can you accept the answer please?

Sign in to comment.

More Answers (1)

Torsten
Torsten on 14 Jun 2019
Convert the system to a first order system and write it as
M*y' = f(t,y)
Then use the mass-matrix option of the ODE solvers to supply M, define f in a function file and use ODE45, ODE15S, ... to solve.
  6 Comments
Gloria
Gloria on 16 Jun 2019
But I got the figures;
sdot=@(t,s)...
[s(2);
(m*e*sin(w*t)*s(6)'-cx*s(2)-kx*s(1)+m*e*(w+s(6))^2*cos(w*t)+Fx(t))/m;
s(4);
(-m*e*cos(w*t)*s(6)'-cy*s(4)-ky*s(3)-m*g+m*e*(w+s(6))^2*sin(w*t)+Fy(t))/m;
s(6);
(m*e*sin(w*t)*s(2)'-m*e*cos(w*t)*s(4)'-ct*s(6)-kt*s(5)-m*e*g*cos(w*t)+Mt(t))/(J+m*e^2)];
So Can I write s(6)',s(2)'s(4)' or not?
Jan
Jan on 16 Jun 2019
You can write s(6)', because ' is the Matlab operator for the complex conjugate transposition:
a = [1, 1i; ...
2, 2i]
a'
You provide real scalars. Then the ' operaotr does not change the value. So it is valid, but simply a confusing waste of time.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!