Not enough input arguments.
1 次查看(过去 30 天)
显示 更早的评论
I want to solve an equation with second derivatives of t and r and got These Problems.
"Not enough input arguments.
Error in PDE_lin_z>pde1DParams (line 70) c = DwDt*B/A;
Error in pdepe (line 246) [c,f,s] = feval(pde,xi(1),t(1),U,Ux,varargin{:});
Error in PDE_lin_z (line 20) sol = pdepe(m,@pde1DParams,@pde1DInitialCondition,@pde1DBoundaryCondition,r,t);"
% <a href="https://de.mathworks.com/help/matlab/ref/pdepe.html">PDEPE 1D Example on Mathworks</a>
m = 1;
r = linspace(0,1,50);
t = linspace(0,5,100);
sol = pdepe(m,@pde1DParams,@pde1DInitialCondition,@pde1DBoundaryCondition,r,t);
w = sol(:,:,1);
surf(r,t,w)
colorbar
title(['Numerical solution computed with ' num2str(length(r)) ' mesh points.'])
xlabel('Radius r')
ylabel('Time t')
function [c,f,s] = pde1DParams(r,t,w,DwDr,DwDt)
E = 70;
rho = 2.6989;
ny = 0.34;
A = (0.5-ny);
B = rho*(1-2*ny)*(1+ny)/E;
c = DwDt*B/A;
f = DwDr+1;
s = 0;
end
function [w0r,w0t] = pde1DInitialCondition(r,t)
w0r = sin(pi*r);
w0t = 0; % ?
end
function [pl, ql, pr, qr] = pde1DBoundaryCondition(rl, wl, rr, wr, t)
pl = wl;
ql = 0;
pr = pi * exp(-t); % z.B
qr = 1;
end
0 个评论
回答(1 个)
Tony Mohan Varghese
2018-7-11
Please refer to the example for Partial Differential Equations. The pdefun and icFun in the PDEPE function signatures are in the form of:
[c,f,s] = pdefun(x,t,u,dudx)
u = icfun(x)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Partial Differential Equation Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!