I am trying to compute the natural frequency of a cantilevered beam. The Euler-Bernoulli equation reduces to the following problem : $$ v''''=\lambda v, \text{with }, v(0)=0, v'(0)=0, v'''(1)=0,v''(1)=0 $$

where superscript $'$ correspond to derivation. These are the steps to obtain a solution:

  1. reduce the problem to a system of first order differential equation

$$ v'=v_1\\ v_1'=v_2\\ v_2'=v_3\\ v_3'=\lambda v $$ with the boundary conditions $$ v(0)=0\\ v_1(0)=0\\ v_2(1)=0\\ v_3(1)=0 $$ 2) write the system in python (kcorrespond to $\lambda$)

def fun(x, y):
    return np.vstack((y[1],y[2],y[3], k*y[0]))
def bc(ya, yb):
    return np.array([ya[0], ya[1],yb[2],yb[3]])
  1. define grid and initial conditions
x = np.linspace(0, 1, 100)

y_0 = np.zeros((4, x.size))
  1. at this point my idea, I use scipy.integrate.solve_bvp to solve the boundary value problem varying the parameter $k$:
for k in k_list:    
    soly= solve_bvp(fun, bc, x, y_b)
    y_plot = soly.sol(x)[0]
    plt.plot(x, y_plot, label='y_b')

And take as the right eigenvalue the value for which soly.sol is equal to $0$, but, for the previous code, I obtain a solution for all the value in k_list.

Even if I implement a shooting method, which is the right method to check to see if I got the right eigenvalue ?

  • 2
    $\begingroup$ A good way to solve your problem is discretize the equation on a spatial grid and convert it to linear algebra. $\endgroup$ Commented May 17, 2021 at 15:53

1 Answer 1


As mentioned by @MaximUmansky, you are, probably, better using a discretization method such as (see this answer):

Finite differences are really simple to understand as discretization technique but the boundary conditions get messy really fast, particularly for your higher order case.

I would suggest to go with the Finite Element Method. If you insist in using the shooting method, you could check this answer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.