Time-dependent thermal conductivity

5 ビュー (過去 30 日間)
Giulia Ulpiani
Giulia Ulpiani 2019 年 8 月 28 日
コメント済み: Giulia Ulpiani 2019 年 8 月 29 日
Dear Matlab community,
I am using the PDE toolbox to solve a transient thermal model. Among thermal properties, thermal conductivity changes over time. I used the function handle:
k = @(~,state) kin-(kin-kfin)/(duration/state.time);
But when I run the code, it prompts that: "Coefficient evaluation function, "@(~,state) kin-(kin-kfin)/(duration/state.time)", was requested to
calculate coefficients at 2500 locations so should have returned a matrix with 2500 columns. Instead it returned a matrix with 1
columns.
How can I solve this issue?
Thank you
  1 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2019 年 8 月 28 日
If your thermal conductivity varies equally over the entire region independently of temperature or spatial coordinate just use repmat of your eqpression to the desired size, or multiply it with ones(size(x)) or whatever spatial coordinate the pde-solver calls your function k with.
HTH

サインインしてコメントする。

採用された回答

Ravi Kumar
Ravi Kumar 2019 年 8 月 28 日
Function should return values of k at all points requested by the solver, points are in the first argument. Update your funciton to:
k = @(location,state) ones(size(location.x))*kin-(kin-kfin)/(duration/state.time);
  1 件のコメント
Giulia Ulpiani
Giulia Ulpiani 2019 年 8 月 29 日
Thank you very much. That solved the problem.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by