I have RLC circuit. I would like to find R and L by using FindFit, but L is in initial condition and I have problem with it. Could you help me ?
c = 116*10^(-6); U = 16000. ;
data =
{
{0, 0}, {0.25*10^(-6), 132000}, {0.5*10^(-6), 330000}, {1*10^(-6), 462000},
{2*10^(-6), 600000}, {3*10^(-6), 462000}, {4*10^(-6), 330000}, {5*10^(-6), 66000},
{6*10^(-6), -198000}, {7*10^(-6), -264000}, {8*10^(-6), -198000}, {9*10^(-6), -132000}
};
lp = ListPlot[data, PlotRange -> All]
fit =
FindFit[data,
First[i /.
NDSolve[{i''[t] + R/L * i'[t] + 1/(c L)*i[t] == 0, i[0] == 0, i'[0] == U/L},
i, {t, 0, 9*10^(-6)}]],
{{R, 10*10^(-3)}, {L, 20*10^(-9)}},
i,
PrecisionGoal -> 4,
AccuracyGoal -> 4]