Oceanography 540--Marine Geological Processes--Winter Quarter 2001

MATLAB Example--Conductive Plate Model

This example uses MATLAB to calculate and display the temperature field for the boundary layer model.

While commands could be entered line by line into MATLAB's interactive environment, it is generally easier to write a script (i.e., program) of MATLAB commands which would be located in a file which by convention ends with ".m", e.g., plate.m would be a script, run with the command plate, that calculates and displays this temperature field.

My plate.m file (located in /usra/mcduff/oc540) is:

-----

kappa=25;
Tmelt=1400;
set the numerical values of parameters
z=0:5e3:1e5create vector of depths, z, in increments of 5000 m (5 km) to 100 km depth
t=0:5e6:1e8create vector of times, t, in increments of 5 My to 100 My
for I=1:1:21use the index I for depth and loop over the 21 values
T(I,0)=Tmelt;to avoid the singularity at t=0, use the boundary condition
for J=2:1:21use the index J for the time and loop over the remaining 21 elements
T(I,J)=Tmelt*erf(z(I)/2*sqrt(kappa*t(J))));calculate the temperature for the Ith depth and the Jth time
endclose the time loop
endclose the depth loop
contour(t,-z,T);contour the temperature T as a function of t and -z (to have depth increase downward)

-----


Lecture Index | Search the Ocean 540 Pages | Ocean 540 Home

Valid HTML 4.0!

Oceanography 540 Pages
Pages Maintained by Russ McDuff (mcduff@ocean.washington.edu)
Copyright (©) 1994-2001 Russell E. McDuff and G. Ross Heath; Copyright Notice
Content Last Modified 1/4/2001 | Page Last Built 1/4/2001