Menu

[Solved]Function File Explicitsolverm Write Function Named Explicitsolver Function Definition Line Q37231320

令87% 11:58 PM Tue Apr 9 ublearns.buffalo.cdu 5 of 14 Insulated BC where there is no heat flow into our out of the boundary 3.87%- 11:58 PM Tue Apr 9 r a Biography! Smit X >< T u. EGN 7:Capacito X D https://ublearns. D Biography! Smit https://ublearFunction file:ExplicitSolver.m

Write a function named ExplicitSolver that hasa function definition line, an H1 line, and appropriate helpcomments to define your inputs, outputs, and how to use yourfunction.

Inputs to your function must include:

  • The number of space (position) nodes (M)
  • The number of time steps (N)
  • The energy generated ( ̇)
  • The time step (∆ )
  • A vector of initial conditions of the temperature at each spacenode at = 0
  • The boundary condition for node 1 as a number (1, 2, 3, or4)

A boundary condition parameter fornode 1 where the values sent into the function depends on the typeof the chosen boundary condition o For BC 1, the value sent to thefunction must be o For BC 2, the value sent to thefunction must be o For BC 3, the value sent to thefunction must be 0 o For BC 4, the value sent to the function mustbe [ℎ , ∞] as a vector

  • The boundary condition for node M as a number (1, 2, 3, or4)
  • A boundary condition parameter for node M where the valuesdepend on the type of chosen boundary condition
  • For BC 1, the value sent to the function must be
  • For BC 2, the value sent to the function must be
  • For BC 3, the value sent to the function must be 0
  • For BC 4, the value sent to the function must be[ℎ , ∞] as a vector
  • Any other inputs you deem necessary.

Outputs from the function must include:

  • The temperature distribution over time, ( , ), as a 2D arrayof × elements where each column corresponds to the temperaturedistribution at a single instant in time.

In your function, solve the explicit finite different methodusing the required inputs. This can be done with the followingmethod:

  1. Initializing the first column in the temperature distributionmatrix, ( , ), with the initial condition vector defining thetemperature at the initial time, = 0.
  2. Solving the system of equations (equation 5a and thecorresponding boundary condition equations) using the initialtemperatures as to find the next set of temperatures, +1. Store your new set of temperatures in the nextcolumn of ( , ).
  3. Then, using the solution just obtained as , tosolve the system of equations to find the next set of temperaturesfor +1.
  4. The process is repeated until the temperature at every timestep is estimated. Always store your new set of temperatures in thenext column of ( , ).

******PLEASE USE MATLAB IF POSSIBLE*****

令87% 11:58 PM Tue Apr 9 ublearns.buffalo.cdu 5 of 14 Insulated BC where there is no heat flow into our out of the boundary 3. (8a) (8b) Convective BC where heat flow at the boundaries defined according to the principles of convection. h is defined as the heat transfer coefficient at a specific boundary node At node 1: T+1-T+1 -TM-1 At node M: “M+1 and Too is the outside temperature at a large distance from the plate (9a) At node M:1- 2T – 2T (9b) Any two equations for a specified BC can be combined with equation (5a) for a complete set of equations for each node. The solution can be found by solving the equation for each node Tm*1, to determine the temperature profile across the plate for a single time interval, T”+1 This type of system is called uncoupled since each equation has only one unknown temperature, Tm1, for time, tn+1, seen on the left hand side of each equation. The right hand side for each equation can be determined from the known, previously solved for temperature distribution from the previous time step T Stability Criterion for Explicit Method: Limitation on At The explicit method results in relatively simple equations with one unknown per node, +1. however, it suffers from an undesirable feature that severely restricts its utility. The explicit method is not unconditionally stable and the largest permissible value of the time step At is limited by the stability criterion shown in equation (10). If the time step At is not sufficiently small, the solutions obtained by the explicit method may oscillate wildly and diverge from the actual solution. To avoid such divergent oscillations, the value of At must be maintained below a certain upper limit established by the stability criterion Stability Criterion for Explicit Method Ax At <for stability (10) 20 Implicit Finite Difference Method The implicit method for solving this problem is unconditionally stable; however, it requires solving a system of equations for each time, tn+1. The system of equations for the implicit method can be built using equation (11) for the internal nodes (m -2 to M- 1) and the two equations defined by the boundary conditions for the implicit method, shown below for m- 2,3,., M-1 (11) EAS 230 – Spring 2019 – PP Page 5 of 14 87%- 11:58 PM Tue Apr 9 r a Biography! Smit X >< T u. EGN 7:Capacito X ‘ D https://ublearns. D Biography! Smit https://ublearns. Х й ublearns.buffalo.edu 4 of 14Similarly, the nodes representing the change in time are uniformly spaced on the interval 0 St tmax such that tn represents the time at each interval and can be determined by equation (3a) where n is the interval number and N is the total number of intervals. (3a) The time of each interval, At, can be calculated with equation (3b) and is also known as the size of the time step (3b) The overall solution is found by calculating the temperature at each node in position, m, and at each node in time, n. Explicit Finite Difference Scheme: The generic solution, found in equation (1), can be formalized with the Forward Time Centered Space (FTCS) finite difference format and is found in equation (5a) where r is calculated with equation (5b) m2-2, 3, , M-1 (5a) Ax Equation (5a) represents a set of M – 2 equations for M – 2 internal nodes at a specific time tn+1. Each equation for each node (m 2 to M 1) is explicit for one temperature at time tn+1 and can be used to solve for the temperature at a specific internal node at a specific time interval. Two more equations are required for m-1 and m-M to determine the full temperature distribution for a specific time interval, T”+1, at all nodes. The final two equations can be found by applying specific boundary conditions. Four types of boundary conditions (BC) are described below where the remaining two equations for the explicit method are shown for each specified BC. 1. Prescribed temperature BC where the temperatures at node 1 and node M are constant. At node 1: Tn+1-To Constant At node M: TT Constant 6a 2. Prescribed heat flux BC where heat naturally flows from hot to cold temperatures at the edge of the plate. q is defined as the heat flux at the specific boundary node. Ax At node 1: Tn+1-T2+1 + At node M: TM+1 Tt+LA* (7a) (7b) EAS 230 – Spring 2019 – PP Page 4 of 14 OPEN IN… Show transcribed image text 令87% 11:58 PM Tue Apr 9 ublearns.buffalo.cdu 5 of 14 Insulated BC where there is no heat flow into our out of the boundary 3. (8a) (8b) Convective BC where heat flow at the boundaries defined according to the principles of convection. h is defined as the heat transfer coefficient at a specific boundary node At node 1: T+1-T+1 -TM-1 At node M: “M+1 and Too is the outside temperature at a large distance from the plate (9a) At node M:1- 2T – 2T (9b) Any two equations for a specified BC can be combined with equation (5a) for a complete set of equations for each node. The solution can be found by solving the equation for each node Tm*1, to determine the temperature profile across the plate for a single time interval, T”+1 This type of system is called uncoupled since each equation has only one unknown temperature, Tm1, for time, tn+1, seen on the left hand side of each equation. The right hand side for each equation can be determined from the known, previously solved for temperature distribution from the previous time step T Stability Criterion for Explicit Method: Limitation on At The explicit method results in relatively simple equations with one unknown per node, +1. however, it suffers from an undesirable feature that severely restricts its utility. The explicit method is not unconditionally stable and the largest permissible value of the time step At is limited by the stability criterion shown in equation (10). If the time step At is not sufficiently small, the solutions obtained by the explicit method may oscillate wildly and diverge from the actual solution. To avoid such divergent oscillations, the value of At must be maintained below a certain upper limit established by the stability criterion Stability Criterion for Explicit Method Ax At

Expert Answer


Answer to Function file: ExplicitSolver.m Write a function named ExplicitSolver that has a function definition line, an H1 line, a… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *