Curve fitting with LsqFit

You just need some more .s:

model1(t, p) = p[1] * exp.(-p[2] * t) .+ p[3] * exp.(-p[4] * t) .* cos.(p[5] * t .+ p[6])

or

model1(t, p) = @.(p[1] * exp(-p[2] * t) + p[3] * exp(-p[4] * t) * cos(p[5] * t + p[6]))
1 Like