Solving second order differential equation for Bridge using numerical methods in matlab

73 Views Asked by At

Working on the following problem: We have an arch bridge with length 204 meters and a max height to the water of 26 meters. The symmetrical Arch is described by the second order differential equation $y'' = -K*y(x)*(1+(y'(x))^2)^{3/2}$ $y(0) = y(L) = 1$ and $y(L/2) = a$ and $y(x)$ describes the height over the water and $L=204$ meters. The task is to find value of $K$ that so that the bridge really ends in $y(L) = 1$ (right above the waterline).

I'm thinking of first initializing values of $y$ and $y'$ at the endpoints of the bridge using $y(0) = y(L) = 1$. Then using eulers method to approximate the values of $y$ and $y'$ at the remaining grid points. Then I have to find a value for $K$ so that $y(L) = 1$. I'm thinking of creating a function taking in $K$ as a parameter and using a root finding method such as secant method to find value for $K$. I am having difficulties coding this in matlab without using any built in functions? Any tips/help?