Create a single script (.m file) to solve this problem. Unless directed otherwis
ID: 3679403 • Letter: C
Question
Create a single script (.m file) to solve this problem. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. Suppress your output for every calculation or allocation with a semi-colon; you may only use print commands to print output. Each problem should be in separate cell, using the cell mode feature of MATLAB. Please remember to follow the programming style sheet on ANGEL. When complete, please submit your code to the dropbox on ANGEL; the graders will run it to view your output. Name your file like this: username_lab7.m (example: bj s5332_lab7.m). Your submission must be a single.m file. Recall that the angular momentum vector can be calculated via H = I omega where H is the angular momentum vector, I is the moment of inertia tensor (a 3D moment of inertia - for our purposes, can be treated like a matrix), and omega is the angular velocity vector. Consider a system with moment of inertia matrix I = [6000 0 0 0 11500 0 0 0 3400](kg m^2) and angular velocity vector omega = 1.3 b_1 + 0 b_2 - 2.3b_3 rad/s. Calculate the angular momentum vector, and print it as a row vector to the Command Window with a label, units and the unit vectors (do not worry about the finding a way to type subscripts or the A symbol over the unit vector - your result should look something like H = X bl + Y b2 + Z b3 (N-m-s), where X, Y and Z should be replaced by the actual values of each component of the vector). Use a selection structure to test if//, oj and the b2 unit vector all lie within the same geometric plane (i.e. are co-planar). Process to determine this: If they all lie within the same plane, print a statement to the Command Window to that effect; otherwise, if they do not all lie within the same plane, print a statement to the Command Window to that effect. You might recall that three vectors are co-planar if any one of them is orthogonal to (at a right angle to) a vector created by the cross product of the other two (it is your choice how you want to approach it). You might further recall that if two vectors are orthogonal, their dot product is 0. Piece these facts together.Explanation / Answer
Use script as below to prepare .m file which will calculate the angular momentum vector:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.