# NonlinearModelFit with NDSolve

I have a series of data:

 data={{x1(t),y1(t)},...,{xN(t),yN(t)}}


data represent a particle's orbit in the {x,y} plane. I would like to fit these observations with an orbit coming from two differential equations:

xt''[t]=f[x,y]
yt''[t]=g[x,y]


I would like to use NonlinearModel fit but I'm not able to define the model. The model would be given by {xt[t],yt[t]}; I should fit {x(t),y(t)} with {xt[t],yt[t]}, where the parameters are the initial conditions. Have you any general suggestions on the syntax?

My example of code is the following:

 model[a_?NumberQ, b_?NumberQ, c_?NumberQ, d_?NumberQ] :=
Module[{x, y, t},
First[{x,y} /. Eq1, Eq2, x[0] == a, x'[0] == b, y[0] == c,
y'[0] == d}, {x, y}, {t, 1992.224, 2009.61},
Method -> {StiffnessSwitching,
Method -> {ExplicitRungeKutta, Automatic}}, AccuracyGoal -> 15,
PrecisionGoal -> 16, MaxSteps -> Infinity]]]

nlm = NonlinearModelFit[data, model[a, b, c, d][t], {{a, b, c, d}, t]

nlm["ParameterTable"]


But all I get is error message

NonlinearModelFit::nrlnum: The function value ... is not a list of real           numbers with dimensions {70} at... >>


Is there something to modify in the code?

• This answer would be made better if you can define the syntax using code that the OP is looking for. This answer is informative, however. – CA Trevillian Sep 8 '20 at 3:33