Code covered by the BSD License  

Highlights from
Chebpack

image thumbnail

Chebpack

by

 

15 Jul 2011 (Updated )

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

[x,t,solnum]=pde_nonlin(n,dom, kind,dt,K)
function [x,t,solnum]=pde_nonlin(n,dom, kind,dt,K)
% Solves nonlinear evolution partial differential problems
% uses backward Euler for the linear part and
% forward Euler for the nonlinear part
%
x=pd(n,dom,kind);D=deriv(n,dom);T=cpv(n,dom,dom);niu=0.01/pi;
myDElin;A=speye(n)-dt*A;myINIT;uo=x2t(f,kind);solnum(:,1)=f;t=zeros(K+1);
h = waitbar(0,'Please wait...'); 
for k=2:K+1
    waitbar(k/K,h);
    myDEnonlin;myBC;un=A\b;t(k)=(k-1)*dt;
    uo=un;solnum(:,k)=t2x(uo,kind);sol(:,k)=uo;
end
myOUT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function myINIT
    % describes the initial condition in physical form
    % must be written by the user
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function myDElin
    % describes the linear spatial part of the pde
    % must be written by the user
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function myDEnonlin
    % 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

Contact us