I really need help on these homework problems!
Thank you for helping in advance!
Sottile ? Spring 2016
CMPSC 200 Programming for Engineers with MATLAB
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: bjs5332_lab7.m). Your submission
must be a single .m file.
Problem 1 (4 points) Recall that the angular momentum vector can be calculated via
where is the angular momentum vector, is the moment of inertia tensor (a 3D moment of
inertia ? for our purposes, can be treated like a matrix), and is the angular velocity vector.
0 (kg ? m ) and
angular velocity vector = 1.3 / + 0 1 ? 2.34 rad/s.
Consider a system with moment of inertia matrix =
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 ^ symbol over the unit vector ? your result should look something like H = X b1 + 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 , and the 1 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.
Hints: (1) Consider if your vector should be written as a row vector or column vectors. (2) A
unit vector merely has a magnitude of 1 in a given direction ? consider careful how you could
define a 3D vector representing the unit vector 1 (3) The calculated value of the first component
of the angular momentum vector is 7800 N ? m ? s.
Sottile ? Spring 2016
Problem 2 (3 points)
Euler?s Equations for Rigid Body Motion can be written compactly as
+ ? I =
where is the matrix of the principal moments of inertia (a 3D moment of inertia ? for our
purposes, can be treated like a matrix), is the angular acceleration vector, is the angular
velocity vector and is a vector containing the applied torques. Note that the ? symbol in this
context indicates a cross product.
At a given moment of time for a particular system, you know that =
(kg ? m2), = 0 / + 0.2 1 ? 0.3 4 (rad/s2), and you also know that = 3.1 / ? 2 1 +
1.7 4 (rad/s).
Calculate for this system at the given time, 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 ^ symbol over the unit vector ? your result should look something like M = I
b1 + J b2 + K b3 (N-m), where I, J and K should be replaced by the actual values of
each component of the vector).
Hint: (1) See hint (1) for Problem 1. (2) The last component of is ?10200 N ? m.
Problem 3 (3 points)
The force balances in a truss system can be expressed with the matrix equation
where is a square matrix generated based on the shape and geometry of a truss structure,
is a column vector containing the internal forces and reactions, and is a column vector of
external forces. For a particular truss system, this reduces to
0 ?1 ? sin
0 ? sin
0 0 0 0
0 ?1 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 1 0 0
?1 0 0 0 1
1 0 1 0
where = 35 degrees. Note that the forces in this system are expressed in Newtons (N).
Sottile ? Spring 2016
Solve this matrix equation for using two of the three different linear algebra approaches we
have discussed; I leave it to your discretion which two you would like to use (though I would
like you to be comfortable with all three).
Print the values achieved from both techniques with labels and units. Include a listing of
what technique you used If you decide to use the \ operator, here is some advice: to print the \
symbol to the Command Window with fprintf, you will have to write \\ in place of \ if
using the fprintf command; if you prefer to use disp, you will only need to use one \.
Since you need to print 8 statements that all follow the same basic pattern, it would make sense
(but for this lab you are not required) to define the labels in a character array1 and use a loop to
print statements for the labels, values and units. If you take this approach, here is some guidance:
Create an array of labels: labels = ['F1'; 'F2'; 'F3'; all the way up to
'R3']. Make sure each label has the same number of characters.
If you decide to print with fprintf, use the field %s so that you get the whole element
of the character array. If you decide to print with disp, use num2str as usual.
Using a for loop, loop over the number of labels to be printed.
On each iteration print the label, value and unit. Make sure you take all the columns in
the current row to be printed (i.e. labels(k,:), if k is the loop index you used.
Hint: The calculated value of 1 (regardless of which method you use) should be 1200.21 N.
A character array is simply an array of characters (instead of numbers like we have been doing so far). We will
discuss data types in detail in lecture next week.
This question was answered on: Oct 07, 2020Buy this answer for only: $15
This attachment is locked
Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
About this QuestionSTATUS
Oct 07, 2020EXPERT
GET INSTANT HELP/h4>
We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.
You can also use these solutions:
- As a reference for in-depth understanding of the subject.
- As a source of ideas / reasoning for your own research (if properly referenced)
- For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
NEW ASSIGNMENT HELP?
Order New Solution. Quick Turnaround
Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.
WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.