
I need these functions to be of this form because otherwise I cannot use the CVODES solver in the sundialsTB toolbox. But then I would like to convert this gradient to a matlab function that is a function of the vectors X and p, not a function of the elements of these vectors. I can then get the partial derivatives, which are used to solve for the sensitivities, of the RHS of the ODE wrt to the parameters using a command like 'gradient(rhs_1, p)'. The user provides her own Matlab function to calculate the 'sum-of-squares' function for the likelihood part, e.g. mcmcrun.m Matlab function for the MCMC run. Rhs_2 = symfun(-(X(1) - p(1) + p(2)*X(2))/p(3), ) The main functions in the toolbox are the following. P = sym('p', ) % Vector representing parameters A smaller, but representative, example would look like X = sym('X', ) % Vector representing state variables In my case I have an ODE with 2 states and 10 parameters. My overall goal is to use the MATLAB symbolic toolbox to simplify the process of formulating and solving for the sensitivities of solutions to ordinary differential equations with respect to the parameters in the equations.
