Question: Develop a Matlab function myBCE 9 that applies the boundary conditions of provided to the dependent variable T . Do not set values for the

Develop a Matlab function myBCE9 that applies the boundary conditions of provided to the dependent variable T. Do not set values for the global variables inside the function
Function Inputs:
t: scalar value of time t
T: column vector of temperature values T(vector) at all M +1 mesh points at time t
Function Outputs:
T: column vector of temperature T(vector at all M +1 mesh points at time with the boundary conditions applied
Use global variable
dx: grid spacing x
Provided left and right functions:
On the left, the fluid entering the pipe has a prescribed temperature of:
T(x=0,t)=5-4* sin(((20* pi)/11)*t)
On the right end of the pipe, the fluid leaving has a temperature gradient of:
dT/dx(x=L,t)=-2-3* sin(((4* pi)/5)* t)
At t=0, the temp of the fluid in the pipe is:
T(x,t=0)=5
I only need to get the right boundary code correct. the left is solved for with:
% Left boundary condition: T(x=0, t)
T(1)=5-4* sin(((20* pi)/11)* t);
Current right boundary condition codes attempted:
T(end)= T(end-1)+ dx *(-2-3* sin(((4* pi)/5)* t));
%Right boundary condition (x = L)
right =-2-3* sin((4* pi /5)* t);
T(M+1)= T(M)+ right * dx;

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!