Matlab
@jim_thompson5910
%% Problem 1 %{ Find: the value of w necessary to for the bar to remain constant angle beta. %} % Clears command and workspace window clc clear % Defined variables syms g w L b B m; % Omega rigid body wRB = [-w*cos(B); w*sin(B); 0]; % Moment of inertia matrix IG = [0 0 0; 0 ((1/12)*m*L^2) 0; 0 0 0]; % Angular momentum about the center mass of the bar HG = IG*wRB; % Time rate of change for angular momentum dHG = cross(wRB, HG) % Gravity vector g = [(g*cos(B)) -(g*sin(B)) 0]; % Length vector from G to O rGO = [(L/2) 0 0]; % Acceleration of center mass of bar aG = [-w^2*((b*sin(B) + (L/2)*(sin(B))^2) -w^2*(b*cos(B) + (L/2)*sin(B)*cos(B)))]; % Reactions vector at pivot point O FRO = m*(aG - g) % Sum moments about center mass of bar MG = cross(rGO, FRO)
Is there any way I can find w using a command in Matlab? I found it using hand calculations.
MG = dHG and you solve by hand.
cross refers to a matrix cross product?
Yes.
I don't see how wRB = [-w*cos(B); w*sin(B); 0]; is a 3x3 matrix
cross products only work in R3
I made it a 3x1 because of the matrix multiplication between IG and wRB.
oh nvm, so wRB and HG are 3x1 matrices, ie vectors
Yes.
this command might work https://www.mathworks.com/help/symbolic/solve.html though not sure, I'm still trying to picture what the equation looks like
I have the solution written out by hand. Let me upload an image.
@jim_thompson5910
yikes, a lot more than what I was thinking
does the solve command work though?
You mean eqn = solve(x) = 1; solx = solve(eqn, x) ?
something like that, but idk if that format will work
It doesn't work.
Join our real-time social learning platform and learn together with your friends!