Error in running the Example script of pdepe

1 view (last 30 days)
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

Torsten
Torsten on 28 Nov 2024
Edited: Torsten on 28 Nov 2024
As you can see, the code runs under MATLAB R2024b (and should be no problem under R2023b, too).
I suggest contacting Technical Support:
  6 Comments
Torsten
Torsten on 29 Nov 2024
You should rename the "odeset.m" under the path
/Users/pugliese/programs/MATLAB/MatCont7p4/Continuer/odeset.m
It seems to be a file that you've created.
There is no need to change "the order of folders in path".
Andrea Pugliese
Andrea Pugliese on 29 Nov 2024
Thanks. However, I have not created it directly. It was created by the package MatCont that I have installed. I am afraid that, if I change that name, the package will not work... I will send a message to the developers of MatCont.

Sign in to comment.

More Answers (0)

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!