Temperature-dependent boundary conditions

Hello,
I am having some difficulty developing my code for a heat transfer process using pde toolbox. I got errors as shown below,
Error using sym>tomupad (line 1240)
Unable to convert 'pde.PDEModel' to 'sym'.
Error in sym (line 214)
S.s = tomupad(x);
Error in solve>getEqns (line 402)
a = sym(a);
Error in solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});
Error in heat_toy (line 56)
results = solve(model,tspan);
My boundary condition are tempeature-dependent. The coefficients 'g' and 'q' are defined by functions g1 and q1 respecitvely, and are as written as below,
function value = g1(location,state)
value = h*Ta./(S(state.u).*D(state.u));
end
function value = q1(location,state)
value = h.*S(SpecificHeat(state.u).*D(state.u));
end
S and D are functions of temperature, and are written as shown below,
function value = S(u)
cp = A3*u.^2 + B3*u + C3;
end
function value = D(u)
rho = A2*u.^2 + B2*u + C2;
end
Is it the boundary condititions that are causing me errors? Is there any way to solve it?
Thank you very much!
Best regards,
SS

 Accepted Answer

Do you have PDE Toolbox in your installed products list? You can check this by executing 'ver' at the command prompt. If so, did you create the 'model' variable using model=createpde(....)?
Regards,
Ravi

7 Comments

Hello Ravi,
Yes I have pde toolbox installed, and it worked for constant boundary conditions.I also created the model with createpde function.
Thank you!
Best, SS
Hmm...can you paste the output when you type model at the command prompt, like:
>> model
No problem, it is as shown below
ans =
FEMesh with properties:
Nodes: [2×1151 double]
Elements: [6×542 double]
MaxElementSize: 0.0894
MinElementSize: 0.0447
MeshGradation: 1.5000
GeometricOrder: 'quadratic'
Thanks!
Yes thats it. Somewhere in your workflow you have overwritten the model variable with mesh. You don't have model, which would have looked something like this:
model =
ThermalModel with properties:
AnalysisType: 'transient'
Geometry: []
MaterialProperties: []
HeatSources: []
StefanBoltzmannConstant: []
BoundaryConditions: []
InitialConditions: []
Mesh: []
SolverOptions: [1×1 pde.PDESolverOptions]
Hi,
Thanks for your answer! But I am trying to not use the thermal analysis package, and I am just using the general solver to solve my problem as the package can't meet my need.
Is that the
generateMesh(model)
overwrites the model with mesh? But I thought it is a must-have step for solving the problem.
Thank you!
Best,
SS
Can you post the complete code?
I am guessing you are overwriting the model, like:
model = generateMesh(model)
Regards,
Ravi
Hi Ravi,
I guess I figured it out. The error was caused by using function solve instead of solvepde. Thanks for your help!
Best regards,
Shengyue Shan

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!