Question: Part B - Finite difference method Figure 2 : Finite difference discretization of noninsulated uniform rod between two bodies of constant temperature. - T i

Part B - Finite difference method
Figure 2: Finite difference discretization of noninsulated uniform rod between two bodies of constant temperature.
-Ti+1+(2+h'x2)Ti-Ti-1=h'Tax2,i=1,dots,n-1
To solve (1) using the finite difference method, we discretize the bar into n segments of length, x, as shown in Figure 2 and approximate the second derivative of temperature using finite divided differences. Then, after rearranging, the BVP in (1) can be expressed as a set of simultaneous algebraic equations,
Goals
Write a Matlab script, Script_NonInsulatedRod_FiniteDifference.m, that solves the BVP in (1) using the finite difference method and considering x=2m and x=0.1m. To do so, please:
(a) Develop the system of equations associated with (5) in a general form such that the same equations can be used for any specified segment length, x, i.e., DO NOT hard-code the specific finite difference equations for a given x. No te: Matlab's backslash operator will come in handy to solve the system of equations in (5).
(b) Plot the analytical solution in (2) alongside the two finite difference solutions. Please consider axis limits,xlim?([6.5,7.5]) and ylim([130,160]), so that the difference in the two numerical solutions is visible - see example in Figure 7.
Part B - Finite difference method Figure 2 :

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!