i am currently working on a thermal model. My function is the heatflux-function and this calculates the temperature in one step. The idea is to use a while-loop to calculate the consecutive temperatures after multiple passes. This means the heatflux function uses the T_end from the previous loop to calculate the heatflux for the next loop. However, when i program this loop it doesn't seem to respond as wanted. I would also like to store the outputs of the function (Q, T_end, delta_T) and be able to plot after the loop has completed. The heatflux function works with the given inputs. Can somebody give me some useful tips on how to approach this problem?
Thanks in advance.
My current code is posted below.
r = r_initial - i*p/tan(angle);
[Q , delta_T, T_end ] = heatflux(v, p, r , angle, T, laserpower);
T = T_end + delta_T;
T(i) = T_end + delta_T;
i = i+1;