LOTS OF PROGRAMS - Worksheet 4

%Here's how to run the matlab stuff...
%First, let's load in an energy and inner product matrix
%(for biharmonic splines on level 3)

EM3=loadEM3
IP3=loadIP3

%Now let's say we stored a vector from maple using write_vec into the file C.dat %the following command will store it in the vector C...

load C.dat

%Let's change that variable to c0 (just for naming conventions)

c0=C

%Suppose we wanted to create a d0 which is 0 everywhere but at one spot...

d0=zeros(243,1)
d0(1,1)=20;

%Let's find a vector containing the solution to the heat equation at time .03 with k=10000... ct = heat_eqn_t(EM3,IP3,c0,.03,10000)

%Or let's find the vector, but using the fact that t=kh... ct=heat_eqn(EM3,IP3,c0,.03/10000,10000)

%or let's find a vector containing the solution to the wave equation at time .03 with k=10000... ct = wave_eqn_t(EM3,IP3,c0,d0,.03,10000)

%find the same solution to the wave eqn, but with matrix exponential (the value of 10000 here is meaningless) ct = wave_eqn_t2(EM3,IP3,c0,d0,.03,10000)

%why not find a time series of a solution to the heat eqn with k=10000, generating a frame every .005 seconds, generating 40 frames A=generate_heat_time_series(EM3,IP3,c0,10000,.005,40)

%Or how about doing the same with the wave equation.... A=generate_wave_time_series(EM3,IP3,c0,d0,10000,.005,40)

%generating the same series, but using matrix exponential (the 10000 is again unused...) A=generate_wave_time_series(EM3,IP3,c0,d0,10000,.005,40)

%and now let's save the result to a file out.dat which we can load into maple for animating.... save out.dat A -ascii -double

Go to top