MATLAB: PDE Toolbox – How to specify coefficient for both temperature and region dependent properties

conductioncylinderheat transferMATLABpde toolboxtemperature dependent

Hello all!
I am trying to model transient heat transfer in an axisymmetric rectangular domain (to imitate a cylinder) similar to the tutorial radioactiveRod.m in MATLAB but with temperature dependent properties. I checked the answer to this question: https://uk.mathworks.com/matlabcentral/answers/345324-pde-toolbox-how-to-specify-coefficient-for-temperature-dependent-properties and it was very helpful to model temperature dependent properties. I used the same code as in the question but because this is an axisymmetric simulation, I multiplied radial position to the temperature dependent conductivity just like in the radioactiveRod.m example:
k_TM = @(region,state) ((6e-7*state.u.^2 – 0.0028*state.u + 3.3753)*region.y);
But there was an error of the matrix dimensions not matching. Am I missing something here?

Best Answer

The region.y is a vector, so using vector multiplication should solve your issue. Try using this expression for k_TM
k_TM = @(region,state) ((6e-7*state.u.^2 - 0.0028*state.u + 3.3753).*region.y);