Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

wetbulb?

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
Post Reply
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

wetbulb?

Post by n9mfk »

Hi Steve,
What formula does cumulus use to do wetbulb?
Thank Beau
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: wetbulb?

Post by beteljuice »

Based on the one I gave here I think: https://cumulus.hosiene.co.uk/viewtopic.p ... lb&start=0
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: wetbulb?

Post by steve »

I ended up using a direct formula that appears on the web in various places (e.g. here: http://www.aprweather.com/pages/calc.htm) which doesn't use an iterative approach (and is possibly hence slightly less accurate).
Steve
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: wetbulb?

Post by n9mfk »

ok I missed something
htp://99.108.42.167/weather/test3/wxwetbulb.php

Code: Select all

use these numbers
$Tc = -2.0555555555556
$RH = 51
$P = 1012.7337934

i get 3.9960679808406
cumulus 24.5 

Code: Select all

<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (Canada/World-ML template set)
############################################################################
#
#   Project:    Sample Included Website Design
#   Module:     sample.php
#   Purpose:    Sample Page
#   Authors:    Kevin W. Reed <kreed@tnet.com>
#               TNET Services, Inc.
#
# 	Copyright:	(c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
############################################################################
#	This document uses Tab 4 Settings
############################################################################
require_once("Settings.php");
require_once("common.php");
############################################################################
$TITLE = langtransstr($SITE['organ']) . " - " .langtransstr('wetbulb test page');
$showGizmo = true;  // set to false to exclude the gizmo
include("top.php");
############################################################################
?>
</head>
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>

<div id="main-copy">
   
 <?php echo 'temperature: '.$WX['temp'];?><br />
 <?php echo 'humidity: '.$WX['hum']; ?><br />
 <?php echo '$baro: '.$WX['press']; ?>
<br /> 
 <?php echo'wetbulb: '.  $WX['wetbulb']; ?><br />

 
 <?php
 
$Tc =($WX['temp']-32)/1.8;
$P = 33.8639 * $WX['press'];
$RH = $WX['hum'];

 echo'$Tc = '.  $Tc.'<br />';
echo'$RH = '.  $RH.'<br />';
echo'$P = '.  $P.'<br />';
echo'<br />';
//echo $tc;
$Tdc = (($Tc - (14.55 + 0.114 * $Tc) * (1 - (0.01 * $RH)) - ((2.5 + 0.007 * $Tc) * 
(1 - (0.01 * $RH))) ^ 3 - (15.9 + 0.117 * $Tc) * (1 - (0.01 * $RH)) ^ 14));

$E = (6.11 * 10 ^ (7.5 * $Tdc / (237.7 + $Tdc)));

$WBc = (((0.00066 * $P) * $Tc) + ((4098 * $E) / (($Tdc + 237.7) ^ 2) * $Tdc)) / ((0.00066 * $P) + (4098 * $E) / (($Tdc + 237.7) ^ 2));

echo '<br />'; 
echo $WBc;



?>
 
 </div><!-- end main-copy -->

<?php
############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>

User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: wetbulb?

Post by beteljuice »

Edit: code corrected - thanks to mark ;)

$Tc = -2.0555555555556
$RH = 51
$P = 1012.7337934

Tdc= -10.877659778338

E= 2.6691050528504


$WBC = -4.1844761761292 WBf = 24.5

You are NOT using php math !

2 ^ 3 is not php, pow(2, 3) is ..

Code: Select all

$Tdc = (($Tc - (14.55 + 0.114 * $Tc) * (1 - (0.01 * $RH)) - pow((2.5 + 0.007 * $Tc) * (1 - (0.01 * $RH)) , 3) - (15.9 + 0.117 * $Tc) * pow(1 - (0.01 * $RH),  14)));


$E = (6.11 * pow(10 , (7.5 * $Tdc / (237.7 + $Tdc))));

$WBc = (((0.00066 * $P) * $Tc) + ((4098 * $E) / pow(($Tdc + 237.7) , 2) * $Tdc)) / ((0.00066 * $P) + (4098 * $E) / pow(($Tdc + 237.7) , 2));
The figure now agrees (Deg F) with what you say Cumulus gives

You are still using Relative (sea level) instead of Absolute (station) pressure, although this will only make a (very) small difference.
Last edited by beteljuice on Sat 25 Jan 2014 11:01 am, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: wetbulb?

Post by mcrossley »

beteljuice, you still have a '^' lurking in the Tdc calculation
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: wetbulb?

Post by beteljuice »

Well spotted .. thank you Mark.

Post edited with new results and code correction.
Image
......................Imagine, what you will KNOW tomorrow !
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: wetbulb?

Post by n9mfk »

thank you beteljuice and Mark
Post Reply