Page 1 of 1

Formula for the perfect breakfast egg :-)

Posted: Fri Jan 15, 2016 4:21 pm
by Little John
Image

Code: Select all

; PB 5.41

EnableExplicit

Procedure.d EggCookingTime (d.i, t_initial.i, soft.i=#True, elevation.i=0)
   ; -- Note: The egg must be put into *boiling* water!
   ; in : d        : small diameter      of the egg [mm]
   ;      t_initial: initial temperature of the egg [°C]
   ;      soft     : #True / #False
   ;      elevation: elevation above sea level [m]
   ; out: return value: time needed for cooking the egg [minutes],
   ;                    or 0 on error
   ;
   ; [modified after
   ;  Gruber, Werner (2008):
   ;  Unglaublich einfach - einfach unglaublich. Physik für jeden Tag.
   ;  München: Heyne
   ;  pp. 207-209]
   Protected t_water.d, r.d, t_inside.i
   
   t_water = 100 - 0.0033 * elevation  ; temperature of boiling water at the given elevation
   If t_water <= 82.0
      ProcedureReturn 0   ; At an elevation of about 5500 m or higher, 
   EndIf                  ; boiling water is not hot enough for cooking eggs.
   
   If soft
      t_inside = 62
   Else
      t_inside = 82
   EndIf
   r = 2 * (t_water - t_initial) / (t_water - t_inside)
   
   ProcedureReturn 0.0016 * d * d * Log(r)
EndProcedure


; -- Demo
Define d.i, t_s.d, min_s.i, sec_s.s, t_h.d, min_h.i, sec_h.s

Macro ShowTable (_t_initial_)
   Debug "Egg " + _t_initial_ + " °C"
   Debug ""
   Debug "       |  soft   |  hard"
   Debug "d [mm] | min:sec | min:sec"
   Debug "-------+---------+--------"
   
   For d = 35 To 50 Step 5
      t_s = EggCookingTime(d, _t_initial_, #True)
      min_s = Int(t_s)
      sec_s = Str(Int((t_s-min_s)*60.0))
      
      t_h = EggCookingTime(d, _t_initial_, #False)
      min_h = Int(t_h)
      sec_h = Str(Int((t_h-min_h)*60.0))
      
      Debug "   " + d + "  |   " + min_s + ":" + RSet(sec_s, 2, "0") + "  |   " + min_h + ":" + RSet(sec_h, 2, "0")
   Next
   Debug ""
   Debug ""
EndMacro


Debug "Time needed for cooking eggs at sea level"
Debug ""
ShowTable( 4)   ; refrigerator temperature
ShowTable(20)   ; room temperature
Bon appétit! :-)

Re: Formula for the perfect breakfast egg :-)

Posted: Fri Jan 15, 2016 5:19 pm
by infratec
Hi,

have you cross-checked all points of the tables :?:

:mrgreen: :mrgreen: :mrgreen:

Re: Formula for the perfect breakfast egg :-)

Posted: Fri Jan 15, 2016 9:02 pm
by sys64802
Nice ;-)

It would require another param: height above sea level, since lower pressure make the water boil at lower temperature.

Re: Formula for the perfect breakfast egg :-)

Posted: Fri Jan 15, 2016 9:20 pm
by Little John
sys64802 wrote:It would require another param: height above sea level, since lower pressure make the water boil at lower temperature.
You are absolutely right. The protected variable t_water must be adapted accordingly (or the code can be changed, so that t_water is a parameter of the procedure).

According to this source (German), for instance at a height of 2000 meters above sea level water boils already at 93 °C. If in doubt, everyone can easily measure her/himself the temperature of boiling water at her/his location.

Re: Formula for the perfect breakfast egg :-)

Posted: Sat Jan 16, 2016 4:46 am
by Keya
The Perfect Egg v2.0 - now with Mt Everest support!
http://study.com/academy/lesson/how-to- ... point.html

Code: Select all

BoilingPointF˚ = 212˚ - (0.00184)h    ;h is altitude (feet).  Everest: 29,029ft BP=71˚C/160˚F
The IUPAC recommended standard boiling point of water at a standard pressure of 100 kPa (1 bar) is 99.61 °C (211.3 °F). For comparison, on top of Mount Everest, at 8,848 m (29,029 ft) elevation, the pressure is about 34 kPa (255 Torr) and the boiling point of water is 71 °C (160 °F). - https://en.wikipedia.org/wiki/Boiling_point
https://en.wikipedia.org/wiki/List_of_c ... _elevation
UK = 162 m (531 ft)
USA = 760 m (2,493 ft)
Nepal = 2,565 m (8,415 ft)

Re: Formula for the perfect breakfast egg :-)

Posted: Sat Jan 16, 2016 9:59 am
by Little John
Keya wrote:http://study.com/academy/lesson/how-to- ... point.html

Code: Select all

BoilingPointF˚ = 212˚ - (0.00184)h    ;h is altitude (feet).
Thanks for the hint!
I've change the above code, so that it takes the elevation above sea level into account.
https://en.wikipedia.org/wiki/List_of_c ... _elevation
UK = 162 m (531 ft)
USA = 760 m (2,493 ft)
Nepal = 2,565 m (8,415 ft)
Sorry, but this is very misleading. What matters here is the real elevation of the location where you are cooking the egg, not the average elevation of the country where you are.

Re: Formula for the perfect breakfast egg :-)

Posted: Sat Jan 16, 2016 11:29 am
by Keya
misleading? it says "List_of_countries_by_average_elevation" in the URL! I only added it for comparison to Everest - of course everyone knows you need your actual elevation not your country average :) Anyway nice update, now everyone on the planet can boil a perfect egg including our crazy friends at Base Camp heehee :D

Re: Formula for the perfect breakfast egg :-)

Posted: Sat Jan 16, 2016 11:44 am
by Little John
Keya wrote:misleading?
Yes.
You've got a PM.