Discussion:
Simscape Radial Conduction
(too old to reply)
Horace Lai
2011-01-13 18:34:05 UTC
Permalink
Hi, this is my first attempt at making my own Simscape block. Here is my code and below that is an error that comes up when I execute ssc_build. The model is for a radial thermal conduction simulation.

component rad_conduction < foundation.thermal.branch
% Radial Conductive Heat Transfer
% The block represents heat transfer by conduction through a layer of
% material. The transfer is governed by the Fourier law and is directly
% proportional to the material thermal conductivity, area normal to the
% heat flow direction, temperature difference, and is inversely
% proportional to the thickness of the layer.
%
% Connections A and B are thermal conserving ports associated
% with material layers. The block positive direction is from
% port A to port B. This means that the heat flow is positive if it flows
% from A to B. A is the inside radius, B is the outside.

% Copyright 2005-2008 The MathWorks, Inc.

parameters
rad_o = { 1e-4, 'm' }; % Outer radius
rad_i = { 1e-4, 'm' }; % Inner radius
thickness = { 0.1, 'm' }; % Thickness
th_cond = { 401, 'W/(m*K)' }; % Thermal conductivity
end

function setup
% Parameter range checking
if rad_o <= 0
pm_error('simscape:GreaterThanZero','Outer radius')
end
if rad_i <= 0
pm_error('simscape:GreaterThanZero','Inner radius')
end
if thickness <= 0
pm_error('simscape:GreaterThanZero','Thickness')
end
if th_cond <= 0
pm_error('simscape:GreaterThanZero','Thermal conductivity')
end
end

equations
Q == 2 * pi * th_cond * thickness * T / log(rad_o / rad_i);
end

end
ssc_build
Generating 'custom_simscape_lib.mdl' in the MATLAB package parent directory 'C:\Users\Horace Lai\Desktop\Dropbox\Master Thesis\Simulink' ...
??? Failed to generate 'custom_simscape_lib'

Caused by:
Error using ==> lBuild at 35
Unable to load equation library corresponding to
'C:\Users\Horace Lai\Desktop\Dropbox\Master
Thesis\Simulink\+custom_simscape\+thermal\var_conduction.ssc'
source file.

Does anyone know what this mean? Why does it say unable to load equation library?

Regards,
Horace
Horace Lai
2011-01-13 18:47:05 UTC
Permalink
Please disregard this everyone. It was a really silly error mixing up file names.

-Horace

Loading...