Figure 1 File Edit View Insert Tools Desktop Window Help 0.3 w (rad/s) 0.2 0.1 -0.1 -0.2 -0.3 0 1 2 3 4 5 rev 9 - ☐ W1 w2 w3 Х 7 8 9 10

Elements Of Electromagnetics
7th Edition
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Sadiku, Matthew N. O.
ChapterMA: Math Assessment
Section: Chapter Questions
Problem 1.1MA
icon
Related questions
Question

For the following MATLAB code, I need to answer a few questions. Can you identify the curves as elliptic functions? Which curves reflect the sn, cn, and dn functions?
From the curves, determine the maximum amplitudes and the period corresponding to
each angular velocity component.

 

clc;
clear all;
 
I = [500; 125; 425];
w = [0.2; 0.1; 0.2];
rev = 0:0.01:10;
C = eye(3);
 
% Using ode45 to integrate the KDE and DDE
options = odeset('RelTol',1e-9,'AbsTol',1e-9);
result = ode45(@K_DDE, rev, [w; I; C(:)], options);
v = result.x;
 
 
 
% Extracting information from the ode45 solver
w = result.y(1:3, :);
C_ode = reshape(result.y(7:end, :), [3,3,length(v)]);
 
 
plot(v, w)
xlabel('rev')
ylabel('w (rad/s)')
legend('w1', 'w2', 'w3')
 
 
 
 
% Functions
function dwCdt = K_DDE(~, w_IC)
 
% Extracting the initial condtions to a variable
w = w_IC(1:3);
I = w_IC(4:6);
C = reshape(w_IC(7:end), [3, 3]);
 
 
I1 = I(1);
I2 = I(2);
I3 = I(3);
 
K1 = -(I3-I2)/I1;
K2 = -(I1-I3)/I2;
K3 = -(I2-I1)/I3;
 
% Kinematic Differential Equations
dCdt = zeros(9,1);
dCdt(1) = 2*pi*(C(1,2)*w(3) - C(1,3)*w(2));
dCdt(2) = 2*pi*(C(1,3)*w(1) - C(1,1)*w(3));
dCdt(3) = 2*pi*(C(1,1)*w(2) - C(1,2)*w(1));
dCdt(4) = 2*pi*(C(2,2)*w(3) - C(2,3)*w(2));
dCdt(5) = 2*pi*(C(2,3)*w(1) - C(2,1)*w(3));
dCdt(6) = 2*pi*(C(2,1)*w(2) - C(2,2)*w(1));
dCdt(7) = 2*pi*(C(3,2)*w(3) - C(3,3)*w(2));
dCdt(8) = 2*pi*(C(3,3)*w(1) - C(3,1)*w(3));
dCdt(9) = 2*pi*(C(3,1)*w(2) - C(3,2)*w(1));
 
% Dynamical Differential Equations
dwdt = zeros(3,1);
dwdt(1) = 2*pi*K1*w(2)*w(3);
dwdt(2) = 2*pi*K2*w(1)*w(3);
dwdt(3) = 2*pi*K3*w(1)*w(2);
 
 
% Combining the w and C into one output matrix
dwCdt = [dwdt; 0; 0; 0; dCdt(:)];
 
end
 
 
function dwCdt2 = K_DDE2(~, w_en)
 
% Extracting the initial condtions to a variable
w = w_en(1:3);
C = reshape(w_en(4:12), [3, 3]);
Z = w_en(13);
 
 
I = 0.060214;
J = 0.015707;
x = (J/I) - 1;
y = Z - 1;
s = Z;
 
 
% Kinematic Differential Equations
dCdt = zeros(9,1);
dCdt(1) = 2*pi*(C(1,2)*(w(3)-C(2,3)) - C(1,3)*(w(2)-C(2,2)-s));
dCdt(2) = 2*pi*(C(1,3)*(w(1)-C(2,1)) - C(1,1)*(w(3)-C(2,3)));
dCdt(3) = 2*pi*(C(1,1)*(w(2)-C(2,2)-s) - C(1,2)*(w(1)-C(2,1)));
dCdt(4) = 2*pi*(C(2,2)*(w(3)-C(2,3)) - C(2,3)*(w(2)-C(2,2)-s));
dCdt(5) = 2*pi*(C(2,3)*(w(1)-C(2,1)) - C(2,1)*(w(3)-C(2,3)));
dCdt(6) = 2*pi*(C(2,1)*(w(2)-C(2,2)-s) - C(2,2)*(w(1)-C(2,1)));
dCdt(7) = 2*pi*(C(3,2)*(w(3)-C(2,3)) - C(3,3)*(w(2)-C(2,2)-s));
dCdt(8) = 2*pi*(C(3,3)*(w(1)-C(2,1)) - C(3,1)*(w(3)-C(2,3)));
dCdt(9) = 2*pi*(C(3,1)*(w(2)-C(2,2)-s) - C(3,2)*(w(1)-C(2,1)));
 
% Dynamical Differential Equations
dwdt = zeros(3,1);
dwdt(1) = 2*pi*(6*(-x)*(C(3,2))*(C(3,3)) - ...
(-x)*w(2)*w(3) + s*w(3));
 
dwdt(2) = 0;
dwdt(3) = 2*pi*(-12*(-x)*(C(3,1))*(C(3,2))+...
(-x)*w(1)*w(2) + s*w(1));
 
 
 
% Combining the w and C into one output matrix
dwCdt2 = [dwdt; dCdt(:); 0];
 
end
Figure 1
File Edit View Insert Tools Desktop Window Help
0.3
w (rad/s)
0.2
0.1
-0.1
-0.2
-0.3
0
1
2
3
4
5
rev
9
-
☐
W1
w2
w3
Х
7
8
9
10
Transcribed Image Text:Figure 1 File Edit View Insert Tools Desktop Window Help 0.3 w (rad/s) 0.2 0.1 -0.1 -0.2 -0.3 0 1 2 3 4 5 rev 9 - ☐ W1 w2 w3 Х 7 8 9 10
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Elements Of Electromagnetics
Mechanical Engineering
ISBN:
9780190698614
Author:
Sadiku, Matthew N. O.
Publisher:
Oxford University Press
Mechanics of Materials (10th Edition)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:
9780134319650
Author:
Russell C. Hibbeler
Publisher:
PEARSON
Thermodynamics: An Engineering Approach
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:
9781259822674
Author:
Yunus A. Cengel Dr., Michael A. Boles
Publisher:
McGraw-Hill Education
Control Systems Engineering
Control Systems Engineering
Mechanical Engineering
ISBN:
9781118170519
Author:
Norman S. Nise
Publisher:
WILEY
Mechanics of Materials (MindTap Course List)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:
9781337093347
Author:
Barry J. Goodno, James M. Gere
Publisher:
Cengage Learning
Engineering Mechanics: Statics
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:
9781118807330
Author:
James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:
WILEY