Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the temperature inside a house that has two main areas. Let z(t) repres

ID: 3579419 • Letter: C

Question

Consider the temperature inside a house that has two main areas. Let z(t) represent the temperature in the attic and y(t) represent the temperature of the main living area, where t is time in hours. Air conditioning reduces the temperature by 5 degree per hour in the main living areas and the Temperature rate of change = k(Temperature difference) with y(0) = z(0) = 30. This gives rise to the following system of ODEs that describe the rate of change in temperature for the two areas of a house: y' = k(30 - y) + k(z - y) - 5 z' = k(y -z) + k(30 - z) Assume k = 1/4 reflects the insulation of the house. Write this system of equations in matrix form i.e. [y' z'] = A[y z] + C where A is a matrix of coefficients and C is a vector of constants. Find the homogeneous solution of this system of ODEs (i.e. C = 0) Find the particular solution. Write down the total solution. Plot you solutions (i.e. the temperatures of the attic and main living area versus time) on the same axes in MATLAB (include your code). Comment on any similarities or differences in the solutions. Are the solutions realistic?

Explanation / Answer

#include <iostream>
#include <string>
#include <stdlib.h>
#include <iomanip>
#include <vector>

const int empty = 0; // contains water
const int occupied = 1; // contains a ship
const int lost = 2; // shot into ocean
const int hit = 3; // shot and hit

using namespace std;

int board[ ten ][ ten ]; // Two-dimensional array for surface.

void initialize_board( int array1[ ten ][ ten ] ) // perform to initialize the surface.
produce a blank board   
for (int x=0; x<10; x++)
}   
}

void print_board(int array2[10][10])
cout << endl;

for(int i = 1; i <= 10; i++) { //number coordinates
if(i == 10)
       cout << i;
   else
       cout << " " << i ;

for(int j = 0; j < ten ; j++)