10.06.2021, 18:55 (This post was last modified: 10.06.2021, 18:57 by Tokatubs.)
I'm trying to figure out the calculation for finding the percentage between two values that a third value is.
Example: The range is 46 to 195 m3h. The value 46 would 0%, and the value 195 would be 100% of the range. What percentage of this range is the value 65?
rangeMin=46
rangeMax=195
inputValue=65
inputPercentage = ?
Usage of this is i have calculated three Vav. And then i need the sum of these to give me back a procent value to give the regulator.
Found this code on different site. But i think that this is missing something
11.06.2021, 02:51 (This post was last modified: 11.06.2021, 02:51 by benanderson_475.)
Looks like the above function you posted is javascript... are you running this in the custom javascript scripting part of lm?
if not and assuming you want lua try the below.
(11.06.2021, 02:51)benanderson_475 Wrote: Looks like the above function you posted is javascript... are you running this in the custom javascript scripting part of lm?
if not and assuming you want lua try the below.
Just to clearify. I picked this script up site describing the calculation, so i was sure i was missing something
I am using this script to sum the Supply air vav.
Since i only have one central extract vav. I then want to convert the supply sum to an control value 0-100 % to control the Extract vav.
Given that i know the Min/Max flow values of the Vav.
Been searching forum, but have not seen anything.
If min/max is common for all objects then you can use the same percentage formula after calculating the average by dividing the sum by the total number of objects.
If min/max is different then you can convert each value to a percentage and then calculate the average value from that.
(11.06.2021, 08:11)admin Wrote: If min/max is common for all objects then you can use the same percentage formula after calculating the average by dividing the sum by the total number of objects.
If min/max is different then you can convert each value to a percentage and then calculate the average value from that.
Hello, I have a resident script to calculate the average between two values in percentage, but the value is sent continuously. How can it be corrected?
(11.06.2021, 08:11)admin Wrote: If min/max is common for all objects then you can use the same percentage formula after calculating the average by dividing the sum by the total number of objects.
If min/max is different then you can convert each value to a percentage and then calculate the average value from that.