Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hello
I am working on my bachelors project.
I have made a function that calculate the heat recovery in a heat exchanger with a faze change (condensation). The function calculates the potential heat recovery based on the temperature that comes out of the heat exchangers hot side.
The function works fine but i can not get it to solve the function, so i can calculate the temperature based on the heat energy.
Does anyone know how to solve this or the reason for the error?
Solved! Go to Solution.
The symbolic 'solve' can't deal with functions using conditionals (if/else). Reason is that it first tries to solve the equation symbolically, without specific values but doing so it can't decide which symbolic variable is larger than the other.
It may be possible to rewrite the function using the Heaviside step function instead of the conditional if/else, but thats some work and makes the function sure more unclear for the reader.
But a symbolic solution is not necessary anyway because you are just looking for a numeric value. So I would suggest using one of Primes numeric methods. That's either a solve block with "find" or the usage of the "root" function in one of its two 'flavors'.
It also may be beneficial to plot the function to see where to expect the solution.
Of course you could also use "root" in its second variant using the guess value 40
Of course you may also use T.l.4.1 throughout instead of T, I just was lazy 😉
And here for completeness sake the calculation done with a solve block
Prime 10 sheet attached
The symbolic 'solve' can't deal with functions using conditionals (if/else). Reason is that it first tries to solve the equation symbolically, without specific values but doing so it can't decide which symbolic variable is larger than the other.
It may be possible to rewrite the function using the Heaviside step function instead of the conditional if/else, but thats some work and makes the function sure more unclear for the reader.
But a symbolic solution is not necessary anyway because you are just looking for a numeric value. So I would suggest using one of Primes numeric methods. That's either a solve block with "find" or the usage of the "root" function in one of its two 'flavors'.
It also may be beneficial to plot the function to see where to expect the solution.
Of course you could also use "root" in its second variant using the guess value 40
Of course you may also use T.l.4.1 throughout instead of T, I just was lazy 😉
And here for completeness sake the calculation done with a solve block
Prime 10 sheet attached
Thank you very much, this solved my issue.