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
2023년 7월 28일
[sorted_t, idx] = sort(T);
sorted_R = R(idx);
gr = gradient(sorted_t, sorted_R);
q = -mean(gr);
댓글 수: 4
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
2023년 7월 29일
Torsten
2023년 7월 29일
So problem solved ?
카테고리
도움말 센터 및 File Exchange에서 Heat Transfer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!