Time-dependent thermal conductivity

조회 수: 6 (최근 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