Group Abstract Group Abstract

Message Boards Message Boards

NDSolve debugging and help

Posted 11 months ago
POSTED BY: Ee Kin Chan
3 Replies

The expression model[cd, kvc][[k]][[0]][t] can be simplified as model[cd, kvc][[k]]. The factor dl cancels out, doesn't it? I am not expert in model fitting, but the dependence of your model in cd and kvc seems too involuted. I would suggest incorporating the two parameters into the model using ParametricNDSolve, of which, sadly, I know very little.

POSTED BY: Gianluca Gorni

It is the Module[{\[Theta], t} that makes trouble. The equations and initial data use variables \[Theta], t from outside, while the part Table[\[Theta][k, t], {k, NN}], {t, 0, 75.272} uses local variables.

Just remove the Module.

POSTED BY: Gianluca Gorni
Posted 11 months ago

Ah I see thank you that works. As a quick follow up question, my next line of code is this, and I seem to get some new errors. Would you mind taking a look at it? (I am assuming you do not need dampdata to debug the code?)

nlm = NonlinearModelFit[dampdata, 
  ArcTan[(dl Sum[Sin[model[cd, kvc][[k]][[0]][t]], {k, NN}])/(
   dl Sum[Cos[model[cd, kvc][[k]][[0]][t]], {k, NN}])], {cd, kvc}, t, 
  Method -> "Gradient"]

enter image description here

POSTED BY: Ee Kin Chan
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard