/* chauffage0.c 
Simulation de la régulation d'un chauffage (version 0)
Auteur :
Groupe :
date : 15/12/2016
*/


#include <stdio.h>

#define PUISSANCE_MAX_CHAUFFAGE 25000.0
#define K0 0
#define KP 0.13
#define KI 1.5e-5


double nouvelle_temperature( /* a completer */)
{
 /* a completer */
}

double puissance_transferee(/* a completer */)
{
 /* a completer */
}



int main(void)
{
double t; /*s */
double t_debut=0;
double t_fin=40000; /*s*/
double dt=5; /*s */

double T_exterieure=10; /*°C*/
double T_consigne= 19; /*°C*/


/* paramètres */
double Cth_habitation=6e6; /* J/°C */
double Rth_radiateurs= 2e-3 ; /* °C / W */
double Cth_chauffage=8e5; /* J/°C */
double Rth_parois= 1.5e-3 ; /* °C / W */

double T_habitation, T_chauffage;
double new_T_habitation, new_T_chauffage;

double P_chaudiere,P_radiateurs,P_parois;

double commande_chaudiere=1;
T_habitation=T_exterieure;
T_chauffage=T_exterieure;



for (/* a completer */)
	{
	/* a completer */

	P_chaudiere=PUISSANCE_MAX_CHAUFFAGE*commande_chaudiere;

	P_radiateurs=puissance_transferee(T_chauffage,T_habitation, Rth_radiateurs);
	/* a completer */

	new_T_chauffage= nouvelle_temperature(T_chauffage,Cth_chauffage, P_chaudiere-P_radiateurs, dt);
	/* a completer */

	}


return 0;
}
