Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % This is a comment; to write a comment, you have to start the line with a '%'.
- % I will painstakingly do this question on MATLAB in detail for you.
- % We start with the RHS, and denote the forces A and B respectively.
- F_A = 30; %The magnitude of the force in Newtons
- F_B = 120;
- A_x = -7;
- A_y = -1; %The directions of F_A. Negative because it is pointing left and down.
- B_x = 1;
- B_y = 5;
- F_A_x = F_A * A_x / sqrt(A_x^2 + A_y^2); %The x-direction component of F_A.
- % Found by scaling the triangle given in the x-direction. If still confusing ask me.
- F_A_y = F_A * A_y / sqrt(A_x^2 + A_y^2);
- F_B_x = F_B * B_x / sqrt(B_x^2 + B_y^2);
- F_B_y = F_B * B_y / sqrt(B_x^2 + B_y^2);
- % Notice the similarity in the expressions written above ^.
- % I have written these out in full, but there is a quicker way to do all these repetitive functions on MATLAB!
- rhsF_x = F_A_x + F_B_x;
- rhsF_y = F_A_y + F_B_y;
- rhsF = sqrt(rhsF_x^2 + rhsF_y^2)
- % I have written this command without a ';' so the result is printed out
- % The part below is beyond the scope of what you should be able to understand on MATLAB
- % But I repeat the process of getting x- and y- components for the LHS force, then compare with RHS force to find F
- syms F;
- expr_x = F * -cosd(17) + 2*F*cosd(27);
- expr_y = F * sind(17) + 2*F*sind(27);
- expr_F = sqrt(expr_x^2 + expr_y^2);
- assume(F > 0);
- % The below is the final answer, so I have chosen not to suppress the result.
- solF = double(solve(expr_F == rhsF, F))
Add Comment
Please, Sign In to add comment