Where, T is the temperature in Kelvin, Beta (or β) is the thermal expansion coefficient (1/K), and Alpha (or α) is the thermal diffusivity (m2/s). Using MATLAB find the properties for T= 321, 440, and 571, respectively.
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ameer Hamza
le 17 Fév 2021
Commenté : Ameer Hamza
le 20 Fév 2021
clc
clear all
T=[300 400 500 600];
Beta=[1.33e3 1.5e3 0.86e3 0.65e3];
Alpha=[0.2128e4 0.4625e4 0.6384e4 0.7190e4];
coeff_Beta=polyfit(T,Beta,1);
Beta =@(T) coeff_Beta(1)*(T)+coeff_Beta(2);
coeff_Alpha=polyfit(T,Alpha,1);
Alpha =@(T) coeff_Alpha(1)*(T)+coeff_Alpha(2);
T=[321 440 571];
Beta=Beta(T);
Alpha=Alpha(T);
table(T',Beta',Alpha','variableNames',{'T','Beta','Alpha'})
There is an error occuring in the last line, kindly tell me the problem in the syntax!
0 commentaires
Réponse acceptée
Alan Stevens
le 18 Fév 2021
I get no error when running your script exactly as it is:
ans =
3×3 table
T Beta Alpha
___ ______ ______
321 1430.7 2895.8
440 1111.8 4912.3
571 760.72 7132.1
However, I suggest you don't use identical names for a variable and a function. For example, I'd change
Beta =@(T) coeff_Beta(1)*(T)+coeff_Beta(2);
to something like
Betafn =@(T) coeff_Beta(1)*(T)+coeff_Beta(2);
etc.
7 commentaires
Alan Stevens
le 20 Fév 2021
" ... I want to find the value of T (the same question above, that you have answered) ..."
The initial question did not find the value of T! The values of T were specified and the routine found the corresponding values of Alpha and Beta. If that's what you want from the interpolating polynomial, then use [300 400 500 600] for x, [1.33e3 1.5e3 0.86e3 0.65e3] for y (to find the corresponding Beta values) and the values [321 440 571] for x0.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Polynomials dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!