MATLAB: Problem with too many inputs into bvp5c

bvp4cbvp5c

Hello, I want to test whether bvp4c, bvp5c and bvp6c solvers produce the same solution. The problem I face is that bvp4c and bvp6c allow my ode and bc functions to have additional inputs. Namely, these solvers have the following syntax: function sol = bvp4c(ode, bc, solinit, options, varargin) function sol = bvp6c(ode, bc, solinit, options, varargin) The solver bvp5c however, does not allow for varargin: function sol = bvp5c(ode, bc, solinit, options)
So, does anyone know how to go about this issue? Is there a way to manually edit bvp5c to allow for additional inputs?
Thanks, Artem.

Best Answer

You should not use additional inputs at all, even some integrators still support this ancient method. See http://www.mathworks.com/matlabcentral/answers/1971: Use anonymous functions to provide parameters. This is explained in the documentation also: https://www.mathworks.com/help/matlab/ref/bvp5c.html:
Parameterizing Functions explains how to provide additional
parameters to the function odefun, ...