Hi Guys

I have done this before on Matlab however for some reason I can’t get it to run on Julia. I am getting the below error, I think it has something to do with regard to the for loop. Can someone please assist?

ERROR: ArgumentError: invalid index: 5.8e7 of type Float64

```
using DifferentialEquations
using Plots
function statespace!(dx, x, p,t)
l1,l2,m,k,I,c = p
dx[1] = x[2]
dx[2] = (-k*x[1]*l1^2-c*x[2])/(m*l2^2+I)
end
x0 = [0.0, 0.025] # initial conditions: rad and rad/s
tspan = (0,1) # time span
k = [58*1000000.00,60*1000000] # N/m
m = 18000.00 # kg
I = 8500*5.15^2.00
for i in k
p = (5.15,1.5,m,k[i],I,0.04*(k[i]+m)) # parameters: l1,l2,m,k,I,c
prob = ODEProblem(statespace!, x0, tspan, p)
sol = solve(prob)
F_buffer = sol[1,:].*k[i]/1000
plotly()
plot(sol[1,:], xlabel="Time", ylabel="Displacement (m)")
plot(F_buffer,xlabel = "Increment",ylabel = "Force in kN (Buffer)")
end
```