MATLAB: Heat Distribution in a Circular Cylindrical Rod cfunction doesnt include density
cfunctionpdethermal
Inthis example on mathworks the function is stated
but then when inserting into the PDE they use
cFunc = @(region,state) cp*region.y;
ignoring density (rho) therefore, why is it not
cFunc = @(region,state) cp*rho*region.y;
?
Thank you
Ben
Best Answer
Inthis section of the example you can see thatrho is included in the'MassDensity' argument, which automatically applies it to the correct part of the equation. If you were using the generic solver instead of the thermal solver, then indeed you would includerho in thed argument.
To write the surce as a function of time and temperature, followthis example. In short, give the heat source as a function that takes two arguments,region andstate. Toolbox function pass these arguments, whose values you can see described, for example,here. Your heat source function should return a row vector of values of the same number of elements as in, for example, theregion.x field.
Best Answer