MATLAB: Is the Thermal Model giving me an error

errorPartial Differential Equation Toolboxthermalbcthermalconductivitythermalicthermalmodelwarning

I am trying to solve for a thermal model using the "solve" function. When I try calling solve on my model, I am getting a warning and an error. I use "thermalBC" to set my boundary conditions and "thermalProperties" to set my 'ThermalConductivity' property with an anonymous function. Then I call solve on my model.
Warning: Matrix is singular to working precision.
> In pde.EquationModel/solveStationaryNonlinear (line 21)
In pde.ThermalModel/solve (line 141)
In Thermal (line 28)
Error using pde.EquationModel/solveStationaryNonlinear (line 27)
Unsuitable initial guess U0 (default: U0=0).
Error in pde.ThermalModel/solve (line 141)
u = self.solveStationaryNonlinear(coefstruct, u0);
Error in Thermal (line 28)
results = solve(model);

Best Answer

This warning and error are due to the face that initial conditions are not set and therefore default to zero. The 'ThermalConductivity' function has some part of the equation that is infinite, for example if you are calling log10, then log10(0) is -Inf.
Make sure to set your initial conditions using the "thermalIC" function and to set it to the appropriate value so that the function does not turn out to be infinite and error. See the link below for more information: