Trying to understand a logical way to complete a task

2 次查看(过去 30 天)
These are the tasks that I am trying to accomplish. What I do not understand is how to find a way to extract a certain value for u. Is it even possible to solve for a certain value of w?
I also don't understand how to extract values from my solved matrix "x" and plot them vs theta. If Nb and Torque are being solve in the loop, how is it possible to extract the data and plot them.
I'm NOT looking for someone to write the code. I just don't know where to start.
--> IN YOUR COMMENTS INDICATE The value for w (to nearest tenth of a rad/s) at which your box loses contact WHEN u = 0.8 and ALSO when u = 0.2.
--> PLOT as an output of your Code NB vs THETA and Drive Torque T vs THETA (two separate plots--figure 1 & figure 2). The plots should be produced when your program runs and be well labeled with units etc.
% The code should work automatically by a "while" loop to indicate when
% % Nb<0. the code should be set up to automatically increment untill it
% reached the specified Nb<0 value.
theta=30
sign=(cosd (theta)/abs (cosd (theta)))
u=.8
w=(2*pi/5)
R=1
c=4.05/12
H=18/12
y=H-(R*sind(theta/2))
Md=50/32.2
Id=(.5*Md*R^2)
Mp=75/32.2
Mb=30/32.2
alpha=0
u=.8
L=(6/12*R)
g=32.2
ax=(-R*w^2)*cosd(theta)
ab=(-R*w^2*cosd(theta))-(R*w^2*sind(theta))
ay=(-R*w^2)*sind(theta)
a=[1 0 1 0 0 0 0 0 0 0 0; 0 1 0 1 0 0 0 0 0 0 0; 0 0 -R*sind(theta) R*cosd(theta) 0 0 0 0 0 0 1; 0 0 0 0 1 0 1 0 0 0 0; 0 0 0 0 0 1 0 1 0 0 0; 0 0 0 0 -R*sind(theta) R*cosd(theta) 0 0 0 0 0; 0 0 -1 0 -1 0 0 0 (4*abs(sign)) 0 0; 0 0 0 -1 0 -1 0 0 (-4*u*sign) 0 0; 0 0 -c (3*R) -c (-3*R) 0 0 (-4*(y-c)) 0 0; 0 0 0 0 0 0 0 0 -sign u*sign 0; 0 0 0 0 0 0 0 0 (-u*sign) 1 0]
C=[0 Md*g Id*alpha 0 Md*g Id*alpha Mp*ax Mp*ay+Mp*g 0 Mb*ab Mb*g]
x=C/inv(a)
% x=[Ax Ay Bx By Cx Cy Dx Dy Nb Nc T]
% solve for when Nb<0
w = 0;
dw = 0.01;
rownum = 9;
colnum = 9;
while a(rownum,colnum) >= 0
w = w + dw;
end

回答(1 个)

Star Strider
Star Strider 2016-6-18
I don’t understand what you’re doing here:
x=C/inv(a)
Because:
a = [8 6; 3 1]; % Example Matrix
C = [3 5; 7 9]; % Example Matrix
x=C/inv(a)
x2 = C*a
x =
39 23
83 51
x2 =
39 23
83 51
Also, this is going to be a problem: ‘PLOT as an output of your Code NB vs THETA’ because THETA is a constant in your code. It will plot one point, or a vertical line of points at 30.
The same applies (for the same reason) here: ‘I also don't understand how to extract values from my solved matrix "x" and plot them vs theta.’

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by