These are differential equations, a boundary value problem.
We use dsolve to solve it. For example, a simple example is:
Eq = diff(x,t,2) == 1 + t;
dsolve(Eq,x(0) == 0,x(1) == 2)
(t*(t^2 + 3*t + 8))/6
Now, what happens when you just throw it at solve?
solve(Eq,x(0) == 0,x(1) == 2)
Warning: Unable to find explicit solution. For options, see help.
> In sym/solve (line 317)
Empty sym: 0-by-1
Finally, even though you used solve to try to find a solution, that last line, w(x==0) does not do what you think it does. In fact, in your code, even though you tried to return A,B,C,D, those values are not magically inserted into the relationship for w.
Oh, this is not how you create a boundary condition:
Again, that does NOT set x to a value of L/2, and then substitute it into w. Instead, you would formulate that boundary condition for dsolve as
w(L/2) == 0
So, first, solve the ODE as a differential equation. Use dsolve.