Error in running the Example script of pdepe
Show older comments
I have copied the script presented as the first example in the Help page of pdepe.
When I try to run it, I get the error "Error using odeget Unrecognized property name 'InitialSlope'....."
This is the script
x = linspace(0,1,25);
t = linspace(0,1,25);
m = 1;
sol = pdepe(m,@heatcyl,@heatic,@heatbc,x,t);
u = sol(:,:,1);
surf(x,t,u)
xlabel('x')
ylabel('t')
zlabel('u(x,t)')
view([150 25])
plot(t,sol(:,1))
xlabel('Time')
ylabel('Temperature u(0,t)')
title('Temperature change at center of disc')
function [c,f,s] = heatcyl(x,t,u,dudx)
c = 1;
f = dudx;
s = 0;
end
%----------------------------------------------
function u0 = heatic(x)
n = 2.404825557695773;
u0 = besselj(0,n*x);
end
%----------------------------------------------
function [pl,ql,pr,qr] = heatbc(xl,ul,xr,ur,t)
n = 2.404825557695773;
pl = 0; %ignored by solver since m=1
ql = 0; %ignored by solver since m=1
pr = ur-besselj(0,n)*exp(-n^2*t);
qr = 0;
end
When I try to run this, I get the error
Error using odeget
Unrecognized property name 'InitialSlope'. See ODESET for possibilities.
Error in ode15s (line 229)
yp0 = odeget(options,'InitialSlope',[]);
Error in pdepe (line 287)
[t,y] = ode15s(@pdeodes,t,y0(:),opts);
Error in test_pdepe_Matlab (line 4)
sol = pdepe(m,@heatcyl,@heatic,@heatbc,x,t);
I am using Matlab R2023b on a MacBook Air under MacOS Sonoma 14.6.1
Should I update Matlab and/or MacOS? Other suggestions?
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!