MATLAB_Heat_Non_NonhomogBC_1D Description and Help

MATLAB_Heat_Non_NonhomogBC_1D is a graphical user interface (GUI) that plots solutions to the following one-dimensional nonhomogeneous heat equations:

(                2
|{ ∂∂tu(x, t) = k2 ∂∂x2-u(x,t) + f (x,t), - 1 < x < 1,t > 0,

|( u(x, 0) = u0(x), - 1 < x < 1,
  u(- 1,t) = T1,u(1,t) = T2,t > 0,
(1)

where T1 and T2 are nonzero constants. This IBVP is equipped with what are referred to as nonhomogeneous Dirichlet boundary conditions because T1and T2 are assumed to be nonzero. The same IBVP could be equipped instead with nonhomogeneous Neumann boundary conditions to yield

(                2
|{ ∂∂tu(x, t) = k2 ∂∂x2-u(x,t) + f (x,t), - 1 < x < 1,t > 0,

|( u(x, 0) = u0(x), - 1 < x < 1,
  ∂∂ux(- 1,t) = T1, ∂∂ux (1, t) = T2,t > 0.
(2)

In addition, the GUI compares solutions with nonhomogeneous boundary condition to their homogeneous counterpart.

To use the GUI, specify a diffusivity constant, a final time to plot solutions, a boundary condition, an initial condition, and values for T1 and T2 before clicking the Solve Heat Equation button.


PIC

Figure 1: MATLAB_Heat_Non_NonhomogBC_1D GUI


The initial conditions in the dropbox menu of the GUI are labeled as 0, 1, sine, cosine, exponential and step function. These correspond to

u0(x) = 0,
u0(x) = 1,
u0(x) sin (πx),
u0(x) = cos (4πx) + 1,
u0(x) = e-100x2 ,
u0(x) = {
    1,x ∈ [- 12, 12]

    0, otherwise ,
respectively. The forcing functions in the dropbox menu of the GUI are labeled as f1, f2, f3, f4, and f5. These labels refer to the functions
f1(x,t) = A,whereA≠0,
f2(x,t) = Ax + Bt,whereA,B≠0,
f3(x,t) = cos (ωt),whereω > 0,
f4(x,t) = e-at,wherea > 0,
f5(x,t) = {       1        1
  A,  - 2 ≤ x ≤  2,t > 0
  0   otherwise .
Once all inputs have been specified, click the Solve Heat Equation button to input the forcing function parameters.

PIC

Figure 2: Input forcing function parameters.


Once the forcing function parameters have been specified the GUI will display a movie of the solution.


PIC

Figure 3: A screenshot of the movie that displays the solution.


The movie will play twice before outputting a surface plot of the solution.


PIC

Figure 4: A surface plot in t and x of the solution.


To compare the nonhomogeneous boundary condition solution to its homogeneous counterpart, click the Compare with Homogeneous BC button. The GUi will immediately display a movie with both solutions on the same axis.


PIC

Figure 5: Comparing nonhomogeneous and homogeneous BCs


Lastly a surface plot of both solutions will be displayed for comparison.


PIC

Figure 6: Surface plot of solutions with nonhomogenous and homogeneous BCs