How to input an external load perturbation on the second order differential equation of a spring-mass-damper?

I am trying to input an random external perturbation (F) on the ODEs modeling a spring-mass-damper system, but I am not having success.

When I try a constant value for the perturbation (F=5), as in the following example, the code runs perfectly. But when I try to insert the random external perturbation that I calculate before the function (mydiff ), this message appears: "Setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. "

def mydiff(x,t):
    c=2 #damping
    k=4 #stiffness
    m=20  #mass
    F=5 #constant value
    return dxdt