Answered step by step
Verified Expert Solution
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 pts: Solve a Large, Transient System Using LU Decomposition pts Partial credit possible
In the attached file TransientHeatFlux.mat darr are an A matrix and vector righthandside representing a model of a plate held initially at C with front edges at 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 to this system is the temperature of various positions in the plate at a particular time Solution of the matrix system is equivalent to taking a step in time; that is solving the system is really solving Taking this to the next step, the current solution vector becomes the righthand side vector b to obtain the solution at the next time and so on
Use the MATLAB function lu or equivalent python function scipy.linalg.lufactor to perform LU decomposition of the A matrix, then perform solves ie 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.lusolve to perform matrix solves with the and matrices obtained. Note you may also need to track a pivotpermutation matrix if the decomposition routine performs pivoting row swapping If needed, be sure to use the solving sequence discussed in lecture then Overwrite the old vector you don't need to save them, but you will plot them at certain times see below
NOTE: is a element matrix 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:
MATLABpythonNote that Nxx 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 print
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