Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Having issues with the solve block, "units are not compatible"
I know the part that is bad is the part in the screenshot as that part was added specifically for this scenario.
Would also like to simplify it as its the same equation with different Q value determined by the Q[ value.
Please advise,
Thank you!!
Solved! Go to Solution.
Your variable (array) Q has a unit:
This means that you cannot add e.g.
because you cannot add apples to pears.
Either there's something wrong in your formula (Maybe 11.7 needs the unit gpm as well, while 2.29 is unitless, or 11.7 has the unit 1/gpm while 2.29 has 1/gpm^2), or this formula is empirical (it works for the technology, but is not derived from physics basics, in which case case you could divide the units out.)
To simplify the expression, you can define a function (outside of the solve-block), e.g.:
and the replace the three terms with:
But, first you have to decide about units.
Success!
Luc
Your variable (array) Q has a unit:
This means that you cannot add e.g.
because you cannot add apples to pears.
Either there's something wrong in your formula (Maybe 11.7 needs the unit gpm as well, while 2.29 is unitless, or 11.7 has the unit 1/gpm while 2.29 has 1/gpm^2), or this formula is empirical (it works for the technology, but is not derived from physics basics, in which case case you could divide the units out.)
To simplify the expression, you can define a function (outside of the solve-block), e.g.:
and the replace the three terms with:
But, first you have to decide about units.
Success!
Luc
Luc already told you the main problem (actually already Prime did 🙂 ).
Some additional remarks:
1) You have just one single equation, but you want seven variables (6 in Q and Ws) to be solved for? That possibly can't work OK. There may be an infinite number of solutions, starting with six values remaining the same as the guess value and just one value changing up to an infinite number of solutions where all seven values differ at end from the guesses. You sure need additional constraints for the seven variables!
BTW, as in your example N=2, variable Q3 and Q6 are not used in the formula at all, nonetheless you demand Prime to solve for them as well!
2) The offending part with the wrong units which you added should not be part of the expression which is added in the sum as it has nothing to do with the sum variable "i". Its just a constant summand which is added to every summand in the calculated sum. So there is no need to calculate that expression N times from anew, simply multiply it by N and add it at the end after the summation.
Here is a working version but in no way I would claim that its correct and does what you intend it to do. I followed Luc's suggestion with the function Kq in which I stripped the unit from Q and added the unit feet at the end because to fit the rest of the formula a length is needed here. So its just a hack to make it work with respect to the units but has not meaning with respects to physics. Its very likely that you have to correct the unit mismatch in your formula in a quite different way!
You can see the Prime chooses to change just three of your guess values (see my remark #1 for this). Its noticeable that its exactly the three variable Q2, Q4 and Q5 used in the offending expression you introduced.