I will try to describe my problem, but there are some specific questions in the end.
I am having some trouble solving a turbomachinery problem in Matlab. The goal is to calculate the efficiency of a turbine with known physical measurements and operating conditions. To do this I am using the equations given in a scientific paper: http://www.sciencedirect.com/science/article/pii/S0196890409003124
The problem in my case is that, to know the efficiency I need the exit gas parameters (temperature pressure velocity...) which in turn depend on the efficiency. I primarily solved this problem in a software called EES (engineering equation solver) where equations may be written in what ever order and the program groups them and solves them automatically. I switched to Matlab due to restrictions in the program which wouldn't allow me to expand the problem.
In matlab I started by writing all the equations as a function in a solvable order, except for two exit parameters which are needed to solve the problem. The two exit parameters were set as input to the function. I used two fundamental equations (conservation of mass and the calculated losses) as output where the correct solution would set these equations to zero. I then tried to solve this with fsolve.
This didn't really work out, and I could not find a solution. Now I am instead giving matlab all the equations of the problem (27), and try to solve them in a similar way. This is not working well either. ("No solution found. fsolve stopped because the last step was ineffective").
Among the equations there is some logic and if-statements, and I am also using a fluid parameter library as a com-server in order to get parameters of the gas at varying pressure and temperature. Neither of these allow input from -inf to +inf, and there might also be some discontinuities... and I guess this may be a reason to my problems.
So, I guess this is not the typical programming question. I don't know how much help the code itself would be. If you have any ideas of an approach to this problem it would be of much help! I have some specific questions as well though:
Is it possible to somehow send a parameter to fsolve telling it that some of the equations is out of bounds? (The com-server sends an error message in this case, but I don't know how to use it automatically.)
Is it possible to give a range to fsolve, similar to fzero?
The result-vector from the function, which I am trying to set to a zero-vector has results from very varying equations and therefore values that vary a lot. Error tolerance is very varying as well between the equations. Is there some smart way of dealing with this? I have just divided the result from less exact equations to reduce the value.