MATLAB Answers

How can I modify the default options (like RelTol' and 'AbsTol') of the pde solver when using the PDE toolbox?

2 views (last 30 days)
Mario Di Salvo
Mario Di Salvo on 5 Dec 2019
Commented: Ravi Kumar on 16 Dec 2019
When working in 1D, I can modify the default options of the solver by using odeset and then calling the 'options' with pdepe, for example:
options = odeset('RelTol',1e-13,'AbsTol',1e-13);
sol = pdepe(m,'pde','ic','bc',x,t,options)
Now I am working in a 2D probelm and I am using the PDE toolbox. How can I especify options when working with the PDE toolbox? I use the command line function solvepde and I I would like to set more strict Relative error tolerance and Absolute error tolerance.
Apparently, the function solvepde calls ode15s which allows the especification of 'options'.
Thank you.

  0 Comments

Sign in to comment.

Accepted Answer

Ravi Kumar
Ravi Kumar on 5 Dec 2019
You can edit those tolerances directly using the model object properties. Say,
model = createpde(...
User model the set RelTol as:
model.SolverOptions.RelativeTolerance = 1E-6
Regards,
Ravi

  3 Comments

Mario Di Salvo
Mario Di Salvo on 13 Dec 2019
Hi Ravi,
I wonder if there is an equivalent of the option "NonNegative" in pdepe that can be used with the PDE toolbox. I want to force my solutions to be non-negative.
Thank you.
Ravi Kumar
Ravi Kumar on 16 Dec 2019
There is no option to force NonNegative constraint. Solution is definied by the PDE coefficients BCs, and ICs, if solution exists.
Regards,
Ravi

Sign in to comment.

More Answers (0)

Sign in to answer this question.