Code covered by the BSD License

# Chebpack

### Damian Trif (view profile)

15 Jul 2011 (Updated )

The MATLAB package Chebpack solves specific problems for differential or integral equations.

[x,t,solnum]=pde_lin_matr(n,dom,kind,dt,K)
```function [x,t,solnum]=pde_lin_matr(n,dom,kind,dt,K)
% Solves linear partial differential problems of evolution type
% using matricial exponential method
%
x=pd(n,dom,kind);D=deriv(n,dom);T=cpv(n,x,dom);
myINIT;myDE;myBC;
for k=1:K
t(k)=k*dt;A=expm(t(k)*D2b);B=D2b\(A-eye(n-2));
solnum(:,k)=[alpha;A*uo(2:n-1)+B*b;beta];
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function myINIT
% describes the initial condition in physical form
% must be written by the user
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function myDE
% describes the linear spatial part of the pde
% must be written by the user
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function myBC
% describes the boundary conditions
% must be written by the user
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function myOUT
% describes the output of the program
% must be written by the user
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end```