Heat flux equation coding

Hi
Can you please help me code a 1-D heat flux equation q =- k(dT/dR).
I have a tabulated data of both T and R values.
Thank you in advance

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 7 月 28 日

0 投票

[sorted_t, idx] = sort(T);
sorted_R = R(idx);
gr = gradient(sorted_t, sorted_R);
q = -mean(gr);

4 件のコメント

Torsten
Torsten 2023 年 7 月 28 日
編集済み: Torsten 2023 年 7 月 28 日
I think T is a function of R. Thus sorting T with respect to R seems more plausible in this case. And why do you take the mean ?
Walter Roberson
Walter Roberson 2023 年 7 月 28 日
Ah, you are right, T being a function of R makes more sense for dT/dR . I was reading T as Time
[sorted_R, idx] = sort(R);
sorted_T = T(idx);
gr = gradient(sorted_R, sorted_T);
k = -mean(gr);
The user has a table of T and R values, so the implied task is to estimate k. Once the gradients have been estimated, the task turns into a best-fit of a linear multiplier with a known set of values, and the best fit in such cases is mean.
The situation would have been different if the user had a k value already, but they don't mention that.
Nour
Nour 2023 年 7 月 29 日
I do have the value of K (thermal conductivity). You're right, T is temperature not time and it's function of R (radius).
Thank you. I appreciate it
Torsten
Torsten 2023 年 7 月 29 日
So problem solved ?

サインインしてコメントする。

製品

リリース

R2022b

質問済み:

2023 年 7 月 28 日

コメント済み:

2023 年 7 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by