This is a code for the heat transfer in a heat exchanger. It solves the system of the two ODEs T_h_dx = … and T_c_dx = … for two initial conditions T_hot_in and T_cold_in.

How can this be solved, if T_cold_in should be the temperature at the end of the heat ecxhanger (x = length / end condition) and T_hot_in still the temperature at x = 0 (initial condition)?

Thank you!

`% Functions for heat transfer to be solved by ode`

function T_calc = heat_transfer(~,T) T_h = T(1,1); T_c = T(2,1); T_h_dx = -1 / ((m_hot_plate / 2) * c_water * R_width) * (T_h - T_c); T_c_dx = 1 / ((m_cold_plate / 2) * c_water * R_width) * (T_h - T_c); T_calc = [T_h_dx ; T_c_dx]; end %__________________________________________________________________________

% solve ODE System

[X, T_tot] = ode23(@(x,T) heat_transfer(x,T), [0 length],[T_hot_in T_cold_in]);

## Best Answer