Temperature-dependent thermal properties
1 view (last 30 days)
Show older comments
Hi, I trying to implement temperature-dependent properties such as the thermal conductivity. Unfortunatley I have to implement the following temperature-dependent thermal conductivity.
So I tried the following code. There is no error but it seems it is not working the correct way. So can you help me where is the problem and how I can fix it? I guess the problem is the if and esleif part in the function...
...
k = @(location,state) k_temp(location, state);
thermalProperties(thermalmodel,'ThermalConductivity',k)
function H = k_temp(location, state)
F = 2;
Temp = state.u-273.15;
if (Temp < 100)
H = (1.7455 + 0.1163 * F + 0.001628 .* (state.u-273.15-20) * F);
elseif (Temp < 700)
H = (1.7455 - 0.000872 .* (state.u-273.15-100));
else
H = 1.23;
end
end
Many thanks for any help you can give me. Regards. Patrick
0 Comments
Answers (1)
Star Strider
on 17 Dec 2019
I am not certain what you want. (I cannot run your code, since I do not know what the arguments to the function should be.)
Note that ‘(Temp < 700)’ includes ‘(Temp < 100)’. Perhaps this is what you intend:
elseif ((Temp >= 100) & (Temp < 700))
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!