How do I solve 'Not enough input arguments'

16 ビュー (過去 30 日間)
Khili Khamesra
Khili Khamesra 2018 年 2 月 27 日
編集済み: Stephen23 2018 年 2 月 28 日
This is my code for solving the fick's equation. I am unsure as to what is my mistake. Any help is appreciated.
m=1;
xspan=linspace(0,30,300);
tspan=linspace(0,10,100);
sol=pdepe(m,pdefun,pdeinc,pdebound,xspan,tspan);
surf(xspan,tspan,u);
function [c,f,s]=pdefun(x,t,u,dudx)
c=1;
f=(0.02).* dudx ;
s=1;
end
function [uo]=pdeinc(~)
uo=1;
end
function [pl,ql,pr,qr] = pdebound(~,~,~,~,~)
pl=0;
ql=1;
pr=0;
qr=0;
end
I am getting the following error
Not enough input arguments.
Error in partialtrial>pdefun (line 14)
f=(0.02).* dudx ;
Error in partialtrial (line 9)
sol=pdepe(m,pdefun,pdeinc,pdebound,xspan,tspan);

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 2 月 27 日
sol=pdepe(m,@pdefun,@pdeinc,@pdebound,xspan,tspan);
  1 件のコメント
Khili Khamesra
Khili Khamesra 2018 年 2 月 28 日
Now I am receiving this error-
Error using pdepe (line 293) Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative.
Error in partialtrial (line 9) sol=pdepe(m,@pdefun,@pdeinc,@pdebound,xspan,tspan);
the equation is clearly parabolic, what can be my mistake?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMathematics and Optimization についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by