kindly correct me in my loop

prompt = 'What is the value of Area, A? ';
A = input(prompt)
prompt = 'What is the value of Heat Transfer Coefficient, h? ';
h = input(prompt)
prompt = 'What is the value of Temperature of System, Ts? ';
Ts = input(prompt)
prompt = 'What is the value of Temperature of Surroudings, Tf? ';
Tf = input(prompt)
prompt = 'What is the value of mass, m? ';
m = input(prompt)
prompt = 'What is the value of Heat Capacity, c? ';
c = input(prompt)
prompt = 'What is the value of time interval, dt? ';
dt = input(prompt)
t = 0
prompt = 'What is the value of time at the end, tend? ';
tend = input(prompt)
while t<tend
for t == 0:t == dt:t == tend
qs = - A*h*(Ts - Tf)
Q = qs*dt
Tn = (Q/(m*c)) + Ts
t = t+dt
end
Ts = Tn
end

Respuestas (2)

Nishaben Desai
Nishaben Desai el 5 de Feb. de 2020

0 votos

my area is fix at 0.07854 meter squre, h = 0.1838, dt I have three values for different values of final time Tn, dt= 1, 10, 60 sec, value initial time t = 0, tend = 600, 1200, 1800 sec, heat capacity C= 4186, Ts = 80 and Tf = 25
Nishaben Desai
Nishaben Desai el 5 de Feb. de 2020

0 votos

Actually my problem happening is, that the for loop and while loop syntexes are somewhere mistaken and its not going into loop, so they have only one value answer of all the Tn I wanted, thats 6 values I am looking for

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Productos

Versión

R2019a

Etiquetas

Preguntada:

el 4 de Feb. de 2020

Respondida:

el 5 de Feb. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by