cs161/assignments/assignment6/heat_diffusion.cpp
/*********************************************************************
 * ** Function: plate
 * ** Description: calculates plate if plate selected
 * ** Parameters: n/a
 * ** Pre-Conditions: plate is selected
 * ** Post-Conditions: plate is calculated
 * *********************************************************************/
plate
Description: calculates plate if plate selected
Parameters: n/a
Pre-Conditions: plate is selected
Post-Conditions: plate is calculated
plate Description : calculates plate if plate selected Parameters : n / a Pre - Conditions : plate is selected Post - Conditions : plate is calculated
void plate() {
	float k = 0, rho = 0, c = 0, time_sim = 0.001675, init_temp = 0;
	float delta_x = 0, delta_y = 0, delta_t = 0, lr_col_temp = 100, tb_row_temp = 100;
	int plate_height = 0, plate_width = 0, sections = 0, num_intervals = 0;
	bool stable = false;
	input_plate(k, rho, c, init_temp, plate_height, plate_width, sections, num_intervals);
	delta_plate(plate_height, plate_width, sections, delta_x, delta_y, num_intervals, time_sim, delta_t);
	stable = stability_check_p(delta_t, delta_x, delta_y, k, rho, c);
	if(stable)
		calculate_plate(k, rho, c, init_temp, delta_x, delta_y, delta_t, sections, num_intervals, lr_col_temp, tb_row_temp);
	else {
		cout << "Those numbers aren't stable!" << endl;
		cout << "Start over!" << endl;
		exit(1);
	}
}
void plate ( ) { float k = 0 , rho = 0 , c = 0 , time_sim = 0.001675 , init_temp = 0 ; float delta_x = 0 , delta_y = 0 , delta_t = 0 , lr_col_temp = 100 , tb_row_temp = 100 ; int plate_height = 0 , plate_width = 0 , sections = 0 , num_intervals = 0 ; bool stable = false ; input_plate ( k , rho , c , init_temp , plate_height , plate_width , sections , num_intervals ) ; delta_plate ( plate_height , plate_width , sections , delta_x , delta_y , num_intervals , time_sim , delta_t ) ; stable = stability_check_p ( delta_t , delta_x , delta_y , k , rho , c ) ; if ( stable ) calculate_plate ( k , rho , c , init_temp , delta_x , delta_y , delta_t , sections , num_intervals , lr_col_temp , tb_row_temp ) ; else { cout << " " << endl ; cout << " " << endl ; exit ( 1 ) ; } }
** Function: plate
 ** Description: calculates plate if plate selected
 ** Parameters: n/a
 ** Pre-Conditions: plate is selected
 ** Post-Conditions: plate is calculated
** Function : plate ** Description : calculates plate if plate selected ** Parameters : n / a ** Pre - Conditions : plate is selected ** Post - Conditions : plate is calculated