Question: Thomas Algorithm for solving an equation set with a banded matrix 0 solutions submitted ( max: 3 ) There are four spring serially connected. The

Thomas Algorithm for solving an equation set with a banded matrix
0 solutions submitted (max: 3)
There are four spring serially connected. The force-balance equations for these spring system are given below:
k2(x2-x1)=k1x1
k3(x3-x2)=k2(x2-x1)
k4(x4-x3)=k3(x3-x2)
F=k4(x4-x3)
where k1,k2,k3,k4 are the spring constants of four springs which are 150,50,80,200kgs2, respectively.
F=14700N is the force applied on the springs.
Calculate x values by solving these equations using the Thomas Algorithm.
For this purpose, first modify the equations such that you have a tridiagonal matrix system (you can do this by hand - no need to show your hand calculations).
Enter the tridiagonal system you obtained into MATLAB as a matrix of "A" for coefficients of unknowns and a vector of "b" for constants on the right hand side.
A matrix should be 44 tridiagonal matrix, b vector should be 14 matrix such as b=[b1,b2,b3,b4]
Then, write a script which accepts inputs of A and b for the Thomas Algorithm steps of a) Decomposition b) Forward substutition c) Back Substutition.
Use "while" loop for the loops of these steps
The outputs should be in a 1 x 4 vector defined as "x" vector in MATLAB such as x=[x1,x2,x3,x4].
Do NOT use backslash operator or any other MATLAB solver functions to compute the output.
A simple test case has been provided to test your solution before submitting.| b =[];
x = thomasal(A,b)
% Thomas algorithm
function x = thomasal(A,b)
% Initialize the output vector.
n = length(b);
% Do the three steps of Thomas algorithm below.
% a) Decomposition
while
end
% b) Forward substitution
while
end
% c) Back substitution
while
end
end % end of function Assessment:
Is the input b vector correct ?(It should be a 14 matrix.)(Pretest)
Is the input A matrix correct?
Is the output calculated by Thomas algorithm correct?
Was backslash used to compute the results?
Does the code involve while loop?There are four spring serially connected. The force-balance equations for these spring system are given below:
where are the spring constants of four springs which are 150,50,80,200, respectively.
=14700 N is the force applied on the springs.
Calculate x values by solving these equations using the Thomas Algorithm.
For this purpose, first modify the equations such that you have a tridiagonal matrix system (you can do this by hand - no need to show your hand calculations).
Enter the tridiagonal system you obtained into MATLAB as a matrix of "A" for coefficients of unknowns and a vector of "b" for constants on the right hand side.
A matrix should be 4x4 tridiagonal matrix, b vector should be 1x4 matrix such as b=[b1,b2,b3,b4]
Then, write a script which accepts inputs of A and b for the Thomas Algorithm steps of a) Decomposition b) Forward substutition c) Back Substutition.
Use "while" loop for the loops of these steps
The outputs should be in a 1x4 vector defined as "x" vector in MATLAB such as x=[x1,x2,x3,x4].
Do NOT use backslash operator or any other MATLAB solver functions to compute the output.
A simple test case has been provided to test your solution before submitting.
Thomas Algorithm for solving an equation set with

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!