我用matlab中求解偏微分方程用到pdepe,运行显示错误This DAE appears to be of index greater than 1我用matlab中求解偏微分方程用到sol=pdepe(m,@pdefun,@pdeic,@pdebc,x,t);运行显示错误This DAE appears to This DAE appears to
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 14:31:13
我用matlab中求解偏微分方程用到pdepe,运行显示错误This DAE appears to be of index greater than 1我用matlab中求解偏微分方程用到sol=pdepe(m,@pdefun,@pdeic,@pdebc,x,t);运行显示错误This DAE appears to This DAE appears to
我用matlab中求解偏微分方程用到pdepe,运行显示错误This DAE appears to be of index greater than 1
我用matlab中求解偏微分方程用到sol=pdepe(m,@pdefun,@pdeic,@pdebc,x,t);运行显示错误This DAE appears to This DAE appears to be of index greater than 1,请问这是什么原因?
我的代码
%调用主函数
function[]=sample()
clear
clc
[t,x,y]=subfunction(2,0.2,3000,10);
%主函数 subfunction(2,0.2,3000,10)
function[t,x,y]=subfunction(L_in,v_in,y0_in,tt_in)
global L v y0 tt;
L=L_in;
v=v_in;
y0=y0_in;
tt=tt_in;
x=0:0.05:1;
t=0:1:tt;
m=0;
sol=pdepe(m,@pdefun,@pdeic,@pdebc,x,t);
figure('numbertitle','off','name','PDE Demo-by Whh')
surf(x,t,sol(:,:,1))
title('The distribution of sulfur dioxide vs time')
xlabel('X')
ylabel('T')
zlabel('C')
%目标PDE函数
function [c,f,s]=pdefun(x,t,y,dy)
global L v y0 tt;
c=1;
Dl=7e-4;
ee=0.5*L/v;
qm=107;
K=0.005;
k=0.0031;
Pe=v*L/Dl;
t=v*tt/L;
f=1/Pe*dy;
cal_s=@(x)ee*L/v*K*x*(1-(1+k*x*y0)/(qm*(1+k*y0)));
s=cal_s(y)-dy;
%边界条件
function [pa,qa,pb,qb]=pdebc(xa,ya,xb,yb,t)
%a表示上边界,b表示下边界
pa=xa-1;
qa=0;
pb=0;
qb=1;
%初值条件
function y0=pdeic(x)
y0=0;
初始条件为:
y(x,0)=0;
边界条件为:
y(0,t)=1;
偏y/偏x|(1,t)=0;
我用matlab中求解偏微分方程用到pdepe,运行显示错误This DAE appears to be of index greater than 1我用matlab中求解偏微分方程用到sol=pdepe(m,@pdefun,@pdeic,@pdebc,x,t);运行显示错误This DAE appears to This DAE appears to
计算直角坐标系下的SO2随时间的浓度分布?
警告的内容是:方程阶数大于1
以前解偏微分方程的时候也遇到过这个警告
我的建议是把方程定义函数中的匿名函数去掉试试