Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE DO IN MATLAB Question 4 ( 2 0 pts ) : Solve a Large, Transient System Using LU Decomposition ( 2 0 pts )

PLEASE DO IN MATLAB
Question 4(20pts): Solve a Large, Transient System Using LU Decomposition (20 pts)- Partial credit possible
In the attached file TransientHeatFlux.mat darr are an A matrix and b vector right-hand-side representing a model of a plate held initially at 250 C, with front edges at OC and back edges insulated [note that the model was developed using the finite difference method, but this is not important for your solution]. The solution "x" to this system is the temperature T of various positions in the plate at a particular time ti. Solution of the matrix system is equivalent to taking a step in time; that is, solving the system Ax=b is really solving AT(ti+1)=T(ti). Taking this to the next step, the current solution vector x=T(ti+1) becomes the right-hand side vector "b" to obtain the solution at the next time x=T(ti+2), and so on.
Use the MATLAB function lu() or equivalent python function scipy.linalg.lu_factor() to perform LU decomposition of the A matrix, then perform 75 solves (i.e.75 time steps), computing the b vector at each new time from the previous b vector. Use the MATLAB backslash function () or equivalent python function scipy.linalg.lu_solve() to perform matrix solves with the L and U matrices obtained. Note you may also need to track a pivot/permutation matrix if the decomposition routine performs pivoting (row swapping). If needed, be sure to use the solving sequence discussed in lecture (1)Lz=b, then (2)Ux=z. Overwrite the old b vector (you don't need to save them, but you will plot them at certain times - see below).
NOTE: A is a 6,4006,400 element matrix (40,960,000 entries!). It may take a while to LU decompose and even more to solve via nave Gauss Elimination. Don't "look" at this A matrix, it will scroll in the command window until the end of time...
At each time step, visualize the current solution (b) using the following commands:
(MATLAB)(python)Note that N,xx, and yy are also provided in the .mat file above, although depending on how the .mat file is loaded your use of these variables in python may be slightly different. Given that the b vector in the .mat file is b(0), print
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions