Hi Guys.
I'm simulating a SOEC and I'm doing an energy balance on this SOEC using a Calculator block in order to calculate the Power consumed by the SOEC and Heat losses from the SOEC. This is done in order to calculate the heat that has to be supplied to the SOEC in order to operate at a constant temperature of 900 deg.
My problem is calculating the heat losses which I do in an iterative way. The problem with this iterative method is that some variables can be negative which is physically impossible. So my question is: How do I limit the values that a Variable can take on using the Fortran calculation method in the Calculator Block?
I'm a complete rookie in using Fortran so a nice and clear explanation would be lovely.
Have a nice day and week you guys. Hope to hear from you, because I really need this.
I have uploaded my model as it is so far. You just have to run it once, and you will see my problem
Best regards
Nikolaj.