Question
I am very new to MATLAB, don't know very much yet at all. Any guidance or detail you could give me would be greatly appreciated.
I am very new to MATLAB, don't know very much yet at all. Any guidance or detail you could give me would be greatly appreciated.
Exercise 2 (3 points) Difficulty: Easy
Theory: In this Exercise you will work with an application of Linear Algebra to solving a problem using Hooks Law from physics. We will consider an elastic beam which is supported on each end and is subject to forces applied at n points. Let vector f list the forces at the n points and let vector y in n list the amounts of deflection (displacements) of the beam at these points. Hookes Law from physics describes the relation between the vector of forces and the deflection vector:
y = Df, where D is a flexibility matrix. The matrix D1 is called the stiffness matrix.
The function that you will create calculates the forces applied at the points when the amounts of deflection are measured and the flexibility matrix D is given. If the flexibility is measured in inches of deflection per pound of load, then the stiffness is given in pounds of load per inch of deflection. If the units are centimeters per newton of force, then the units for stiffness are newtons per centimeter of deflection.
**Write a MATLAB
function [S,f]=beam(D,y)
First, the function should check whether a square matrix D is an nn matrix, where n = length(y), and whether D is invertible. If it is not the case, the program terminates and returns a message that D is not a flexibility matrix for the deflection vector y. It will also output an empty matrix S and an empty vector f. If the conditions hold, the program will proceed with the two tasks: (1) calculate and output the vector f of forces for the given deflection vector y using the stiffness matrix D1 , which we denote a matrix S; (2) verify that the physical meaning of the jth column( j=1:n) of the stiffness matrix S is
the vector of the forces that have to be applied to n points to produce a unit deflection at the
point j ( j =1:n) and zero deflections at the other points. If your code shows that it is true,
output the message that the physical meaning of the stiffness matrix is valid, otherwise, the message could be I may need to check the code. %Explain a meaning of the negative entries of the matrix S. Note: you may need to use closetozeroroundoff function in your code.
**Type the function beam in your diary file. **Run the function beam on the following sets of variables: (a) D=0.1*rand(4), y=randi([20 50], 3,1) (b) D=0.01*rand(6), y=0.1*randi([10 20], 6, 1)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started