I am a mechanical engineer student and i am trying to learn mapleSim, but i am having some dificulties.
I am first trying to model an heat exchanger from a domestic water heater. I have found on maples website a costum component and i am trying to do a similar one to start.
The component that i am talking about is this one:
The problem is that after i put my own equations, parameters, initial condition and define the component ports, when i click on generating maplesim component i get an error message (Error in Component Button7 with captin "Generate MapleSim Component": (in Custom:-GenerateCostumComponent) cannot resolve 'Tgi' in model 'custom'; there is no 'Tgi' visible in model 'custom').
I created an attachment from template (costum component) and i changed the equiation parameters, etc to:
eq := [deltaTm(t) = (Tgo(t)-Twi(t)-Tgi(t)+Two(t))/ln((Tgo(t)-Twi(t))/(Tgi(t)-Two(t))), mw*cpw*(diff(Two(t), t)) = volw(t)*rhow*cpw*(Twi(t)-Two(t))+AU*deltaTm(t), mg*cpg*(diff(Tgo(t), t)) = volg(t)*rhog*cpg*(Tgi(t)-Tgo(t))-AU*deltaTm(t), Qwo(t)-Qwi(t) = AU*deltaTm(t), Qgi(t)-Qgo(t) = AU*deltaTm(t)]:
params := [mw = 10, cpw = 4.2, mg = 1, cpg = 3, rhow = 1000, rhog = 1, AU = 1000]:
initialconditions := [Tgo(0) = Tgi(0), Two(0) = Twi(0)]:
sys := DynamicSystems[DiffEquation](eq, inputvariable = [Tgi(t), Twi(t), Qwi(t), Qgi(t), volw(t), volg(t)], outputvariable = [Tgo(t), Two(t), Qgo(t), Qwo(t)]):
After this i executed the entire worksheet and added the ports to the component:
4 heat ports (each one for a T and Q combination (ex Tgo Qgo)
2 input signal (for the volw and volg variables)
After this if i clicked on 'generate maplesim component' and i got this error:
Error in Component Button7 with captin "Generate MapleSim Component": (in Custom:-GenerateCostumComponent) cannot resolve 'Tgi' in model 'custom'; there is no 'Tgi' visible in model 'custom'
or if i try to generate the component using the source i get a similar error:
cannot resolve 'Tgi' in model 'custom'; there is no 'Tgi' visible in model 'custom'
What am i doing wrong? i think that the equations make sense. I have tried to use others template (as the DC motor, algebEquation) but i cant create the component.
I would appreciate a little help so that i can start using mapleSim.