View script | License | Download script | History | Other scripts by: crazyaxe |
1-May 0:58 UTC
[0.041] 10.976k
[0.041] 10.976k
Archive version of: cla-cla.r ... version: 2 ... crazyaxe 28-Jun-2010Amendment note: addede flow calculus || Publicly available? Yes REBOL [ Title: "Unit converter" Author: "Massimiliano Vessi" Email: maxint@tiscali.it Date: 25-Jun-2010 version: 1.0.1 file: %cla-cla.r Purpose: {"Given the data, check if it's steam or water, and give the temperature for boiling water. It usese the Clausius-Clapeyron equation and give the flow in the tube."} ;following data are for www.rebol.org library ;you can find a lot of rebol script there library: [ level: 'beginner platform: 'all type: [tutorial tool] domain: [scientific ] tested-under: [windows linux] support: none license: [gpl] see-also: none ] ] t: ask "Temperature? (^°C) " t: to-decimal t p: ask "Pressure? (bar) " p: to-decimal p cla: func [temperatura] [ ;Clausius-Clapeyron equation, result in millibar! pressione_vap: 6.11 * (10 ** ( ( 7.5 * temperatura) / (237.7 + temperatura))) pressione_vap: pressione_vap / 1000 return pressione_vap ] p_vap: cla t print reform ["Vapor pressure is: " p_vap " bar"] either p < p_vap [ print "So it's STEAM." Q: 24 * ( square-root ( p / 2.5 ) ) print rejoin ["STEAM flow is: " Q " kg/h"] ] [print "No it's WATER." while [p >= p_vap] [ t: t + 1 p_vap: cla t ] print reform ["to obtain water, you need to reach al least " t "°C"] ] print { ************ ************ } do %cla-cla.r |