CDL - EVAL: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
mNo edit summary
 
== Trouble in Paradise ==
Equations may seem like functions, and there is a resemblance, but they are not. If you are using an equation in another you must be aware that the plotparameters in the first equation remain the same during substitution. I will explain this through an example of the ''Wet Bulb Temperature calculation'' (WBT).
 
The WBT is calculated in CMX as:
WetBulbTemp Eval [ (0.00066 * Pressure * Temperature + 4098 * Psat1980 / Pow( (Dewpoint + 237.7), 2) * Dewpoint) / (0.00066 * Pressure + 4098 * Psat1980 / Pow((Dewpoint + 237.7),2)) ]
</pre>
''Psat1980'' will be substituted into the ''WetBulbTemp'' equation when needed so it will calculate with Temperature but it required to be the ''Dewpoint'' calculation as you can see from ''CMX svpDP'' function. To account for this issue a Psat1980 equation specifically for the dewPoint needs to be created. So, to calculate the WetBulbTemp correctly, we have to do:
 
<pre>
 
The CUtils compiler then takes the rest and creates the correct javascript function required for Highcharts.
 
This took 5 years before it was discovered and it finally showed it took some considerable time before it was understood. See [https://cumulus.hosiene.co.uk/viewtopic.php?t=24257&start=15 this topic on the forum].
 
[[Category:CumulusUtils]]

Navigation menu