how do i continuously calculate an output with an increasing input of angles ?

1 view (last 30 days)
i am trying to caluculate 'W' at angles between 0-60 degrees. im not sure how to create a loop function that will allow me to continuously calculate this output whilst varing the angle. I tried using 'theta = 0:60' but that caused an error. my code so far:
theta=(0:60);
w_s = 10; % angular velocity of spin
a_s = 6; % angualar acceleration of spin
w_n = 3; % angular velocity of nutation
a_n = 2; % augalar acceleration of nutation
w_p = 5; % angular velocity of precession
a_p = 4; % angular acceleration of precession
%% Geometry values
rA = [0 7.4103 7.1651];
%% vectors
vw_s = [0 w_s*sind(theta) w_s*cosd(theta)];% spin vector
vw_p = [0 0 w_p]; % precession vector
vw_n = [-w_n 0 0]; % nutation vector
%% Angualar velocity
wi = [-w_n 0 0]; % i component of W
wj = [0 w_s*sind(theta) 0]; % j component W
wk = [ 0 0 (w_p + w_s*cosd(theta))]; % k component of W
W = wi + wj + wk; % Angular Velocity;

Accepted Answer

darova
darova on 29 Jul 2021
You need to make wi vector the same size as wj and wk
wi = [-w_n+theta*0 0 0]; % i component of W
  3 Comments
darova
darova on 1 Aug 2021
I don't understand the question. If wi, wj and wk are vecors then W is also a vector

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!