Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
where xl represents the left endpoint of the boundary and xr represents the right
endpoint
of the boundary, and initial condition
u(0, x) = f(x).
For given problem the equation can be written as :
1
= 2
( 2
)+o
at xl
Algorithm
1.Functions parabolic and parabolic1 are defined to plot the concn vs position and
surface contours respectively.
2. The constants required to be inputted by the user are fed into required
variables using input function.
3. D stores diffusivity coefficient, k stores the bulk concentration stores the radius
of cylinder,T stores the end time.
4. Functions bcl, initial1 and eqn1 are defined to pass the values of boundary
conditions, initial conditions and the equation to the function function.
5. The values of concentration gets stored in a 2 dimensional array u which
evaluated by calling the functions bcl,initial1 and eqn1 using function handles.
6. The function plot and surf produces the graphs and xlabel and ylabel is for
naming the axis.
7 Potting concentration vs position at a particular time is done by varying the
dimension associated with time through a loop the variable of the loop being z.
8. For a particular z u values at all x is ploted with respect to x.
9. hold on function used to retrieve all the plots on the same graph each
corresponding to a particular time.
function u0 = initial1(x)
%INITIAL1: MATLAB function M-file that specifies the initial condition
%for a PDE in time and one space dimension.
u0=0;
SAMPLE OUTPUT
Plot for surface contour such that concentration on z axis time on y axis and
distance on x axis.