Glad you found a suitable math model for your problem. The error messages Mathcad throws if there is an error in a solve block seldom are use- or helpful. But in this case you can't blame Mathad for not telling you how you should have modelled your problem. Thats something a math program can't do.
Find attached an annotated file. I got rid of the adding of 10^-10m which was only added by you to avoid a divison by zero for h=0.
Also I am suspicous about the definition of Q.out and its triple step at that sepcific point. You may want to look over it again.