I am looking for a way to include piecewise functions in the dsolve command in order to solve a 2nd order differential equation. Dsolve works fine if H(x),G(x),F(x) are constant, but I need them to become piecewise symbolic functions. Thanks.
(for example H(x)= 0.5 for (0<=x<0.5) and H(x)= 1 for (0.5<=x=<1))
syms U(x) g(x) H(x) F(x) G(x) x b
H(x)=1;
F(x)=0.02;
b=1;
G=0.15;
g(x)=dsolve(1000*9.81*H(x)*0.001-1000*F/8*g(x)+1000*0.07*H(x)*H(x)(F/8).^0.5*0.5*diff(g,2)==G,g(0)==0,g(b)==0)
U(x)= (g(x))^0.5