电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

一维偏微分方程的pdepe(matlab)函数解法

一维偏微分方程的pdepe(matlab)函数解法_第1页
1/8
一维偏微分方程的pdepe(matlab)函数解法_第2页
2/8
一维偏微分方程的pdepe(matlab)函数解法_第3页
3/8
本文根据matlab 帮助进行加工,根据matlab 帮助上的例子,帮助更好的理解一维偏微分方程的pdepe 函数解法,主要加工在于程序的注释上。 Ex amples Ex ample 1. This example illustrates the straightforward formulation, computation, and plotting of the solution of a single PDE. This equation holds on an interval for times . The PDE satisfies the initial condition and boundary conditions It is convenient to use subfunctions to place all the functions required by pdepe in a single function. function pdex1 m = 0; x = linspace(0,1,20); %linspace(x1,x2,N)linspace是Matlab中的一个指令,用于产生x1,x2之间的N点行矢量。 %其中x1、x2、N分别为起始值、终止值、元素个数。若缺省N,默认点数为100 t = linspace(0,2,5); sol = pdepe(m,@pdex1pde,@pdex1ic,@pdex1bc,x,t); % Extract the first solution component as u. u = sol(:,:,1); % A surface plot is often a good way to study a solution. surf(x,t,u) title('Numerical solution computed with 20 mesh points.') xlabel('Distance x') ylabel('Time t') % A solution profile can also be illuminating. figure plot(x,u(end,:)) title('Solution at t = 2') xlabel('Distance x') ylabel('u(x,2)') % -------------------------------------------------------------- function [c,f,s] = pdex1pde(x,t,u,DuDx) c = pi^2; f = DuDx; s = 0; % -------------------------------------------------------------- function u0 = pdex1ic(x) u0 = sin(pi*x); % -------------------------------------------------------------- function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t) pl = ul; ql = 0; pr = pi * exp(-t); qr = 1; In this example, the PDE, initial condition, and boundary conditions are coded in subfunctions pdex1pde, pdex1ic, and pdex1bc. The surface plot shows the behavior of the solution. The follow ing plot show s the solution profile at the final value of t (i.e., t = 2). 我们再将...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

一维偏微分方程的pdepe(matlab)函数解法

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部