Unmet Hours - RSS feedhttps://unmethours.com/questions/Question-and-Answer Resource for the Building Energy Modeling CommunityenWed, 06 Apr 2022 15:41:10 -0500jEPlus: formula calculation errorhttps://unmethours.com/question/71885/jeplus-formula-calculation-error/Hi,
I am using jEPlus for optimization, and I used a formula to define the optimization objection.
I found the obtained results quite strange and I went back to check if I made a mistake in defining the formula,
and here I found out that the formula didn't work out for a to the power of b functions, I used the tested formula: v5=2^3 and the evaluation results calculated by jEPlus is 1 instead of 8, see the attached screenshot.
I was wondering if this is a bug for the calculation of this type of functions or if I defined it in a wrong way.
Thanks in advance.
![image description](/upfiles/16492760889108509.png)Wed, 06 Apr 2022 15:15:10 -0500https://unmethours.com/question/71885/jeplus-formula-calculation-error/Comment by qirachel for <p>Hi,</p>
<p>I am using jEPlus for optimization, and I used a formula to define the optimization objection.</p>
<p>I found the obtained results quite strange and I went back to check if I made a mistake in defining the formula,</p>
<p>and here I found out that the formula didn't work out for a to the power of b functions, I used the tested formula: v5=2^3 and the evaluation results calculated by jEPlus is 1 instead of 8, see the attached screenshot.</p>
<p>I was wondering if this is a bug for the calculation of this type of functions or if I defined it in a wrong way.</p>
<p>Thanks in advance.
<img alt="image description" src="/upfiles/16492760889108509.png"></p>
https://unmethours.com/question/71885/jeplus-formula-calculation-error/?comment=71886#post-id-71886update:
I tried the following formulas and the evaluation results are all wrong:
v5 = 2^6 = 4;
v5 = 2^7 = 5;
v5 = 2^8 = 10;
v5 = 2^9 = 11;
seems like jEPlus see "^" as either "+" or ''-''Wed, 06 Apr 2022 15:20:18 -0500https://unmethours.com/question/71885/jeplus-formula-calculation-error/?comment=71886#post-id-71886Answer by qirachel for <p>Hi,</p>
<p>I am using jEPlus for optimization, and I used a formula to define the optimization objection.</p>
<p>I found the obtained results quite strange and I went back to check if I made a mistake in defining the formula,</p>
<p>and here I found out that the formula didn't work out for a to the power of b functions, I used the tested formula: v5=2^3 and the evaluation results calculated by jEPlus is 1 instead of 8, see the attached screenshot.</p>
<p>I was wondering if this is a bug for the calculation of this type of functions or if I defined it in a wrong way.</p>
<p>Thanks in advance.
<img alt="image description" src="/upfiles/16492760889108509.png"></p>
https://unmethours.com/question/71885/jeplus-formula-calculation-error/?answer=71888#post-id-71888problem solved:
v5 should be defined as v5 = Math.pow(2, 3) instead of v5 = 2^3Wed, 06 Apr 2022 15:41:10 -0500https://unmethours.com/question/71885/jeplus-formula-calculation-error/?answer=71888#post-id-71888