I am beginning to replicate formulas that were formally in my .ino sketches into MIT App Inventor. Would someone please look over the following two formulas and tell me where I am deviating from common logic? In the .ino sketch, getTemp is the temperature in Celsius and Humid is the relative humidity percentage. In the .ala file, Temperature_C_Label.Text is the temperature in Celsius and Humidity_Label.Text is the relative humidity percentage.
The .ino sketch returns what is close to a wet-bulb temperature but the .ala is miles off. I have assembled it bit-by-bit and disassembled it looking for the problem but I am at a loss.
Basically, I am screwing up the .ala expression due to a lack of understanding about the nature of block assembly in the Visual landscape. Would someone please edit my .ala to replicate the .ino so I can study the differences from my "logic," or at least point out any glaring errors? Thank you so much!
Thank you so much for that. I had no idea I could stack the formula instead of making it a mile long! Your way makes it so much easier to see the interaction of the core components.
AI2's trig functions are in degrees, not radians like in Excel.
From
I see
2. Empirical expression for wet-bulb temperature
Presented here is an empirical inverse solution found by a function fit to the data in Fig. 1. It yields Tw (°C) as a function of T (°C) and RH% (where a humidity such as 65.8% is input as the number 65.8):
View Expanded
The arctangent function uses argument values as if they are in radians. The curves in Fig. 2 were calculated using Eq. (1) to show Tw as an explicit function of T and RH%. Equation (1) is valid for a pressure of 101.325 kPa and for the combinations of dry-bulb temperatures and relative humidities as plotted in Fig. 2. Saturation is with respect to liquid water over all temperatures.
Hi, again. How do I make my math blocks vertical and not horizontal? I cannot find a switch or anything that lets me stack two multiples above each other instead of side-by-side Thank you for the assistance.
That was the answer. I really had tried using the degrees to radians blocks in both locations, but I somehow missed the correct output. Thank you so much for your great guidance and mentoring.