Why am I getting error : "Line: 21 Column: 1 Illegal use of reserved keyword "variables".

4 views (last 30 days)
I am trying to model a Tablet coater thermodynamic model to account for the change in thermodynamic properties with temperature of moist air and thermal liquid (water). For this, I want to make a costumized block which will solve the balanced equation relating inlet temperature and exhaust temp. i.e., Taout = (Mai*Cpa*Tai+Xw*Mcoat*Cpw*Tcoat-Xw*Mcoat*Hlv+Xorg*Mcoat*Cporg*Tcoat-Xorg*Mcoat*Hvorg+HLF*Trt)/(Mai*Cpa+Xw*Mcoat*Cpw+Xorg*Mcoat*Cporg +HLF)
I am new to simscape. Please help me in solving this error.
component Tablet_coater
% This is a thermodynamic model of tablet film coater
% which gives the relationship between inlet temperature and exhaust
%temperature
parameters
% Add parameters here
HLF = { 150 , 'cal/min*C' }; % Heat Loss Factor
Trt = { 25 , 'degree celcius'}; % Ambient temperature
end
nodes
b = foundation.moist_air.moit_air; % b:left
c = foundation.thermal_liquid.thermal_liquid; %c:left
end
outputs
Taout = { 0 , 'deg'}; %exhaust temperature:right
variables
Tin_b = {value={0,'deg'},imin={0,'deg'},imax={100,'deg'}};
Tcoat_c = {value={0,'deg'},imin={0,'deg'},imax={100,'deg'}};
end
variables (balancing = true)
Mai_b = { 0 , 'g/min' };
Cpa_b = { 0 , 'cal/g*C' };
Xw_c = 0;
Xorg_c = 0;
Cporg_c = { 0 , 'cal/g*C' };
Cpw_c = {0 , 'cal/g*C' };
Mcoat_c = { 0 , 'g/min' };
Hlv_c = { 0 , 'cal/g' };
Hvorg_c = {0 , 'cal/min*C' };
end
branches
Mai_b : b.Mai -> *;
Cpa_b : b.Cpa -> *;
Xw_c : c.Xw -> *;
Xorg_c : c.Xorg -> *;
Cporg_c : c.Cporg -> *;
Cpw_c : c.Cpw -> *;
Mcoat_c : c.Mcoat -> *;
Hlv_c : c.Hlv -> *;
Hvorg_c : c.Hvorg -> *;
end
equations
% Add equations here
Taout == fcn(Mai,Cpa,Xw,Xorg,Cporg,Cpw,Mcoat,Tcoat,Tai,Hlv,Hvorg);
Taout == (Mai*Cpa*Tai+Xw*Mcoat*Cpw*Tcoat-Xw*Mcoat*Hlv+Xorg*Mcoat*Cporg*Tcoat-Xorg*Mcoat*Hvorg+HLF*Trt)/(Mai*Cpa+Xw*Mcoat*Cpw+Xorg*Mcoat*Cporg +HLF);
end
end
  3 Comments
Rik
Rik on 26 Jul 2021
@Marcel Kreuzberg Please move your comment to the answer section (by re-posting it). That way Kajal can accept it.

Sign in to comment.

Accepted Answer

Marcel Kreuzberg
Marcel Kreuzberg on 27 Jul 2021
'end' missing after outputs block (before variables)
regards
Marcel

More Answers (0)

Tags

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!