Dear All,
I think that I found an interesting bug-like thing while I was using ode23tb (MATLAB 2016b).
According to the Documentation :
[t,y] = ode23tb(odefun,tspan,y0,options) %where t is the same as tspan,if tspan has more than 2 elements
My tspan has 1185 elements.
I use the ode23tb in a function,which I want to minimize in a non-linear curve fitting procedure. I use fminsearchcon to find the minimum. There is no problem to find a nice-looking minimum.
The problem first occured when I called the function jacobianest in order to calculate the the confidence intervals. This function calls multiple times the fit function and therefore ode23tb, but with different (fit) parameters because the jacobianest calculates the partial derivatives. Near the end of the jacobianest routine, ode23tb returns with t that has only 759 elements while the tspan has still 1185 elements. It seems that a special configuration of parameters for ode23tb reduces the dimension of the returning values. Of course, later this results in an error because of dimension mismatch. This is very weird and I could not find the problematic part in my code.
When I got this dimension loss of t, I saved the paramteres from the jacobianest , and I just plugged them into ode23tb without any fitting routine and it gave the same error.
The order of the parameters were correct but one obtained a negative sign, which is not realistic, though mathematically it should not be an issue.
Do you have any idea what is happening here?
Just for clarity: I have 5 fit parameters, which define the solution of the ode23tb, none of them is the initial parameter. I have three equations, the ode23tb returns three columns. Then, another function makes a single column out of these three. This is the vector that I want to fit to my data. I guess the issue is not with the fitting routine but with ode23tb.
Best Answer