Question: Struggele to simplify a piecewise function

Hello,

I have to simplify a piecewise function and Maple gets a more complicated solution than needed.




I don't know how to handle this kind of problems with Maple?
I don't understand why Maple doesn't see this?
Am I doing something wrong?

Thanks in advance for your help / advice.


# the code of my example
restart:
Mf(x):=piecewise(x<=L/2,1/2*x*F,x>1/2*L,1/2*x*F-F*(x-1/2*L));
# Make a dimensionless function:
# -    Mf(x):= Mf(xi)*F*L
# -    variable ξ  ( xi:=x/L )
eq[1]:=Mf(xi)*F*L=Mf(x);
Mf(xi):=solve(eq[1],Mf(xi));
Mf(xi):=subs(x=xi*L,Mf(xi));
# F is the Force and L is the Length of the beam:
Mf(xi):=simplify(Mf(xi)) assuming F>0,L>0;
print("When I simplify this function by hand it will be");
Mf(xi):=piecewise(xi<=1/2,1/2*xi,xi>1/2,-1/2*xi+1/2);




Please Wait...