Data2Dynamics / d2d

a modeling environment tailored to parameter estimation in dynamical systems
https://github.com/Data2Dynamics/d2d
57 stars 29 forks source link

Linking of data to free parameters #141

Closed ChristophStelzer closed 4 years ago

ChristophStelzer commented 4 years ago

Hello

I used to use D2D for fitting dose-response data to an ode model. This worked fine ~1 years ago.

Now, I wanted to use D2D again for a different project (also dose-response data to another model), but I cannot seem to get the model running. I tried with my old project model (exact same files) and it also didn't work.

The model/data files compile more or less fine. However, I get warnings:

Building with 'Xcode with Clang'.
arFramework3/Ccode/arInputFunctionsC.c:147:12: warning: assigning to 'double *' from 'const double *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    deriv2 = &data[n];
           ^ ~~~~~~~~
arFramework3/Ccode/arInputFunctionsC.c:963:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
arFramework3/Ccode/arInputFunctionsC.c:991:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
arFramework3/Ccode/arInputFunctionsC.c:1019:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
4 warnings generated.

MEX completed successfully.
compiling input functions...done

When checking for free parameters, e.g. with arTuner, I noticed that I can also select my input (DOX), output (out) and outputs standard deviation (out_std). From there onwards I only get errors:

arPlot
-2*log(L) = 70.7722, 7 data points, 4 free parameters, data chi^2 = 2.67402
Error using cell/unique (line 85)
Cell array input must be a cell array of character vectors.

Error in arPlotY (line 274)
                    [conditions, iconditions, jconditions] =
                    unique(ar.model(jm).plot(jplot).condition,'legacy'); %#ok<ASGLU>

Error in arPlot (line 124)
arPlotY(saveToFile, fastPlot, doLegends);

I attached my toymodel. Also, I am using MATLAB2018b ToyModel.zip

Appreciate your help, Christoph

clemenskreutz commented 4 years ago

Dear Christoph. Thanks for providing your toy model. I fixed the code. The bug was related to smoothing dose response curves which failed in case of a single time point. See commit 3976b36

Best, Clemens.