'Script Version: 
'- denklin	

'------------------------------------------------------------------------------------------

{macro:taupunkt_init}
	(L.S.Weather_Temperature) (S.L.heizung_mirror)
{end}

{macro:taupunkt_frame} 
 
'	-------------------------------------------------- 
'            ФАКТИЧЕСКАЯ ПОГОДА
'	-------------------------------------------------- 
 
' Перевод фактической абсолютной влажности в относительную влажность

		(L.S.Weather_Temperature) (F.L.quantity_Feuchtigkeit) (S.L.Weather_AbsHum_max)
		
		(L.S.Weather_AbsHum) (L.L.Weather_AbsHum_max) / (S.L.Weather_relHum)
		
' Расчет фактической точки росы 

		17.27 (L.S.Weather_Temperature) *
		237.7 (L.S.Weather_Temperature) + /		
		(L.L.Weather_relHum) (F.L.Ln_relHum) + (S.L.Ln_Weather_relHum)
		
		237.7 (L.L.Ln_Weather_relHum) *
		17.27 (L.L.Ln_Weather_relHum) - / (S.L.Weather_taupunkt)

' Коэффициент теплового сопротивления стекла 
		
		(L.S.Weather_Temperature)
		(L.S.Weather_Temperature) (L.L.heizung_mirror) - 0.17 * - (S.L.heat_Weather_factor)
			
' Нагрев зеркал
	 
		(L.L.cp_spiegelheizung_sw) 0.08 * (L.L.elec_busbar_main) *		
		(L.S.Weather_Temperature) (L.L.heizung_mirror) - 0.001 * + 	
		(L.S.Timegap) * (L.L.heizung_mirror) + (S.L.heizung_mirror)	
		
' Запотевание зеркал
	
	   (L.L.heat_Weather_factor) (L.L.Weather_taupunkt) <=
	   {if}	 
		  (L.L.mirror_sweat) (L.S.Timegap) 0.01 * + 1 min (S.L.mirror_sweat)
	     {else}		
		  (L.L.mirror_sweat) (L.S.Timegap) 0.01 * - 0 max (S.L.mirror_sweat) 
	     {endif}
		 

'	-------------------------------------------------- 
'            В САЛОНЕ
'	-------------------------------------------------- 		

' Расчет точки росы в салоне

		17.27 (L.L.Cabinair_Temp) *
		237.7 (L.L.Cabinair_Temp) + /		
		(L.L.Cabinair_relHum) (F.L.Ln_relHum) + (S.L.Ln_Cabinair_relHum)
		
		237.7 (L.L.Ln_Cabinair_relHum) *
		17.27 (L.L.Ln_Cabinair_relHum) - / (S.L.Cabinair_taupunkt)
				
' Коэффициент теплового сопротивления стеклопакета (стекла)
		
		(L.L.Cabinair_Temp)
		(L.L.Cabinair_Temp) (L.S.Weather_Temperature) - 0.29 * - (S.L.heat_Cabinair_factor)
		
' Запотевание		

	   (L.L.heat_Cabinair_factor) (L.L.Cabinair_taupunkt) <=
	   {if}	 
		  (L.L.windows_sweat) (L.S.Timegap) 0.01 * + 1 min (S.L.windows_sweat)
	     {else}		
		  (L.L.windows_sweat) (L.S.Timegap) 0.01 * - 0 max (S.L.windows_sweat) 
	     {endif}
		 
' Замерзание		 
		 			  
		(L.L.windows_sweat) (L.L.windows_freezing) - (L.L.heat_Cabinair_factor) /-/ 0.001 * (L.S.Timegap) * (L.L.windows_freezing) + 0 max 1 min (S.L.windows_freezing)	
	 

'	-------------------------------------------------- 
'            В КАБИНЕ ВОДИТЕЛЯ
'	-------------------------------------------------- 	

		(L.L.Cabinair_driver_Temp) (F.L.quantity_Feuchtigkeit) (S.L.driver_AbsHum_max)
		
		(L.L.Cabinair_driver_absHum) (L.L.driver_AbsHum_max) / (S.L.driver_relHum)
		

		17.27 (L.L.Cabinair_driver_Temp) *
		237.7 (L.L.Cabinair_driver_Temp) + /		
		(L.L.driver_relHum) (F.L.Ln_relHum) + (S.L.Ln_driver_relHum)
		
		237.7 (L.L.Ln_driver_relHum) *
		17.27 (L.L.Ln_driver_relHum) - / (S.L.driver_taupunkt)
 
		
		(L.L.Cabinair_driver_Temp)
		(L.L.Cabinair_driver_Temp) (L.S.Weather_Temperature) - 0.17 * - (S.L.heat_driver_factor)
	

	   (L.L.heat_driver_factor) (L.L.driver_taupunkt) <=
	   {if}	 
		  (L.L.windows_sweat_kabina) (L.S.Timegap) 0.01 * + 1 min (S.L.windows_sweat_kabina)
		  (L.L.windows_sweat_windshield) (L.S.Timegap) 0.01 * + 1 min (S.L.windows_sweat_windshield)		  
	     {else}		
		  (L.L.windows_sweat_kabina) (L.S.Timegap) 0.01 * - 0 max (S.L.windows_sweat_kabina)
		  
		  (L.L.cp_pered_otopitel)
		   {if}
		  (L.L.windows_sweat_windshield) (L.S.Timegap) 0.02 * - 0 max (S.L.windows_sweat_windshield)
		  {else} 
		  (L.L.windows_sweat_windshield) (L.S.Timegap) 0.01 * - 0 max (S.L.windows_sweat_windshield)
		  {endif} {endif}	
		  
		(L.L.windows_sweat_kabina) (L.L.windows_freezing_kabina) - (L.L.heat_driver_factor) /-/ 0.001 * (L.S.Timegap) * (L.L.windows_freezing_kabina) + 0 max 1 min (S.L.windows_freezing_kabina)		  

		(L.L.windows_sweat_windshield) (L.L.windows_freezing_windshield) - (L.L.heat_driver_factor) /-/ 0.001 * (L.S.Timegap) * (L.L.windows_freezing_windshield) + 0 max 1 min (S.L.windows_freezing_windshield)		
		
'	-------------------------------------------------- 
'            СТЕКЛА ПЕРЕГОРОДОК ЗАКРЫТЫХ
'	-------------------------------------------------- 

		(L.L.Cabinair_driver_Temp)
		(L.L.Cabinair_driver_Temp) (L.L.Cabinair_Temp) - 0.17 * - (S.L.heat_partition_factor)

	   (L.L.heat_partition_factor) (L.L.driver_taupunkt) <=
	   {if}	 
		  (L.L.windows_sweat_partition) (L.S.Timegap) 0.01 * + 1 min (S.L.windows_sweat_partition)
	     {else}		
		  (L.L.windows_sweat_partition) (L.S.Timegap) 0.01 * - 0 max (S.L.windows_sweat_partition) 
	     {endif}		 

		(L.L.windows_sweat_partition) (L.L.windows_freezing_partition) - (L.L.heat_partition_factor) /-/ 0.001 * (L.S.Timegap) * (L.L.windows_freezing_partition) + 0 max 1 min (S.L.windows_freezing_partition)		

{end}
