burgers_pde.m

来自「有关the method of line即MOL算法的matlab代码」· M 代码 · 共 26 行

M
26
字号
    function xt = burgers_pde(t,x)
%...
%... set global variables
     global mu;
     global z0 zL n D1 D2;
%...
%... boundary conditions at z = 0
     x(1) = burgers_exact(z0,t);
%...
%... boundary conditions at z = zL
     x(n) = burgers_exact(zL,t);
%...
%... second-order spatial derivative - stagewise differentiation
%...    
     xz = D2*x;
     xzz = D2*xz;
%...
%... first-order spatial derivative
     fz = D1*(0.5*x.^2);
%...
%... temporal derivatives
%...
     xt = -fz + mu*xzz;
     xt(1) = 0;
     xt(n) = 0;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?