Skip to content

optimisation - Error in checkFunc(Func2, times, y, rho) : The number of derivatives returned by func() (22) must equal the length of the initial conditions vector (2)

1 message · Jim Lemon

#
I'm not really familiar with what you are doing. when I try to debug
something like this, I run each step separately to determine where the
error is. For example, if I clean up the code a bit and run the derivs
function:

 derivs(time,y,parms)
[[1]]
 [1]  429.709540  438.844035  281.741953  404.175692  435.341449  447.532442
 [7]  448.103560  443.722972  419.132716  345.992428  363.259812 -182.179223
[13] -220.477447 -115.238330 -113.710739   -8.218996 -146.384226  -92.999563
[19] -921.027854  -61.074252 -885.550697  -40.281082

Warning messages:
1: In k4 * ((1 + k5 * cP)/(1 + k7 * cE)) * x :
  longer object length is not a multiple of shorter object length
2: In (1/k8) * k4 * ((1 + k5 * cP)/(1 + k7 * cE)) * x :
  longer object length is not a multiple of shorter object length

Obviously there is a problem with the length of "x" as it is recycled
within the function. Also, your cE and cP values are not causing a
problem as the function runs and returns what may be reasonable
values. As I don't have the deSolve package installed (and I have my
own work to do) I can only suggest trying a stepwise debugging
process.

Jim

On Wed, Feb 22, 2017 at 8:58 PM, Malgorzata Wieteska
<g.wieteska at yahoo.ie> wrote: