IntroductionTheoryGES User InterfaceWorking with GES Index
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > 1 Junction (3 gates)
1 Junction (3 gates) input output
gate energy variable symbol unit variable symbol unit
0 pos flow f [-] effort e [-]
1 pos effort e [-] flow f [-]
2 pos effort e [-] flow f [-]
n pos effort e [-] flow f [-]
Table 1 Gate variables 1 Junction
The 1-junction apparatus or effort junction or common flow junction is used to represent the connection structures typically known as"series". The 1-junction has a single flow on all its gates and the sum of the efforts (e) to the element apparatus vanishes. Takentogether, these two properties imply that the 1-junction conserved power is zero:
e0 . f0 + e1 . f1 + .... en . fn = 0
Using the power sign convention, the relations for the component may be written as follows:
f0 = f1 = .... = fne0 + e1 + .... + en = 0
e0 will be calculated.
There is no restriction on the number of gates n. The default value for n is 3. In the following dialog box you can change the numberof gates by using the add button. This box is found with a right mouse click on the 1-junction component, the properties section.
Remark: This component is for three input gates in the connect mode automatically generated by GES
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > 3 Phase PWM inverter
3 Phase PWM inverterThe Pulse Width Modulation (PWM) inverter is a power source, giving a 3-phase AC voltage at frequency parameter(2).
Parameters Parameter(0): DC Voltage [V]Parameter(1): PWM frequency [Hz]Parameter(2): Carrier frequency [Hz]Parameter(3): modulation index [-]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > 3 Phase sinus generator
3 Phase sinus generatorThe 3 Phase sinus generator generates a 3 Phase sine shaped on e_gates(1 to 3) starting at an angle from zero as indicated inparameter(2).
Parameters Parameter(0): Amplitude [V]Parameter(1): Frequency [Hz]Parameter(2): Phase [Deg]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions >
ABSFunction ABS returns an absolute value.
Syntax ABS(value x)
Remarks ABS calculates the absolute value of x
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > acos
acosFunction acos returns a trigonometric arc cosine.
Syntax acos(value x)
Remarks acos calculates the arc cos (inverse cosine) of x. Result is the angle in radians.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Add Ins
Add Ins
Add ins
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Tools > AES
AES evaluation toolFor the calculation of various conceptual ship designs in this paper a new modeling language for domain independent physical(stationary) systems is used. This program General Energy Systems (GES) is based on object-oriented modeling to facilitatereuse of models and model parts. With the integrated graphical interface the user can easily build, modified and analyze hismodel. The components of GES are based on block-diagram structures, but the decryption of the components is textual. Thiscombination allows building physical systems and large model libraries efficiently and elegantly.
The philosophy of the program GES is that model developers on differed fields independent of each other can modulate theirproduct. GES brings the differed business fields together, with the idea that connecting of their models is not the problem. Thisis done by describe the edges of the models with a pair of variables which described the ideal exchange of energy between thesub models. For every physical domain a pair of variables is available to describe the energy flow.
Methodology
For every type of ship an operational profile is determined. The operational profile contains information of the main powerconsumers of the installation. This profile is sequential read by a control block in GES. In every time interval energy equilibriumof all the components is calculated. The operational profile is running twice. First to determined the physical attributes of thecomponent such as mass, volume, cost etc. of the installation. Secondly to calculate the actual attributes depending on theirload such as fuel consumption, emissions, availability etc. Special code is including in the component for writing the results of asimulation in a spreadsheet file. A macro in Excel is developed to make a graphical representation of the results.
Models
For the All-Electric Ship study is a large model library in GES developed. The library consists of all major equipment for shipinstallations. Unique of this library is the combination of physical systems and economical values. Several principles are used tostore the data in a component. For some equipment real data lists are used. The components are grouped on their main energydomain in a tree structure. With one drag the requirement component is copied in the model. The equations of the models arewritten in include files and need to be specified only ones. A typically installation is represented in the next figure.
Fig. Propulsion installation with library
Authors’ biographies
Hans van Vugt graduated in 1986 from Twente University specialized in control engineering. He has been active in the designand development of control and monitoring systems for manipulators, robots and offshore platforms. Since 1993 he is the primedeveloper of the power plant simulation program GES.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > Solvers > Algebraic solver
Algebraic loopsAlgebraic, or implicit, loops may occur when two or more components use each other's functions.
In most simulation programs the user must avoid algebraic loops, because the algorithm to solve the equation is based oniteration. In GES this is solved automatically. Simulations with GES models involve the numerical iteration of a set of non-linearequations. GES provide a globally convergent Newton-Rapson method to solve the equations. A global method converges to asolution from almost any starting point. The algorithm in GES combines the rapid local convergence of Newton’s method with aglobally convergent strategy that will guarantee some progress towards the solution at each iteration. At each iteration theproposed step is quarantined with a backtrack method to find an acceptable step. While the method can still occasionally fail bylanding on a local minimum, this is quite rare in practice. The routine can warn the user if this happens. In GES this warning isset in the log-file. The remedy is to try a new starting point. For the energy iteration process in GES the iteration offset can bechanged or the init gate component can be used. By the parameter change iteration process the start point values in theparameter list of the par components can be changed.
Unfortunately, due to the diversity of system behavior, no single method will quarantine to simulate each type of modeaccurately and efficiently. A careful selection of simulation parameters is an important consideration to obtain accurate results.You almost require additional information, specific to your particular problem, to answer such basic question as: ‘Do I expect aunique solution?’ and ‘Approximately where?’.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > asin
asinFunction ASIN returns a trigonometric arc sine.
Syntax ASIN(value x)
Remarks ASIN calculates the arc sin (inverse sine) of x. Result is the angle in radians.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > Asynchronous motor
Asynchronous motorTwo-phase AC voltage asynchronous motor Technical details of the motor and the connected AC voltage are inserted intoparameters 0 t/m 9. Output on gate(1) is the angular frequency. The model is a physical model and the motor efficiency is aresult(not an input parameter).
Parameters Parameter(0/9): Technical details of the motor and the connected AC voltage.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > atan
atanFunction atan returns a trigonometric arc tangent. Syntax atan(value x);
Remarks atan calculates the arc tangent (inverse tangent) of x. Result is the angle in radians. Example atan(1) = 0.785398
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > atan2
atan2Function atan2 returns the arc tangent of y/x.
Syntax atan2(value y, value x);
Remarks atan2 returns the arc tangent of y/x in the range of -pi to pi. Result is the angle in radians.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > binom
binomFunction BINOM returns then binomial coefficient. Syntax BINOM(value m,value n)
Remarks BINOM calculates binomial.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Interface functions > Com
ComGES on Microsoft Windows support COM Automation server capabilities.The GES server can be controlled by any Windows program that can be an Automation controller.This section explains how to call functions in the server from MATLAB M-file, Visual Basic client or Quaestor applications.
Excel Dim GES As ObjectSet GES = CreateObject("Ges.Application")
MATLAB h = actxserver('GES.Application')Python import win32com.client
GES = win32com.client.Dispatch("GES.Application")
The GES Com-object supports properties and methods.
The properties which can be set on the object are presented in the following table:
Server Properties
GesCompParse(comp,'equations' ) Set and parse equations in component
MATLAB: set(h,'GesCompParse',comp, ['f_gate(1)=f_gate(0);',char(13),... 'e_gate(0)=e_gate(1);pos_gate(0);neg_gate(1);']);
C: GES.OlePropertySet("GesCompParse", comp,"sys.nowarning;include 'block.equ';")
GesParse(comp,[0,1]) Parse comp [1 = clear workspace, 0 = do not clear workspace]if comp is 0, whole model is parsed
Excel: Call GES.GesParse(pComp, 0)
MATLAB: invoke(h,'GesParse',0);
C-code GES.OleProcedure("GesParse", 0);
GesOpenModel Opens a GES model. Same as GesLoadModel MATLAB: set(h,'GesOpenModel','C:\ges\Benchmark.mod');Excel: GES.GesOpenModel = "C:\ges\Benchmark.mod"Python: GES.GesLoadModel = "C:\ges\Benchmark.mod"C: GES.OlePropertySet("GesOpenModel",(OleVariant)fil);
GesLoadModel Opens a GES model. Same as GesOpenModel MATLAB: set(h,'GesLoadModel','C:\ges\Benchmark.mod');Excel: GES.GesLoadModel = "C:\ges\Benchmark.mod"Python: GES.GesLoadModel = "C:\ges\Benchmark.mod"
GesSaveModel Saves the currently activated GES model
GesSet Put a value to a global GES variable in the parent MATLAB: set(h,'GesSet','setpoint',speed);Excel: GES.GesSet("setpoint") = speedPython: GES.GesSet(“setpoint”,speed)Set the value of MATLAB variable speed in the GES global variable !setpoint
GesRun Run a timestep. If step=0, all init_functions are executedExcel: GES.GesRun = stepC: GES.OlePropertySet("GesRun",step);
RunFunction Runs a component function in GES
MATLAB: set(h,'RunFunction',comp,'string name offunction');
for instance in GES is defined in a component with pointer comp:function test(){Messagebox 'function is running');}
This function is then called by:set(h,'RunFunction',comp,'test');
GesSetSteps Set number of simulation steps MATLAB: set(h,’GesSetSteps’,nrsteps);Excel: GES.GesSetSteps = nrstepsPython: GES.GesSetSteps = nrsteps
GesLoadDrw(comp,'Filename' ) Load drawing from file in comp
MATLAB: set(h,'GesLoadDrw',comp,'block.drw');Excel: GES.GesLoadDrw(comp) = "block.drw"C: GES.OlePropertySet("GesLoadDrw", comp, "block.drw");
GesWriteDrw(comp, 'Filename') Write drawing of comp to file MATLAB: set(h,'GesWriteDrw',comp,'block.drw');Excel: GES.GesWriteDrw(comp) = "block.drw"Python: GES.GesWriteDrw(comp, "block.drw")
GesSetGateEnergy(Comp, GateNr, Param)
The methods supported by the COM-server are presented in the following table.
Server Methods
GesNew Opens a new GES window in GES
Excel: GES.GesNew
MATLAB: invoke(h,'GesNew');
GesGetParent C: int parent = GES.OlePropertyGet("GesGetParent",0);
GesClearModel Clear the entire GES model currently open
GesClearCalculation
GesCloseWindow Close the currently open GES Model. Only works on files opened viathe COM server.
Excel : GES.GesCloseWindow
MATLAB: invoke(h,'GesCloseWindow');
C: GES.OleProcedure("GesCloseWindow");
GesOpenModelParent Opens a GES model and returns the parent pointer of GES
MATLAB: pParent =get(h,'GesOpenModelParent','C:\ges\Benchmark.mod');
GesGet( variable ) Returns the value from a global GES variable from the parent
MATLAB: setpoint=invoke(h,'GesGet','setpoint');Excel: setpoint=GES.GesGet("setpoint")Python: setpoint=GES.GesGet("setpoint")
GesVariable Set and get a workspace variable from a GES component
Excel get: Cells(Rowno, Colno).FormulaR1C1 =GES.GesVariable(comp,'testvar')
Excel set: GES.GesVariable(comp,'testvar') =Cells(Rowno, Colno).FormulaR1C1
//The Matlab variable var is set in testvar of GESin component comp
Matlab set: set(h,'GesVariable',comp,'testvar',var);
C-code set: GES.OlePropertySet("GesVariable", comp,"testvar", var);
C-code get: var = GES.OlePropertyGet("GesVariable",comp, "testvar");
//The Ges variable testvar from component comp isget and set in variable var of MATLAB
Matlab get: var =get(h,'GesVariable',comp,'testvar');
GesSharedVariable Set and get a sharedworkspace variable from a GES component
Excel get: Cells(Rowno, Colno).FormulaR1C1 =GES.GesSharedVariable(comp,'testvar')
Excel set: GES.GesSharedVariable(comp,'testvar') =22
Name in ges is !!!testvar
GesWindow Use the active GES windowExcel: GES.GesWindow
MATLAB: get(h,'GesWindow');
GesStartRun Initialisation of run start, in combination withGesRun and GesStopRun
Excel: Call GES.GesStartRun
GesStopRun Excel: Call GES.GesStopRun
MATLAB: invoke(h,'GesStopRun')
GesRunSteps(Steps ) Runs the model continue with number of steps
Excel: Call GES.GesRunSteps(2)
MATLAB: invoke(h,'GesRunSteps',2);(run model with two steps)
C-code GES.OleProcedure("GesRunSteps", 2);
GesGetParent(comp) Get the parent of a component
MATLAB: parent = get(h,'GesGetParent',comp)(Get parent component of the component comp(0=root))
GesGetComp Get a component pointer by index
parent is pointer;
index is number of the child of the parent,0=first,1=second etc
MATLAB: comp = get(h,'GesGetComp',parent,index);
comp = 0 is no child
GesCreateComp(parent, nrgates, Name, * Comp ) Create a GES component
Excel: comp = GES.GesCreateComp(parent, 2, "Name")
MATLAB: comp =get(h,'GesCreateComp',parent,2,'Name')(for instance with 2 gates)
C: comp = GES.OlePropertyGet("GesCreateComp",parent, 2, "Name); // 2 gates
GesType(comp) Excel get: Cells(Rowno, Colno).FormulaR1C1 =GES.GesType(comp)Excel set: GES.GesType(comp) =
Cells(Rowno,Colno).FormulaR1C1
GesDrawing(comp) Excel get: Cells(Rowno, 3 + Colno) =GES.GesDrawing(comp)Excel set: GES.GesDrawing(comp) = Cells(Rowno, 3 +Colno)
GesEquations(comp) Excel get: Cells(Rowno, 2 + Colno) =GES.GesEquations(comp)Excel set: GES.GesEquations(comp) = Cells(Rowno, 2+ Colno)
GesNrParameters(comp, * Nrpar ) Excel: Nrpar = GES.GesNrParameters(comp)
GesGetComp(parent, Index, * comp ) Get the component pointer with parent index
Excel: comp = GES.GesGetComp(parent, Index)
GesNrComp(parent, * Nrcomp ) Get the number of components of parent
Excel: Nrcomp = GES.GesNrComp(parent)
MATLAB: Nrcomp = get(h,'GesNrComp',parent)
GesNrGates(comp, * nrgates ) Get the number of gates of componentExcel: nrgates = GES.GESNrGates(comp)
GesGetName(Comp, * Name ) Get the name of the component
GesConnect(parent, comp1, Gate1, comp2, Gate2 ,[0/1/2],[properties])
[0/1/2] is optional (if one component al is connected)
0 generates always a 0-junction, by more than one connection1 generates always a 1-junction, by more than one connection2 generates automatic a 0 or 1 junction, depended of gate functions,is default value
[properties] is optional word[HIDE,HIDE,TEXT, etc: see sys.component.property for the words, 0is default
Excel: Call GES.GesConnect(parent, comp1, 1, comp2,0)
MATLAB:invoke(h,'GesConnect',parent,comp1,1,comp2,0)(connect gate 1 from comp1 to gate 0 from comp2with 0-junction)
Remark: automatic generated junctions are not firstshown in the tree view.
GesFormFit Fit the model to the screen and Redraws
Excel: Call GES.GesFormFit
GesFormPaint Redraws the figures
Excel: Call GES.GesFormPaint
C: GES.OleProcedure("GesFormPaint");
GesGetParameter(comp, Index, * Value, [index i=0],[index j=0] )
MATLAB: Value =get(h,'GesGetParameter',comp,Index)
Excel: Cells(Rowno, Colno).FormulaR1C1=GES.GesGetParameter(comp, Index)
GesSetParameter(comp, Index, Value, [index i=0],[index j=0])
Excel: Call GES.GesSetParameter(comp, Index,Cells(Rownr,Colnr).FormulaR1C1)
GesReadParameters(comp, 'Filename') Excel: Call GES.GesReadParameters(comp,"script.tmp")
GesWriteParameters(Comp,'Filename') Excel: Call GES.GesWriteParameters(comp,"script.tmp")
GesParameter(comp, Index) Excel get: Cells(Rowno, Colno) =GES.GesParameter(comp, Index)Excel set: GES.GesParameter(comp, Index) =Cells(Rowno, Colno)
GesFlow(Comp, GateNr, * Value )
GesEffort (Comp, GateNr, * Value )
GesParameter(comp, Index, Value ) MATLAB: invoke(h,'GesParameter',comp,Index,Value)(set Value in parameter(Index) of comp)
C-code: GES.OlePropertySet("GesParameter", Comp,Index, Value); set Value in parameter(Index) ofcomp
GesWaitRun Wait on GES when the calculation is ended.
C-code: GES.OleProcedure("GesWaitRun");
GesGetNameParameter(Comp, Index, * Name ) Read parameter name from Comp
GesNameParameter(Comp, Index, *Name) Write parameter name to Comp
Excel: Call GES.GesNameParameter(comp, Ipar,Cells(Rowno, Colno).FormulaR1C1)
GesGetUnitParameter(Comp, Index, * Name) Read parameter unit name fromComp
GesUnitParameter(Comp, Index, *Name) Write parameter unit name to Comp
Excel: Call GES.GesUnitParameter(comp,Ipar,Cells(Rowno, Colno).FormulaR1C1)
GesCompValue(Comp, Name, * Value )
GesInsertModel(Parent, 'Filename', * Comp ) Insert model from file in the model
Excel: Comp = GES.GesInsertModel(Parent, "Filename.mod")
c: GES.GesInsertModel(Parent, "Filename.mod")
GesGetGateEnergy(Comp, GateNr, * GateEnergy )
GesCompSize(Comp, x, y, z) Resize the actual drawing to maximum x, y, z values
Excel: Call GES.GesCompSize(comp, X, Y, Z)
C: GES.OleProcedure("GesCompSize", comp, X, Y, Z );
GesCompInline(Comp, x0, y0, z0, x1, y2, z2 ) Set the actual drawing in line between x0, y0, z0 and x1, y1, z1
Excel: Call GES.GesCompInline(comp,x0,y0,z0,x1,y1,z1)
GesCompPos(comp, X, Y, Z ) Excel: Call GES.GesCompPos(comp, X, Y, Z)
MATLAB: invoke(h,'GesCompPos',comp,X,Y,Z)
(set comp op position X, Y, Z)
GesGetCompPos(comp, x, y, z) Excel: ret = GES.GesGetCompPos(comp, X, Y, Z)
GesGetCompOut(comp,gate,compout)
GesActiveWindow(string)
GesClear
GesCombineJunctions
GesCommentVariable(int,string)
GesComponentDelete(int,int)
GesComponentReplace(int,int,int)
GesDimGate(int,int)
GesDisable(int,int,var(opt))
GesDismantle(int,int,var(opt))
GesGetNameXML(int)
GesGroupPos(int,double,double,double)
GesDefineMatrix(Comp,string,double m,double n) b = integer is used as pointer
Excel: b = GES.GesDefineMatrix(gesparent, "Test", 6, 1)
MATLAB:b = get(h,'GesDefineMatrix',parent, 'Test',6,1);
GesMatrixElement(pointer,row,col,value) Returns element of a matrix variable. Use this in conjuction withGesPointerMatrix to read out matrix variables per element.Row and column indices start at 0.b = matrix pointervalue = variable
Excel:Cells(1, 2).FormulaR1C1 = GES.GesMatrixElement(b,0, 0)
GES.GesMatrixElement(b, 0, 0) = 10
MATLAB:row = get(h,'GesPointerMatrix',0,'A',-1)col = get(h,'GesPointerMatrix',0,'A',1) b = get(h,'GesPointerMatrix',0,'A') c(1,1) = get(h,'GesMatrixElement',b,0,0)c(1,2) = get(h,'GesMatrixElement',b,0,1)c(2,1) = get(h,'GesMatrixElement',b,1,0)c(2,2) = get(h,'GesMatrixElement',b,1,1)
set(h,'GesMatrixElement',b,0,0,value);
GesModelParse Preparse the GES model.
MATLAB: invoke(h,'GesModelParse');Excel :GES.GesModelParsePython: GES.GesModelParse
GesName(int,string)
GesNameGate(comp,gatenr,effort/flow) Returns the effort or flow name of gate 'gatenr' of component withpointer comp. Setting the third parameter to 1 returns the name ofthe effort, 2 returns the name of the flow.
Excel:gatenameeffort = GES.GesNameGate(comp, Igates, 1)
GesPointerMatrix(comp,int,string,dimension(optional)) Returns the pointer of a matrix variable. Use this in conjuction withGesMatrixElement to read out matrix variables per element.
The method returns the number of rows of the matrix if the optional'dimension' parameter is set to -1, and it returns the number ofcolums if it is set to 1.
MATLAB:row = get(h,'GesPointerMatrix',0,'A',-1)col = get(h,'GesPointerMatrix',0,'A',1) b = get(h,'GesPointerMatrix',0,'A') c(1,1) = get(h,'GesMatrixElement',b,0,0)c(1,2) = get(h,'GesMatrixElement',b,0,1)c(2,1) = get(h,'GesMatrixElement',b,1,0)c(2,2) = get(h,'GesMatrixElement',b,1,1)
GesPointerVariable(int,string)
GesRunModel(int)
GesSharedVariable(string,double) Shared variable is used to communicate with more than 1 gesinstance
Excel:GES.GesSharedVariable("Test") = 3 '!!!Test = 3
Cells(1, 1).FormulaR1C1 =GES.GesSharedVariable("Test")
MATLAB:
set(h,'GesSharedVariable','Test',3); %Set sharedvariable !!!Test = 3
A = get(h,'GesSharedVariable','Test'); %Get sharedvariable Test and put into Matlab variable A
GesStatusBar(statusbarblock,string) Set or return the statusbar message string. The status bas consistsof 4 horizontal blocks, with a corresponding pointer of 0 to 3.
MATLAB: invoke(h,'GesStatusBar',0,'Busy');Excel: sb=GES.GesStatusBar(0,"Busy")
GesUnitGate(comp,gatenr,effort/flow) Returns the effort or flow unit of gate 'gatenr' of component withpointer comp. Setting the third parameter to 1 returns the unit of theeffort, 2 returns the unit of the flow.
Excel:gateuniteffort = GES.GesUnitGate(comp, 1, 1)
Ges_E_F_Gate(int,int)
Example: MATLAB
This MATLAB example opens an active GES model and read the name of the parameters and the parameter value.
h = actxserver('GES.Application');invoke(h,'GesWindow'); %invoke actual GES modelparent = get(h,'GesGetParent',0); %Get Parent component of the windowNrComp = get(h,'GesNrComp',parent) %Get nr Comp
for i=1:NrComp
comp = get(h,'GesGetComp',parent,i-1); %Get component pointername = get(h,'GesGetName',comp) %Get name of componentenergy = get(h,'GesGetGateEnergy',comp,0) %Get energy direction of gate 0NrPar = get(h,'GesNrParameters',comp); %Get number of parameters of thecomponentfor j=1:NrParNamePar = get(h,'GesGetNameParameter',comp,j-1)Value = get(h,'GesGetParameter',comp,j-1)end
Example: Excel macro READGESMODEL
This macro read an active GES model in Excel. The code is recursive, so a complete GES model could be read in. In this example are all theparameter names, values of the components placed in Excel cells. The code is available in the Excel file GESOLE.XLS
Sub READGESMODEL()''READGESMODEL Macro' Macro recorded 10/18/2006 by Hans van Vugt'Dim GES As ObjectDim parent As LongDim comp As LongDim code As String
Set GES = CreateObject("Ges.Application")GES.GesWindowgesparent = GES.GesGetParent(0)Rowno = 1Colno = 0Call SubModel(GES, gesparent, Rowno, Colno)
End Sub
Sub SubModel(GES, gesparent, Rowno, Colno)NrComp = GES.GesNrComp(gesparent)IComp = 0Do While IComp < NrComp
comp = GES.GesGetComp(gesparent, IComp)
Cells(Rowno, 1 + Colno).FormulaR1C1 = GES.GESGetName(comp)
Nrpar = GES.GesNrParameters(comp)Cells(Rowno, 2 + Colno).FormulaR1C1 = Nrpar
NrSubComp = GES.GesNrComp(comp)Cells(Rowno, 3 + Colno).FormulaR1C1 = NrSubComp
Nrgates = GES.GESNrGates(comp)Cells(Rowno, 4 + Colno).FormulaR1C1 = Nrgates
Ipar = 0Do While Ipar < NrparRowno = Rowno + 1Cells(Rowno, 2 + Colno).FormulaR1C1 = GES.GesGetNameParameter(comp, Ipar)
Cells(Rowno, 3 + Colno).FormulaR1C1 = GES.GesGetParameter(comp, Ipar)Cells(Rowno, 4 + Colno).FormulaR1C1 = GES.GesGetUnitParameter(comp, Ipar)
Ipar = Ipar + 1Loop
If NrSubComp > 1 ThenColno = Colno + 1Rowno = Rowno + 2Call SubModel(GES, comp, Rowno, Colno)Colno = Colno - 1ElseRowno = Rowno + 2End If
IComp = IComp + 1Loop
[Go to top of page]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > comment string
comment stringFunction comment string transforms a string into a comment for a variable. This comment will be shown in the inspect
state window.
Syntax %variable = 'string'; orvariable; %string orvarable'string';
Example %a = 'test';
b; %welcomec'new';
Example If you run this GES example, in the component popup menu > inspect state you can see the comment strings.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Comments
CommentsComments are pieces of text used to annotate a program. Comments are for the programmer's use only; they are automaticallyskipped from the source text before parsing.There are two ways to delineate comments: The single line method and the multi line method. Both are supported by GES.
In GES versions higher than 1.10 is it possible to use the single line comment as directive for including and excluding GEScode.
Exclude code
the //> comment characters exclude source code for GES versions higher than 1.10 between the next //> comment characters.
For instance:
//>
a=a+1;
c=a*10;
//>
The code between //> and //> is only used for GES versions higher than 1.10, else this characters are normal single linedelineators.
Include comment code
The code behind the //< characters are included for GES versions higher than 1.10, for lower versions is this the normaldelineator.
For instance the code:
//< a=a+2;
//< c=a*10+1;
is used for higher GES versions above 110 and not used for GES version 1.08 and 1.10
Multi line comments
A multi line comment is any sequence of characters placed after the symbol pair /*. The comment terminates at the firstoccurrence of the pair */ . The entire sequence is automatically skipped from the parser string.
Example:
a = /* declaration */ 10 /* value */ ;
parses as these four tokens:
a = 10 ;
Single line comments
Single line comments allows a single-line comment using two adjacent slashes (//). The comment can start at any position, and
extends until the next new line.
Example:
a = 10 ; //declaration of local variable a
Case sensitivity
GES function identifiers are not case sensitive, so Sin(x), SIN(x), sin(x) are equal functions.
But the identifiers for the local and global workspace are case sensitive, so that Sin, SIN and sin are distinct workspacevariables. Remark: An identifier of a workspace can have the same name as a function.
Punctuators
The punctuators (also known as separators) in GES are defined as follows:
punctuator: one of
( ) { } , ; =
Parentheses
( ) (open and close parentheses) group expressions, isolate conditional expressions, and indicate function calls.
Examples:
d = c * (a + b); //override normal precedence
if (y == z) x = x + 1; // essential with conditional statement
sin(x); // function call
sin; // no function but declaration of local workspace
sin = 0;
Braces
{ } (open and close braces) indicate the start and end of a compound statement.
Example:
if (y == z)
{
x = x +1;
!a = sin(x);
}
The closing brace serves as a terminator for the compound statement, so a ; (semicolon) is not required after the }, except instructure declarations. Sometimes, the semicolon is illegal, as in the following:
Example:
if (statement)
{ x = x + 1}; // illegal semicolon
else
Comma
The comma (,) separates the elements of a function argument list.
Example:
d = limit(a,b,c);
Semicolon
The semicolon (;) is a statement terminator. Any legal GES expression followed by a semicolon is interpreted as a statement,known as an expression statement. The expression is evaluated and its value is discarded. If the expression statement has noside effects, GES might ignore it.
Examples:
a + b; // maybe evaluate a + b , but discard value
; // empty expression = null statement
A semicolon is often used to create an empty statement
Example:
if(i<10)
{
;
}
Equal sign
The = (equal sign) separates variable declarations.
In GES the declaration of the workspace variables is done automatically at any point within the code. The default value is zero ifthe variable is not in memory.
Examples:
a = !b = c = 100; // Gives these workspace variables the value 100.
z ; // is equal to z = 0;
[top]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Complex numbers
Complex NumbersIn GES it is possible to work with complex numbers.
The notation is a + biFor example:
a = 3 + 2i;b = 6 + 3i;c = a+b; //c is now 9+5i
More examples can be found in this model.
Remark, not al functions in GES are compatible with complex numbers.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component initialisation functions
Component initialisation functionse_name_gate
e_unit_gate
f_name_gate f_unit_gate name_component name_model name_parameter neg_gate
p_unit_gate pos_gate unit_parameter
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Component language
Component language
init_functionpre_functioneffort and flowpost_functionend_function
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions
Component mathematical functionsdiss_component e_gate e_append_gate e_value eff_component f_gate f_append_gate f_append_gate.first f_value gate_energy locate
matrix
nr_gates or #gates nr_parameters or #parameters
parameter
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Component structure
Component structureIn GES all components have an identical object structure. For every component is chosen:
- the number of gates.- the number of parameters- the effort or flow function of a gate- a local workspace- a parser string (this is a text string for the equations).
The number of gates is depending on the energy interaction with the surroundings. The number of parameters is depending ofthe component type. The effort and flow functions of a gate are depending on the available function who must describe thevariable. It is possible that both effort and flow functions could be expressed. In that case more component descriptions arepossible.
In the local workspace some variables can be set. These variables are visible for the user in the results mode. In the parserstring some special functions (parser functions) can be set to perform operations with the workspaces and the parameters ofthe component. The parser string is specially used by the user defined component, but it is possible that the user uses theparser string for comments (e.g. for import library components) and startup low-level initialization calculations.
In GES two special global workspaces are available: the system workspace and the global workspace. All components in themodel can use these workspaces. With the global workspace it is possible to exchange variables with other components whichare not connected in one model. Global workspace variables are marked with an exclamation mark (for instance: !A).
With the system workspace the user can also exchange values with separated models which are created with New. The systemworkspace gives information about the calculation errors and calculation flow in special reserved variables. The systemworkspace variables are marked with two exclamation marks (for instance: !!error).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Component types
Component typesIn GES two types of components are possible: energy components and signal components. Energy components are usedfor building a model of a physical system. Signal components are used to control the energy components.
Energy component
An component in GES has the property that each gate is associated with a (scalar) power flow expressible as a product of twovariables. However, in the actual analyses, power needs not to be expressed as a product of two variables. For the class ofGES components it is common practice to split the power into particular factors that can easily be measured and that can begiven physical interpretations. In general discussions it is convenient to give the names effort (symbol e) and flow (symbol f) tothe two factors and to define the power (symbol P) as follows:
In principle, these variables can be functions of time, but in the versions 1.## of GES only stationary expressions between thevariables are considered.
In Table 1 some common physical variables are listed and it is indicated which variable will be considered to be an effortquantity a which will be taken to be the flow quantity.
Domain Effort Flow Mechanical translation Force F [N] Velocity V [m/s]Mechanical rotation Torque M [Nm] Angular velocity ω [rad/s]Hydraulic Total pressure p [N/m2] Volume flow rate Q [m3/s]
Electric Voltage U [V] Current I [A]
Chemical Chemical potential μ [J/mol] Molar flow [mol/s]
Thermodynamic Temperature T [K] Entropy [W/K]
Thermodynamic (stationary) Specific enthalpy h [J/kg] Mass flow [kg/s]
Table 1 Physical effort and flow variables
A number of comments in Table 1 are in order. First, efforts and flows should not consider to be scalar quantities although avector force F acting on a material point with vector velocity V has an associated scalar power.
If the power flow is split into two variables, the direction of the power flow must still be considered. If two components areconnected, the power flow out of one component is the power flow into the other. The variables are so arranged that, if botheffort and flow have the same sign, the energy flow flows into the component. This is as clearly with conventional notations. Inthe GES notation this is indicated by a half arrow at the end of the connection line. Figure 1 shows an example of the generalmodel structure of the components in GES. In principle all components are identical. They are filled with different functions todescribe a physical system. On each gate only one function is possible. This could be an effort function or a flow function. Tomake a connection it is required that the energy directions of the gates are different, just as the effort and flow functions. GESgives a warning if the user tries to make a connection with wrong conventions.
Figure 1 General model structure in GES
The example in Figure 1 contains four energy components: app1, app2, app3 and app4. In app1 two components are defined:app2 and app4. In app2 is one component: app3. The last component in the path contains the effort and flow functions.Components covering one ore more other components are called in GES mantle components. This example contains twomantle components: app1 and app2. Component app2 and app4 are connected. Component app2 calculates the effort F withfunction f2 and component app4 calculates the flow V with function f3.
In GES the effort text is written in red above the half arrow and the flow text is written in green under the half arrow. If thevariable is a function then the text is written to the end of the half arrow. If the variable is an argument then the text is writtennear the component. For the user defined components it could be that there is no function defined. In that case a black zero iswritten to the end of the arrow.
The import library components have all the effort and flow functions default in memory. With the user defined component it ispossible to make these functions oneself.
Trough this structures in GES it is possible to insert new components or even complete model structures.
GES sorts the functions before they are calculated. The results could be a collection of implicit functions and/or a set of explicitfunctions. See also Solution principles.
GES tries to calculate every function if a calculation is possible. Therefore more than one model can be calculated in one run.For starting a simulation see start.
Signal component
In GES most signal components have one gate. The energy variable flow is used as a signal function value. The signalcomponents have a priority in running. The pre-types are running before the energy components and the post-types are runningafter the energy calculations. Some signal import components have a special priority to run, they are sorted automatically byGES.
If a signal component is connected to an other component the visible connection is made in the origin of the component or onthe connected gate of the component. For instance the epi component in Figure 2. The epi component is connected at theDiesel in the (local) origin of its figure.
Figure 2 Example connection of signal component
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu
Component popup menu
Rename Rename the component
Parameters
Equations
Includes
Inspect state
Command
Mantle
Dismantle
Masked
Locked
Properties
See also Components
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components
ComponentsComponent structure Component types
General
Components
Internal
See also Component popup menu
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components
ComponentsP Distributor flow out
P Distributor effort out
G2 Port
R2 Port
Transformer
Gyrator
Resistance (2 coefficients)
Conduction (2 coefficients)
1 Junction (3 gates)
0 Junction (3 gates)
P constant (flow out)
P constant (effort out)
E constant
F constant
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General
GeneralUser Defined
Quaestor Interface epi
Quaestor Interface epo
Parameter Change set point
Parameter Change param var
From Workspace
To Workspace
Init Gate
Failure Module
Run Component
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal
InternalElectric
Generator
Generator standard (3 coeff.)
Mechanical
Diesel Simple
Diesel Exhaust
Transmission
Hydraulic
Pump (hyd. motor)
Pump (hyd. generator)
Pipe Resistance lambda
Pipe Resistance re
Pipe Resistance CW
Thermodynamic
Fuel
Ideal gas
Maritime
Hull
Propellor (2 coefficients)
Ship Resistance
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > Conduction (2 coefficients)
Conduction (2 coefficients) input output
gate energy variable symbol unit variable symbol unit
0 pos effort e [-] flow f [-]
Table 1 Gate variables Conduction component
The relation for the flow (f) variable is:
f = abs(a0 + a1 . e + a2 . e2 + .... + ai . ei + .... + an . en) sign(e)
The absolute (abs) value of the flow (f) and the sign of the effort (e) are taken into account, because it is assumed that for mostphysical systems the conductance behavior is like a vector. The negative curve is similar to the positive curve.
Parameter(0):Contains the coefficients of the conductance polynomial. The coefficients are in order ao, a1, ai, .., an. Default number is 2. a0, a1are respectively 0, 1.
Parameter(1):Contains the number of coefficients that are actually used. This number is less or equal to the maximum number of coefficients.Default is the number of rows of parameter(0).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > cos
cosFunction cos returns a trigonometric cosine.
Syntax cos(value x)
Remarks x is an angle specified in radians
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > cosh
coshFunction cosh returns a hyperbolic cosine. Syntax cosh(value x)
Remarks x is an angle specified in radians. The hyperbolic cosine COSH (x) gives a similar result as theexpression: 0.5 * (EXP(x) + EXP(-x)).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > Database
DatabaseA great problem in the whole project is the collection of data of components. The GES database of the AES-concept has notthe real structure for flexible data input. To avoid this problem an interface is developed to couple GES to all kinds ofcommercial and private databases. To the user of GES a powerful concept is given to connect quickly to real databasestructures. With a few statements in the GES parser a connection and a selection of data could be made.
1 Database functions
To manage the database the program must open the database, close the database, to select data from the database, to viewthe selected data and to read in the data in the components. The database functions in GES are discussed as follows:
1.1 Open database
A database is an organised collection of related tables. To access data in a table, GES first must gain access to the databasewith a SYS.OPENDASE call, which returns a database handle of the database.
The GES open database function is:
HDB = SYS.OPENDATABASE ‘Alias, User, Password’;
The argument of the function is a string with could contain an alias, username and password. A colon separates the words. Thefunction returns a handle of the open database. The function returns a zero if the database is not opened.
Aliases
An alias is a short name referencing a database. Database references within applications can use alias names, making yourapplications portable.
You can change the definition of an alias at any time by using the BDE Administrator BDEADMIN.EXE. All references to thealias within the application automatically refer to the new definition of the alias.
1.2 Close database
Close database closes a database and all cursors associated with the database handle.
The GES database close function is:
SYS.CLOSEDATABASE(Handle database);
The argument of the function is the handle of the open database.
1.3 Database query’s
To select data from the database two functions in GES are available to search through the database and find a selecting. Thecommon query engine uses a convenient subset of SQL to access dBASE, FoxPro, Access, and Paradox tables. This subsetcan also be used to join server-based SQL tables with these tables. GES used two functions to make a query on the databasewith the SQL language.
The GES query function with dynamical string is:
HRS = SYS.QUERY ‘dynamical query string’
This function is very useful for queries on the database when some parameters are changed depending of the simulation resultunder runtime. If the query succeeds the functions returns a handle of the result set else the function returned a zero.
For getting the results see get database results for getting the data.
Example:
DB = SYS.OPENDATBASE ‘GESDATABASE’;
HB = SYS.QUERY(DB)
‘select diesel from diesels when power > 1000 and power < 2000’;
SYS.CLOSEDATABASE(DB);
This example opens a GES database with alias GESDATABASE. A query is done in table diesels and a selection is made forall diesels in the range 1000 < power < 2000.
The results set is set in handle HB.
If the range of the power is for instance given in parameter(0) and parameter(1) of the GES component the following dynamicalquery string could be used.
‘select diesel from diesels when power > ‘,numtostr(parameter(0)),
‘ and power < ‘,numtostr(parameter(1));
The GES function numtostr is used to convert a value of GES to a string in the query language.
The GES query function with the sql query in a file is:
HRS = SYS.QUERY.FILE ‘filename’
This function is used to execute a prepared query. The query is written in the file. If the query returns a result set, the cursorhandle to the result set is returned into the address given by result HRS. If the query does not generate a result set, thereturned cursor handle is zero. If no cursor handle address is given and a result set would be returned, the result set isdiscarded.
Querying different databases
The application developer can use SQL to join tables from different data sources (for example, a Paradox, InterBase, andSybase table could all participate in a SQL query). These are called "heterogeneous joins." See Local SQL Guide
1.4 Get database result’s
For getting the results given by the handle of the query functions, two function in GES are available. One function to display thewhole results set and one function to get the first result from the results set. Bode function have a dynamical parameter list forestoring the results in the GES variables.
The GES results function with displaying the results in a table is:
Index = SYS.DISPLAY.TABLE (Handle phResult, * , * , ... , * , );
phResult is the handle results pointer of the query. If a selection is made with the cursor in the table the value select is set onthe selected row in the table. By no selection the return value of the function is zero. If a selection is made the arguments of thefunction are filled in with the fields values of the selection. The arguments could be workspace variables, parameters or stringfunctions of GES.
Example of the sys.query.table function:
sys.query.table(rst1,name_component,P_nom,n_nom,U_nom,ID) 'Change AC motor',name_component;
gives for instance the following table:
Table 1 Results of database in table
The arguments by selection a item in the table by double click wood be:
P_nom = 335.565
n_nom = 1000
U_nom = 400
ID = 2484
The name of the component wood be M2CA 400 LKA.
The GES results function for getting the first result from the query is:
Result = SYS.QUERY.RESULTS (Handle phResult, * , * , ... , * , );
PhResults is the handle results pointer of the query. If a selection is found the functions returns a 1 else a zero.
Example:
By using the function sys.query.result instead of the function sys.query.table the results of the example of sys.query.table is byusing the following function:
sys.query.result(rst1,name_component,P_nom,n_nom,U_nom,ID)
P_nom = 264.7235
n_nom = 1000
U_nom = 400
ID = 2482
The name of the component wood be M2CA 400 LKA.
2 Making database alias
For making a database "Alias" for Microsoft Access database one or two programs must be used.
First the "ODBC Data Source Administrator" or "Data Sources (ODBC)"
This program could be find in the Control Panel of your Windows system.
Your database source (for instance: .mdb file) must have a User DSN.
Click on the Tab "User DSN".
Click on "Add".
Choose "Microsoft Access Driver (*.mdb)"
Type in by "Data Source name" (for instance: GES_DATABASE).
Type in a Description (for instance: Ges database).
Click on Select to select your database (for instance: c:\ges\database\GESDatabase2000.mdb).
Click on OK, OK, OK
Your database file (GESDatabase2000.mdb) is connected to the indicated data provider (User DSN = GES_DATABASE).
For making an "Alias" for GES the program bdecfg32.exe of Borland could be used
or BDE administrator
First a driver must be made (or find).
Click on "New ODBC Driver"
Makes a free ODBC_ name (for instance: ODBC_GES).
Choose a driver (for instance: Microsoft Access Driver).
Click on Tab "Aliases".
Click on "New Alias"
Type "New alias name" (for instance: GES_DATABASE).
Choose "Alias type" (must be:ODBC_GES).
Click on OK.
Type by Parameters: "ODBC DSN" the "User DSN" (must be: GES_DATABASE).
Save the configuration.
Ready.
For problems with the configuration file.
The configuration is placed in the default BDE configuration file idapi.cfg.
(For instance: c:\program Files\BORLAND\COMMON FILES\BDE\idapi.cfg
The path is defined in the registry. (Run for instance regedit.exe)
The configuration file used at application startup. The default configuration file is listed in the Windows Registry asCONFIGFILE01.
For example:
HKEY_LOCAL_MACHINE/ SOFTWARE/ BORLAND/ DATABASE ENGINE/CONFIGFILE01/idapi.cfg
//--------------------------------------------------------
Close for configuration GES and other database programs!
//---------------------------------------------------------
2.1 Structure GesDatabase
To develop a logical database structure is out of the scope of this project. For the longer time it is recommended to set the dataof the components in a real database. The most data of the AES library is placed in include files called equation files. Somecomponents needed data from the Access database Gesdatabase.mdb. The structure of this database is discussed in thischapter. The database is very simple and contains flat data tables for some special components. The basis of the database isthe Euclid CEPA 16-EE JP01 Electric propulsion database. This database is extended with data from the AES-project neededfor making GES components. The user can used the database components as an example for connecting components to moresophisticated databases. In practice this wound be a problem, because of the general database language discussed in thischapter.
An overview of the database tables of database GesDatabase.mdb is given in the following figure:
Figure 4 1 GesDatabase.mdb structure
The database contains the tables:
Alternators Contains 4 alternatorscmp_em Contains 5500 AC motors*Diesel Contains 166 dieselsDiesel_AES Contains 800 diesels*Gas_turbines Contains 44 gasturbinesGearboxes_AES Contains 780 gearboxes*Generator Combo Contains a generator combinationLog Contains the names and login time of the databaseManufacturer Contains the manufactures of the componentsMotors Contains 8 motorsPOD Contains 12 POD’s*SFC graph data Contains graphical dataUser name Contains the user names of the database
Table 2 Tables GesDatabase.mdb, marked with * are extended from the AES database
The tables contain fields with data.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Time and date functions > Datetime
DatetimeFunction datetime(x) returns the current date and time to unit x.
Syntax string datetime(value x)
Remarks x is a unit number of a file. The date-time string is 19 characters long. This function is valid from the year 1971 until the year 2070
Example 08-02-1996/09:59:37
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Interface functions > DDE
DDE (Dynamic Data Exchange)GES provides functions that enable GES to access other Windows applications and for other Windows applications to access GES in awide range of contexts. These functions use dynamic data exchange (DDE), software that allows Microsoft Windows applications tocommunicate with each other by exchanging data.
DDE Concepts and TerminologyApplications communicate with each other by establishing a DDE conversation. The application that initiates the conversation is calledthe client. The application that responds to the client application is called the server.
DDE Functions
ddeinit Initiate DDE conversation between GES and another applicationddeexec Send execution string to DDE server applicationddepoke Send data from GES to DDE server application
ddereq Request data from DDE server applicationddeterm Terminate DDE conversation between GES and server application
Using GES As a Client
When a client application initiates a DDE conversation, it must identify two DDE parameters that are defined by the server:
1 The name of the application it intends to have the conversation with, called the service name2 The subject of the conversation, called the topic
When a server application receives a request for a conversation involving a supported topic, it acknowledges the request, establishing aDDE conversation. The combination of a service and a topic identifies a conversation uniquely. The service or topic cannot be changedfor the duration of the conversation, although the service can maintain more than one conversation.
ddeinit Initiate DDE conversation between GES and another application. The DdeConnect function establishes aconversation with a server application that supports the specified service name and topic name pair. If more thanone such server exists, the system selects only one.
Syntax ddeinit 'service, topic'Service A string that specifies the service or application name for the conversation. Every application that can be a DDE
server has a unique service name. The service name is usually the application's executable filename without anyextension. Service names are not case sensitive. Here are some commonly used service names:
The service name for Microsoft Word for Windows is WinWord.The service name for Microsoft Excel is Excel.For the service names of other Windows applications, refer to the application documentation.
Topic A string that specifies the topic for the conversation. The topic defines the subject of a DDE conversation and isusually meaningful to both the client and server applications. Topic names are not case sensitive.
Description ddeinit requires two arguments: a service or application name and a topic for that service. The channel handle isinternal used by GES.
Example ddeinit 'Excel,book1';
ddeexec Send execution string to DDE server application.Syntax ddeexec 'command'
Command String that specifies the command to be executed.Example ddeexec '[formula.goto("r1c1")]' ddepoke Send data from GES to DDE server applicationSyntax ddepoke (data) 'item'
Data A variable that contains the data to be sent.Item String that specifies the DDE item for the data sent. item is the server data entity that is
to contain the data sent in the data argument.Example ddepoke(5) 'r1c1'
ddereq Request data from DDE server application.Syntax data = ddereq 'item'Data A value that contains the requested data, zero if the function call failed.Item A string that specifies the server application's DDE item name for the data requested.Example data = ddereq 'r1c1' ddeterm Terminate DDE conversation between GES and server application ddeterm takes the internal channel handle
generated by the previous call to ddeinit that established the DDE conversation.Syntax ddeterm
[Go to top of page]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Diagram
Diagram
Component Show name Display the name of a component in the diagram.
3D View Show reference axis Display the reference axis in the diagram.
3D Actions Key actions
Font Change the font type used in the diagram.
Gate Show effort name Display the names of each effort in the diagram.Show flow name Display the names of each flow in the diagram.Show index Display the index of the signals in the diagram.Show order Display the the order of caculations.Bondgraph style Display the signals according the Bondgraph method.Show causal tip Display a line to indicate a causal relationship.
Drag bmp figure
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
HomHome > GES User Interface > Diagram > Diagram popup menu
Diagram popup menu
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Diesel Exhaust
Diesel Exhaust input output
gate energy variable symbol unit variable symbol unit
0 neg effort M [Nm] flow ω [rad/s]
1 pos e [kJ/kg] flow NOx [g/s]
2 pos e [kJ/kg] flow HC [g/s]
3 pos e [kJ/kg] flow CO [g/s]
4 pos e [kJ/kg] flow SO2 [g/s]
5 pos e [kJ/kg] flow CO2 [g/s]
6 neg effort h [kJ/kg] flow dm/dt [g/s]
7 neg flow O2 [g/s]
8 neg flow N2 [g/s]
9 neg flow H2O [g/s]
10 pos flow AIR [g/s] effort e [kJ/kg]
[11] neg e [kJ/kg] flow [PM] [g/s]
Table 1 Gate variables Diesel exhaust
Gate 11 is optional for calculation of PM related to unburned HC. Add gate 11 by selecting Properties->Gates->Add
Edit parameter(8) HC-ratio values >1 are treated as PM (unburned HC), so HC is divided over gate 2 and 11
For the description of this component see User's Guide version 1.05 reference [2].
The diesel_exhaust component replaced the diesel_emissie component of GES version 1.00.
The parameter list of the diesel_exhaust component is:
Parameter(0): Diesel exhaustActual speed of the diesel engine.
Parameter(1):Nominal speed of the diesel engine.
Parameter(2):Minimum speed limit.
Parameter(3):Nominal power.
Parameter(4):Percentage carbon in fuel.
Parameter(5):Percentage hydrogen in fuel.
Parameter(6):Percentage sulfur in fuel.
Parameter(7):A matrix that contains the aspect values of the diesel engine.
matrix[0][0]: nominal fuel consumption [kg/h]
matrix[1][0]: nominal emission ratio NOx [g/kg fuel]
matrix[2][0]: nominal emission ratio HC [g/kg fuel]
matrix[3][0]: nominal emission ratio CO [g/kg fuel]
Parameter(8):Is a matrix that contains calculation values.
matrix[0][0]: equivalence ratio [-]. If gate 10 is not connected this value is an input parameter. The air flow is automaticallycalculated.
Default value is 2.;input value
matrix[1][0]: HC-ratio [-] Default value is 2.; input value: value >1 unburned HC; add gate 11 for PM //after ges version 15/06/2015
matrix[2][0]: fuel consumption [kg/h]
matrix[3][0]: emission ratio NOx [g/kg fuel]
matrix[4][0]: emission ratio HC [g/kg fuel]
matrix[5][0]: emission ratio CO [g/kg fuel]
matrix[6][0]: emission ratio SO2 [g/kg fuel]
matrix[7][0]: emission ratio CO2 [g/kg fuel]
matrix[8][0]: emission ratio O2 [g/kg fuel]
matrix[9][0]: emission ratio N2 [g/kg fuel]
matrix[10][0]: emission ratio H2O [g/kg fuel]
matrix[11][0] LCV Low Calorific Value [kJ/kg] used for correction of fuel consumption. default value 42780 kJ/kg; input value
Remark 1:The results of the program Mossel are set in the file GESEM.DAT in the startup directory of Mossel. With the program Mos_ges.exethe results from the file GESEM.DAT are translated to a GES parameter format. The results are set in the file MOSSEL.PAR youcan read this file, by pressing on <Read file> button in the parameter list.
It is recommended to start the program Mossel from GES tools, because the program is started by a batch file Mossel.bat. See"Mossel".
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Diesel Simple
Diesel Simple input output
gate energy variable symbol unit variable symbol unit
0 neg effort M [Nm] flow ω [rad/s]
1 pos effort h [kJ/kg] flow dm/dt [g/s]
Table 1 Gate variables Diesel simple
This component describes a simple diesel engine with constant torque over a wide speed range. The power equation of this engineis:
T is the engine torque [Nm]
ω is the actual speed [rad/s]
h is the enthalpy of the fuel [J/kg]
is the mass flow of the fuel [g/s]
η is the efficiency [-]
Figure 1 Torque speed characteristics of the diesel engine
For this model we assume that the efficiency h over the speed range is constant. The minimum and maximum speed of the dieselengine is not taken into account.
Parameter(0):The actual speed of the diesel engine in rad/s.
Parameter(1):The fuel consumption of the diesel engine in g/kWh.
Example: You could also create this component with the user defined component. The parser equations for this simple model are:
//gate(0)is fuel input power, e_gate(0)=h, f_gate(0)= mass //flow
//gate(1)is mechanical output power ; e_gate(1)=T,f_gate(1)=w
//parameter(0) is actual speed in rad/s
//parameter(1) is fuel consumption in g/kWh
neg_gate(1);
f_gate(1) = parameter(0); //actual speed [rad/s]
f_gate(0) = e_gate(1) * parameter(0) * parameter(1) / 36e5; //fuel mass flow[g/s]
See u-diesel component in model ges\examples\u_diesel.mod.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > nr_gates
#dimgateFunction #dimgate is constant function that returns the gate dimension of the gate. Syntax #dimgate(gate number);
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Directives
Directives#if#else #endif #stop #date #messagebox
Directives specify the flow of control as the code is parsed. Directives are not executed.
The #if directive has the following pattern:
#if number/value Logical operator number/value
#if -statement
#else
#else-statement
#endif
#stop statement stop parsing equations
#date constant of time in yearmonth so 2009 month 3 is #date 200903
The logical operator is the equal sign ==
The expression is direct evaluated. If the value is exactly zero the expression is false, otherwise it is true.
If there is no #else directive and the expression is true the #if -statement is executed; otherwise the if-statement is ignored.
If the optional #else else-statement is present and the expression is true the if-statement is executed; otherwise the #if -statement is ignored and the #else -statement is executed.
GES does not have a specific Boolean data type. Only the equal expression can play a Boolean role in conditional tests.
Example 1:
a=10;
#if nr_gates==2 f_gate(0)=7*a;
f_gate(1)=9;
#else f_gate(0)=9*a;
#endif
If the number of gates is 2 the two equations of the gates are set else only the equation of gate 0.
Example 2:
#if #date <200908#messagebox"Your time is expiredPlease contact your vendor,",name_component;
#stop #endif
[Go to top of page]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > diss_component
diss_componentFunction diss_component returns the dissipated energy of the component. Syntax diss_component
Remarks Valid for models made with version 1.08 and lower. Example dissipation = diss_component;
post_function;Calculation of the dissipation of the component. The result is set in the local variable dissipation.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library
Dynamic libraryDynamic first principle models.
PD - controllerPID- controllerFirst orden-orde filterFourierRMSTotal Harmonic DistorsionMean valueeffort of flow delay line3 Phase sinus generator3 Phase PWM inverterSynchrounous motorAsynchrounous motor
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Dynamic functions
Dynamic functionsIntegral
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library
Dynamic libraryDynamic first principle models.
PD - controllerPID- controllerFirst order filtern-th order filterFourierRMSTotal Harmonic DistorsionMean valueeffort-flow delay line3 Phase sinus generator3 Phase PWM inverterSynchronous motorAsynchronous motor
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > E constant
E constant input output
gate energy variable symbol unit variable symbol unit
0 neg no f [-] effort e [-]
Table 1 Gate variables E constant component
The E constant component delivers a constant effort value.
Parameter(0):Contains the constant effort value of the component. The default value is 1.
Example:An E constant component created by a user defined component. The number of gates and the number of parameters must be 1.
//parameter(0) = constant effort value
parameter_name(0) 'constant';
e_gate(0) = parameter(0);
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > e_append_gate
e_append_gateFunction e_append_gate returns the dissipated energy of the component.
The e_append_gate.first function is an assignment function and appends the equations to the end of the alreadyloaded internal of user defined gate equations of the ges component.
The arguments of the gate function is are extended with the defined e_gate or f_gate functions in the appendedgate definition.
Syntax e_append_gate (gate number) = expression; Example definition of e_append_gate(0) of the user defined component
c=22; e_gate(0)=c; a=10; b=20*e_gate(0); e_append_gate(0)=a+b;
results is 450
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > e_gate
e_gateFunction e_gate returns or sets the effort gate value of an apparatus.returns or sets the effort gate value of an apparatus. Syntax e_gate (value x)
Remarks x is truncated (behind the decimal point) and is a number of the apparatus. The function is notexecuted if the gate number is not present
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component initialisation functions > e_name_gate
e_name_gateFunction e_name_gate sets the effort name for a gate.
Syntax e_name_gate(value x) ‘string’
Remarks x is truncated (behind the decimal point) and is the gate number of the apparatus. The functionis not executed if the gate number is not present. The first gate number starts with 0,.....,etc. The string canbe 64k characters long. For the name only the first 30 characters of the string will be used.
If this function is not used, the default string is ‘e’.
The name can also be set in the properties mode
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component initialisation functions > e_unit_gate
e_unit_gateFunction e_unit_gate sets the effort unit name for a gate.
Syntax e_unit_gate(value x) ‘string’
Remarks x is truncated (behind the decimal point) and is the gate number of the apparatus. The functionis not executed if the gate number is not present. The first gate number starts with 0,.....,etc. The string canbe 64k characters long. For the name only the first 10 characters of the string will be used.
If this function is not used, the default string is ‘[-]’. Example Set the unit of the mechanical effort of gate 3 with name [Nm].
e_unit_gate(3) ‘[Nm]’;
This name can also be set in the edit gate mode. See Edit menu in User's Guide.
See also: unit_gate
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > e_value
e_valueFunction e_value returns or sets the effort gate value of an component Syntax e_value (value x)
Remarks This function is the same as e_gate, but if used on the left side of a function the parser does not include the effortin the list of gate functions that must be solved. x is truncated (behind the decimal point) and is a number of theapparatus. The function is not executed if the gate number is not present.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu > Parameters
Parameters The following dialog box is displayed. The last nine parameters are showed.
As an example the Diesel Exhaust component is chosen.
The File menu contains the following:
Open: The parameter list can be imported by a CSV-format (Microsoft Excel) file.
Save as: The parameter list can be saved as CSV-format (Microsoft Excel) file.
The Edit menu contains the following:
Add parameter: Adds a new parameter at the bottom of the list.
Change number parameters: changing the number of total parameters in the list.
If the value of a parameter is a matrix, the matrix can be visualized by double clicking on the value matrix[ ][ ]
The values in this matrix can also be imported and exported in CSV-format file by using the buttons accordingly.
If you want to add a matrix parameter you must first add a normal parameter. With the Equations (at the right mouse clickmenu) the parser of the component is started. Than you must insert the init_matrix function into the parser string of thecomponent. The parser of GES executes this function.
TNO Structural Dynamics Van Mourik Broekmanweg 6 Send mail to Helpdesk with questions or comments.
www.tno.nl/ges P.O. Box 49, 2600 AA Delft, The Netherlands Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > eff_component
eff_componentFunction eff_component returns the efficiency of the component. Syntax eff_component
Remarks Valid for models made with version 1.08 and lower. Example efficiency = eff_component;
post_function;
Calculation of the efficiency of the component. The result is set in the local variable efficiency.
The efficiency is defined as:
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Solution process > Effort and Flow iteration
Effort and Flow iterationWith the radio buttons, in the solution process tab of the options-window you can choose whether GES first searches for a flowor an effort function at the iteration equations. For instance if the equations for iteration are e1=g1(f2) and f2=g2(e1,constant). The function in the flow based mode is:f2=g2(g1(f2),constant). e1 in this mode is calculated directly.
In the effort base mode the iteration function is: e1=g1(g2(e1,constant)). In this mode e1 is solved by iteration and f2 iscalculated directly.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > effort-flow delay line
effort-flow delay lineThe delay line delays the flow signal by the time given in parameter(0).
Parameters Parameter(0): delay time in seconds
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > end_function
end_functionFunction END FUNCTION defines functions to be executed after the end of the calculation and is only used ones. Syntax end_function;
<GES source code block>end_function;
Remarks This function is used to as a delimiter in the source code. All function before this delimiter and after anotherdelimiter, if present, are executed after the calculation at the end.The function is very useful for plotting results andwriting variable to files at the end of the simulation.
This function could also be used as a normal function. The syntax is:
end_function{<GES source code block>}
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > Energetic System
Energetic SystemA system is a set of elements with mutual relationships that does or does not have a relationship with the environment. Arelationship is defined as a change in the properties of one element causing a change in the properties of another element andthe environment is everything except the system itself. It is hard to determine the complete environment and therefore it iseasier to determine the relevant environment. The relative environment consists of systems that have direct or indirectrelationships with elements in the system. The amount of elements in the relative environment is based on the thoroughness ofthe system description.
At an integrated systems approach a variety of energy systems can be involved. Therefore a general method of systemdescription is needed to be able to describe all energy systems.
The bond graph method considers the technical system energetically. The method creates a model of the real system. Itpresumes energy flows in the system consisting of sources, buffers, transmitting or dissipating elements. This method presentsthe transport between the elements as power. The method can be used for both static as dynamic systems where the dynamicsystems have the possibility to buffer energy.
Read the entire chapter on energetic systems in the manual, chapter 3 energetic system.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > Energetic System
Energetic SystemPrefaceGraphical modelVariablesIdeal elementsBasic 1-gate elementsBasic 2-gate elementsBasic 3-gate elementsJunctionsCoordinate transformationsConnecting elementsComputational problemsDescription of the complete system
Preface [top]
A system is a set of elements with mutual relationships that does or does not have a relationship with the environment. A relationship isdefined as a change in the properties of one element causing a change in the properties of another element and the environment iseverything except the system itself. It is hard to determine the complete environment and therefore it is easier to determine the relevantenvironment. The relative environment consists of systems that have direct or indirect relationships with elements in the system. Theamount of elements in the relative environment is based on the thoroughness of the system description.
At an integrated systems approach a variety of energy systems can be involved. Therefore a general method of system description isneeded to be able to describe all energy systems.
The bond graph method considers the technical system energetically. The method creates a model of the real system. It presumesenergy flows in the system consisting of sources, buffers, transmitting or dissipating elements. This method presents the transportbetween the elements as power. The method can be used for both static as dynamic systems where the dynamic systems have thepossibility to buffer energy.
Graphical model [top]
Before we can graphically present energy systems, we first need to define how to present the systems. Since we use the power as thetransfer between the elements the element are connected with half arrows instead of complete arrows. This is done because completearrows are used for the transfer of information. GES does not use complete arrows at all since the transfer of information can be doneusing a power arrow with calculated power equal to zero.
1. A power bond
The power arrow indicates the direction of the positive energy direction. This simple approach makes it possible to visualize the energystreams.
Figure 2 presents an example of the energy flows of a propulsion system.
2. Example of the energy flows of a ship propulsion system
The chemical energy present in the fuel is transformed into rotational energy by the engine. This rotational energy is transferred to thepropeller by the transmission. The propeller then transforms the rotational energy into translational energy which is used to overcome theresistance of the hull. Using this method, it is easy to add or split components to describe a detailed system using energy streams.
The energy stream exiting from one component is the input of another component. The stream is presented by a half arrow and is alsocalled gate.
For each component there is a system boundary. In this case, the boundary is formed by the energy streams. The efficiency of acomponent is defined as:
total energy out/total energy in
For systems with only one power gate (1-gate) no physical efficiency is defined. When the efficiency of a 1-gate is concerned, e.g. abattery, the other relevant energy streams (such as chemical) are kept within the component boundaries When all efficiencies are known,the efficiency of the 1-gates can be calculated.
For example the ship resistance of Figure 2 is calculated:
Pship= (Pship⁄Ptransmission )*(Ptransmission⁄Pdiesel engine ) *(Pdiesel engine⁄Pfuel ) *Pfuel
With the definition:
The dissipation of energy inside a component is given by:
Total power in – Total power out
Variables [top]
Working with the efficiency of the components does not provide quantitative analysis of system behaviour. The concept of energy flow isused only to define the system boundary of the component. The choice of the bindings between the components of the general system iscommon because the energy flow of a port for each energy system can be described with two variables. These two variables aregenerally measurable. To be able to use the same method for all components, these two variables are effort (e) and flow (f). Bothvariables, effort and flow, are used in the bond graph method. The variables used for effort are force-like and the variables used for floware stream-like. The product of the effort and the flow is the power (P) of the gate of a component.
Domain Effort Flow Mechanical translation Force F [N] Velocity V [m/s]Mechanical rotation Torque M [Nm] Angular velocity w [rad/s]Hydraulic Total pressure p [N/m 2 ] Volume flow rate Q [m3/s]
Electric Voltage U [V] Current I [A]
Chemical Chemical potential m [J/mol] Molar flow [mol/s]
Thermodynamic Specific enthalpy h [K] Entropy [W/K]
Thermodynamic (stationary) Temperature T [J/kg] Mass flow [kg/s]
Effort and flow variables
In different domains, the power gate can be represented by a pair of two variables. Independent of the domain, the pair of two variablesis graphically represented by:
3. Definition of effort and flow variables at the half arrow
The effort is displayed above the half arrow and the flow is displayed below the half arrow.
The propulsion system, used as an example above, presented with the effort and flow for each bond is given in Figure 4.
4. Effort and flow variables at the ship propulsion
The power from the fuel is the product of enthalpy (h) and mass flow rate (dm / dt). The power the diesel engine generates is torque (M)times rpm (ω). This also applies for the transmission. The power the propeller produces is the thrust (F) times ship speed (v). All lossesare within the boundaries of the system components. These losses can be transferred to the boundary of the system using a pair of effortand flow variables.
This method provides a way to systematically fill up the power bonds in the system with the effort and flow variables. The power of thebonds is now given by effort * flow.
For the description of the system, it is necessary to describe the variables using formulas. These formulas must have a physical basis. Ifa pair of variables for a flow of energy through a component is described then the energy flow is no longer dependent on the coupledsystem. Only one variable can be calculated at each gate. The convention how to display which variable is prescribed by a function isgiven in Figure 5.
5. Definitions of the effort and flow functions
Thus, the variable at the end of the line must be calculated by the component. The variable next to the component is used as the inputfor that component. The half arrow indicates the direction of the power. If the product of effort and flow is positiDeve, then the direction ofthe arrow has to match the direction of the power. The direction is dependent on the components used. The direction of the arrow iscommonly chosen in the direction the power is physically meant to go. A power consuming element will have an arrow pointing towards itwhere a power producing element has an arrow pointing away from the element. When the product between the effort and flow isnegative, then the direction of the power is opposite to the original intended direction of the power. One of the benefits of this system isthat errors in the system are noticed at a glance. The next paragraphs will give a more detailed description of the elements.
Ideal elements [top]
Ideal elements can be categorized and then generalized by their behaviour the same way the variables for the power bonds weregeneralized to effort and flow. An overview of the generalized elements is given in Table 2. These elements are grouped based on theirbehaviour in five different groups: sources, dissipaters, transformers, junctions and buffers.
Basic 1-gate elements [top]
Ideal physical element with only one physical property.
ResistanceA simple 1-gate resistance is an element with the effort variable given as a static function of the flow variable. The bond graphpresentation and a graphical presentation of a resistance that could be used in various systems are given in Figure 6. Generally,resistances dissipate energy from the system. This is valid for simple electrical resistances or mechanical dampers. As can be seen inFigure 6, the power is delivered to the resistance if the product of effort and flow is positive. If the description of the resistance aspresented in Figure 6 is within the first and third quarter, the power bond will be positive. If the relation between the effort and flow is notlinear, the element is called a non-linear element. If the relation is linear, the inverse resistance is the conduction. If, for passiveresistances, the linear parameter is of positive type, the power bond is drawn towards the resistance.
6. a) Bondgraph presentation of a resistance b) resistance curve
SourceThe resistance element can also be used to generate power instead of dissipating it. In that case, the power bond connected to theelement must be drawn in the opposite direction. For example take a look at the torque-speed characteristic of a diesel engine. Thecharacteristic of non-passive resistance is in the first quarter. The power of the power bond is positive if the element generates power.The first and third quarter correspond to the generation of power while the second and fourth quarter correspond to the dissipation ofpower. The first quarter of a basic model of a source is given in Figure 7.
7. a) Bondgraph source model b) example source characteristics
The intersection of the source characteristic with the effort and flow axis corresponds to zero power. In practice, these intersections havea special meaning.
Energy sourcesElements that add power to the system are called sources. We distinguish:
Ideal e-source and f-source: An ideal source has an independent effort or flow variable
Effort-source: This source has an independent e-variable. This means that there is no coupling between the effort and the flow.
Examples: Electric → Shore power Thermodynamic → Enthalpy
Ideal sources with internal resistance
8. Simple example of a battery
Ri is the internal resistance E is the source voltage Ua is the clamp voltage ia is the current
Dissipaters
Resistance characteristic
e0 = R * f0
for example simplified quadratic ship resistance → e0 = Cf * f0 * abs(f0)
Controllable resistance
It is assumed that changing the resistance of the element does not use power. If it does need power to change the characteristics, weneed another method to describe the element. In that case, a method that could be used to describe the element is the signal gateinstead of the power gate. For example the effort, resulting in a zero-flow. The power, the product of effort and flow, is zero which ischaracteristic for a signal.
9. Controllable resistance
Basic 2-gate elements [top]
There are many 2-gate elements. In this section only the 2-gate elements that cannot be created out of 1-gate elements will bediscussed. These elements are ideal transformers with an equal amount of generated and dissipated power. The basic element is givenin Figure 10.
10. Ideal transformer
With: Equation 1
Beside this relation, there is only one dependency between a variable of one gate with a variable of another gate.
TransformerAn element is called transformer if increasing one effort variable causes the effort variable at the other gate to increase as well. If thedependency between those effort variables is fixed Equation 2 describes the dependency of the flows as well.
11. Basic transformer
Suppose:
Equation 2
The variable m is called the transformation modulus
With Equation 1 and Equation 2:
Equation 3
In case the transformation modulus m is a variable, the transformer is called a controlled transformer Changing the value of m cannot
consume any power. Therefore, the variable can be controlled using a signal. Thus either the effort or the flow is equal to zero.
12. Basic controlled transformer
In this example the generated power is equal to e1*f1 and the dissipated power is equal to e2*f2. One such element cannot calculateboth variables of one gate. If this element calculates one variable of the gate, another bonded element must calculate the other variable.If no such element exists, there is a causal conflict. In that case one better describes the element with e2 as a function of e1.
13. Basic transformer models flow in flow out and effort in effort out
Two transformers in series will result in one transformer.
GyratorAn element is called a gyrator when changing one effort variable causes the flow variable of the other gate to change. If the relationbetween those variables is known, then the relation between the other variables is also known due to Equation 2.
14. Gyrator model
If for a gyrator:
Equation 4
Then
Equation 5
The gyrator ratio m can be a constant or variable. If the gyrator ratio is variable, the gyrator is called a modulated gyrator. Incorrespondence with the controlled transformer, the variable m can be controlled using a signal. Due to causality, two configurations ofthe gyrator can be made. These configurations are shown in Figure 15.
15. Basic gyrator flow in effort out and effort in flow out
Two gyrators in series form a transformer. See Figure 16:
16. Two Gyrators in series
The gyrator is a more fundamental element than the transformer since two gyrators in series are equivalent to one transformer.Therefore, the gyrator is a necessary element.
A gyrator is often used in system descriptions when energy is converted from one type to another (e.g. from electrical to mechanical orfrom rotational mechanical to mechanical translational)
Basic 3-gate elements [top]
For these elements: P1 + P2 + P3 = 0 e1 f1 + e2 f2 + e3 f3 = 0
Three gate transformerThe operation of a three gate transformer is based on the principal of merging and splitting the power bonds through the gates.Belonging to this class:
• Electric transformers with 3 inductors• Hydrostatic coupled machinery • Controlled lever (see Figure 17) • Planetary transmission
17. Controlled lever
For x3 = 0: f1 = (a+b)/b f2 For x2 = 0: f1 = -a/b f3
According to the superposition principle due to linearity:
Equation 6
From the equilibrium of forces:
e2=-(a+b)/b=1+n13 e3=a/b e1
with:
n12 = (a+b)/b = 1 + n13 n13 = a/b
the transformation matrix becomes:
The energetic model is given in Figure 18.
18. Energetic model
All three gates have a positive energy bond towards the gate because there is no dissipation:
Check this by creating a transfer matrix.
Applications of the three gate transformers are: Differential in a car, pulley of crane, lever, hydraulic servo controller.
Junctions [top]
The elements can be energetically connected to each other using junctions. In this case we consider a lossless connection with morethan two bonds.
19. Lossless junction
Figure 19 shows a random lossless junction with N+M bonds. The half arrow pointing towards the junction means power is definedtowards the junction while pointing away from the junction means the power is defined away from the junction.
The sum of all bonds towards the junction has to be equal to the sum of all bonds away from the junction. For N incoming bonds and Moutgoing bonds:
Equation 7
In case the power in one of the calculated bonds is negative, the direction of the power flow is in the opposite direction.
Since we do not calculate with the variable power but for the variables effort and flow:
Equation 8
0-JunctionAll effort values for a 0-juntion are equal for all effort variables. A graphical presentation of a 0-junction is given in Figure 20.
20. 0-junction
Since the 0-junction is lossless, we use Equation 8. We already knew: e1 = e2 = e3 = … = eN+M.
The equation for the flows then becomes:
Equation 9
Because all effort values are equal, computationally it comes down to one gate defining the effort value and thus prescribing the value forthe other gates. The decision which gate will define the effort value is dependent on the rest of the elements connected to the 0-junction.For the gate defining the effort, the value for the flow has to be calculated with Equation 9. E.g. if e_in2 defines the effort:
e_out1 = e_out2 = … = e_outM = e_in1 = e_in3 = … = e_in2 Equation 10
The flow in f_in2 is then calculated using:
Equation 11
Using the same procedure, any f_out can be calculated.
These junctions are applied where two or more elements have the same effort variables.
One can recognize Kirchhoff’s law for junctions in electrical systems.
If more than one element supplies a value for the effort to a 0-junction there will be causal conflict which creates an insolvable system.The only way to solve the conflict is by changing the system. For more information see causal element.
1-JunctionThe same rules apply for a 1-junction as for a 0-junction. Only now the flow is equal for all joints and the effort is unknown. A 1-junction isgiven in Figure 21.
21. 1-Junction
Based on the bonds in Figure 21:
Pin1 + Pin2 + Pin3 + PinN = Pout1 + … + PoutM
Since all flow variables have the same value:
e_in1 + e_in2 + e_in3 + e_inN = e_out1 + … + e_outM
The effort value is calculated for the gate that defines the flow value for all gates.
Suppose:
f_in1 = f_in2 = f_in3 = f_inN = f_out1 = … = f_outM
Then f_outM defines the flow for all bonds. The effort value for this bond will be:
e_outM = e_in1 + e_in2 + e_in3 + e_inN - e_out1
The 1-junction corresponds to Kirchhoff’s voltage law for electrical systems and to equilibrium of forces for mechanical systems. Thesejunctions are applied where two or more elements have the same flow variable.
Coordinate transformations
test
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Getting started > Error
Error
Error catching
During simulation there is no error catching in GES for most parser functions. GES can terminate with a wrong number.
To continue with calculations GES catches some errors by the following rules:
Divisions by zero give a huge value. In GES this value is +-INF. If the exponent of a power is not a real and the base is less than 0, the exponent is rounded off behind the decimal point.
Error message
If there is a calculation error encountered, the global system variable !!error is set to 1 and the calculation process is stopped.The error message is written in the list box of the start simulation dialog box. The error message is also written in the log file.The user can set the system error variable with the user defined component, however the calculation process is not stopped.
If a foreground calculation process is started the error variable is set to 0. This holds for every step.
By a background calculation process the error variable is also set to 0.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > eval_matlab
eval_matlabFunction eval_matlab evaluated matlab code in Matlab Syntax eval_matlab'string';
Remarks The string must contain matlab code with is evaluated in MATLAB.
Example eval_matlab 'cd ',$(MODEL); //set workdirectory in matlab
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > exp
expFunction exp returns ex. Syntax exp(value x)
Remarks exp calculates e to the power of x. e is the base of the natural logarithm, approximately 2.718282.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Expressions
ExpressionsOperators Exponential operators Additive operators Multiplicative operatorsRelational operators Equality operators Assignment operators Expression operators
An expression is a sequence of operators, operands, and punctuators that specifies a computation. The formal syntax, listed inExpression, indicates that expressions can be defined recursively; sub expressions can be nested without formal limit.(However, the compiler will not report an out-of-memory error if it can not compile an expression that is too complex.)
Operators
Symbol Description+ plus sign or add- minus sign or subtraction* multiply/ divide^ exponential operator| or operator& and operator< less than> greater than<= less than or equal to>= greater than or equal to== equal to!= not equal to= assignment( ) expression prioritizing or function call, sequential expression‘ ‘ string call// start comment to end of line/* start comment to */*/ end comment from /*! mark for global variables!! mark for system variables!!! mark fore external variables; expression separator
Table 1 Parser operators
Exponential operators
There is one exponential operator: ^.
For the syntax see Exponential expression.
Example:
a = 3 ^ -2;
[top]
Additive operators
There are two additive operators: + and -
For the syntax see: additive expression.
Example:
a = a + b;
[top]
Multiplicative operators
There are two multiplicative operators: * and /
See for the syntax: multiplicative expression.
Example:
a = a / b;
[top]
Relational operators
There are four relational operators: < > <= >=.
For the syntax see: Relational expression.
The expression E1 < E2 gives a 1 (true) if the evaluated expression E1 is less than E2 else the value is 0 (false).
Example:
if (a < 0) a = 0;
[top]
Equality operators
There are two equality operators: == and !=
For the syntax see: Equality expression.
Example:
if (a == 10) a = 0;
[top]
Assignment operators
There is one assignment operator: =
For the syntax see: Assignment expression.
In de expression E1 = E2 must E1 be a modifiable leftvalue (unary expression). The value of E2, after conversion to the type ofE1, is stored in the object designated by E1 (replacing E1's previous value). The value of the assignment expression E2 is notitself an leftvalue. If E2 is an unary expression to then a recursive assignment is possible.
Example:
a = b = c = 20 ^ 3 + 3;
[top]
Expression operators
An expression starts with the assignment expression.
For the syntax see: Expression.
[Go to top of page]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > f_append_gate.first
f_append_gate.firstFunction f_append_gate returns the dissipated energy of the component.
The f_append_gate.first function is an assignment function and appends the equations to the begin of the alreadyloaded internal gate equations of the internal ges component.
The arguments of the gate function is are extended with the defined e_gate or f_gate functions in the appendedgate definition.
Syntax f_append_gate.first (gate number) = expression;
Example definition of f_append_gate.first (0) of the internal exhaust diesel model
loadpecentage = p_gate(0)/parameter(3)/1000*100;matrix(7,0,0) = NFC = linint1d(loadpecentage,Aspects,1)*p_gate(0)/1000/1000*1.03; //FC g/h * 3% for normalconsumptionmatrix(7,1,0) = linint1d(loadpecentage,Aspects,2)/NFC*p_gate(0)/1000; //NOx nominal emission ratio [g/kg fuel]matrix(7,2,0) = linint1d(loadpecentage,Aspects,4)/NFC*p_gate(0)/1000; //HC nominal emission ratio [g/kg fuel]matrix(7,3,0) = linint1d(loadpecentage,Aspects,3)/NFC*p_gate(0)/1000; //CO nominal emission ratio [g/kg fuel]f_append_gate.first(6)=f_value(0); //this function is execute before an internal gate function
This function udates the fuel consumption depended on the load of the engine. So some parameters of theinternal ges model are updated
After the update the normal internal gate equation is calculated.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > F constant
F constant input output
gate energy variable symbol unit variable symbol unit
0 neg no e [-] flow f [-]
Table 1 Gate variables F constant component
The F constant component delivers a constant flow value.
Parameter(0):Contains the constant flow value of the component. The default value is 1.
Example:Example of a F constant component created by a user defined component.
//parameter(0) = constant flow value
f_gate(0) = parameter(0);
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > e_append_gate
f_append_gateFunction f_append_gate returns the dissipated energy of the component.
The f_append_gate.first function is an assignment function and appends the equations to the end of the alreadyloaded internal of user defined gate equations of the ges component.
The arguments of the gate function is are extended with the defined e_gate or f_gate functions in the appendedgate definition.
Syntax f_append_gate (gate number) = expression; Example definition of f_append_gate(0) of the user defined component
c=22; e_gate(0)=c; a=10; b=20*e_gate(0); f_append_gate(0)=a+b;
results is 450
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > f_gate
f_gateFunction f_gate returns or sets the flow gate value of an component. Syntax f_gate(value x)
Remarks x is truncated (behind the decimal point) and is a gate number of the apparatus. The function is not executed if thegate number is not present.
Example
Set gate 3 with flow value 9:f_gate(3) = 9
Get flow value of gate 5 and put this in the global workspace variable !a:!a = f_gate(5)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component initialisation functions > f_name_gate
f_name_gateFunction f_name_gate sets the flow name for a gate.
Syntax f_name_gate(value x) ‘string’
Remarks The truncated (behind the decimal point) x value is the gate number of the apparatus. The function is notexecuted if the gate number is not present. The first gate number starts with 0,.....,etc. The string can be 64kcharacters. For the name only the first 30 characters of the string will be used.
If this function is not used the default string is ‘f’.
The name can also be set in the properties mode.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > > Component initialisation functions > f_unit_gate
f_unit_gateFunction F_UNIT_GATE sets the unit flow name for a gate.
Syntax F_UNIT_GATE(value x) ‘string’
Remarks x is truncated (behind the decimal point) and is the gate number of the apparatus. The functionis not executed if the gate number is not present. The first gate number starts with 0,.....,etc. The string canbe 64k characters long. For the name only the first 10 characters of the string will be used.
If this function is not used the default string is ‘[-]’. Example Set the unit of the mechanical flow of gate 3 with name [rad/s].
f_unit_gate(3) ‘[rad/s]’;
This name can also be set in the edit gate mode. See Edit menu in User's Guide.see also: unit_gate
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > f_value
f_valueFunction f_value returns or sets the flow gate value of a component. Syntax f_value(value x)
Remarks This function is the same as f_gate, but if used on the left side of a function the parser does not include the effortin the list of gate functions that must be solved. x is truncated (behind the decimal point) and is a number of theapparatus. The function is not executed if the gate number is not present.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > fac
facFunction fac returns the faculty x!. Syntax fac(value x)
Remarks fac calculates x!=1*2*3*…..*n.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Failure Module
Failure Module input output
gate energy variable symbol unit variable symbol unit
0 no no F [-] signal - [-]
Table 1 Gate variables failure module
The failure module is a signal type component and is executed after the calculation of the energy components. This makes itpossible to change the probability failure values during the energy calculation. So a probability variable can be a function of an effortand or a flow variable.
For more complex failure analisys it is also possible to build your own Markov process.
The parameter list of the failure module is:
Parameter(0): (output value)Result of the calculation is placed in the value field.
Parameter(1): (input string)The failure module calculates with the probability variable string given in the value field. The variable name is the expected localworkspace variable that is used as the probability variable in the components.
Parameter(2): (output value)Structure error: If the connections of the components are not correct to calculate the probability an 1 is set into the value fieldand name of the wrong connected component is set in the unit field.
Parameter(3): (output value)Calculation error: If by calculation the probability result is greater than 1 the calculation is stopped and an 1 is set into the valuefield. The name of the last calculated component is set in the unit field.
Parameter(4): (input value)Calculation method:
Type 0: Simple fault treeType 1: Serial fault tree (Lambda)Type 2: MTBF (mean time between failure)Type 3: Reliability RType 4: Unreliability QType 5: Very simple fault tree
Simple fault tree
Choose Reliability variable in component: for instance RValue parameter 4 is 3
The following examples will show the different types of fault trees using type 0 to 4. These examples are also shown in thisGES model. For a more detailed explaination of the failure module see Very simple fault tree.
Serial system
λS = ∑λ = 0,0125 + 0,0125 = 0,025 1/hMTBFS = 1/(1/MTBF + 1/MTBF) =1/(1/80 + 1/80) = 40 hRS = R x R = 0,9 x 0,9 = 0,81QS = Q + Q – (Q x Q) = 0,1 + 0,1 – 0,01 = 0,19 = 1 - 0,81
Parallel system
λp = 2 λ/ 3 = 0,0083 1/hMTBFS = 80 + 80 – 1/(1/80 + 1/80) = 120 hRS = 1 - [(1 - R) x (1 - R)] = 1 – (1 - 0,9) x (1 – 0,9) = 0,99RS = R + R – R x R = 0,9 + 0,9 – 0,9 x 0,9 = 0,99Q = Q x Q = 0,1 x 0,1 = 0,01
S
Mixed system
RS = 1– [(1– 0,95)(1– 0,99)] x 0,98 x {1– [(1– 0,99) x 0,97 x (1- 0,90)]}= 0,9995 x 0.98 x 0,99603RS = 0,97562 ~ 0,97The Unreliability QS = 1 – R = 0,02438 ~ 0,03
Very simple fault tree
The failure module is a signal type component and is executed after the calculation of the energy components. This makes itpossible to change the probability failure values during the energy calculation. So a probability variable can be a function of aneffort and or a flow variable.
The failure module calculates the fail probability of the connected component. This is the top component. The method that isused is the "Fault Tree Analysis". The failure tree is started from the top component and is branched by its input energy gate.There are a few rules to build a fault tree.
- A positive gate is defined as an input. In a graphical representation this is a half arrow to the component. When building thefault tree the outputs of an component are not considered. The tree is started from the inputs of an component to the connectedcomponents. If the input is not connected a structure error in the parameter list of the failure module is generated.
- The fault of an component is assumed to be disjunctive with its inputs and the fault must be less then 0.1 so the followingcalculation rules can be used.
For components in series the following configuration is given:
For these components the following calculation is done:
P(x) = P(f1 or a ) = P(f1 or P(f2 or b )) = P(f1 or f2 or b)=1-(1-P(f1))*(1-P(f2))*(1-P(b))
If the probaility of the faults is small this can be approximated with:
P(x) ≈ P(f1) + P(f2 ) + P(b)
For components connected parallel the following configuration is given:
The calculated probability of P(x) is:
P(x) = P(f) + P(y) * P(z) ;P(f)=0 (connection)
P(y) = P(f1 or a) = P(f1) + P(a)
P(z) = P(f2 or b) = P(f2) + P(b)
P(a) = P(c)
P(b) = P(c)
P(x) = (P(f1) + P(c) ) * (P(f2) + P(c))
Worked out:
P(x) = P(f1) * P(f2) + P(f1) * P(c) + P(f2) * P(c) + P(c) * P(c)
With the reduction rules:
P(c) * P(c) = P(c)
P(f2) * P(c) + P(c) = P(c)
P(x) = P(f1) * P(f2) + P(c)
- components inside an component are taken up in the fault tree if they have effect in the energy calculation of the componentsin the fault tree. Of course, these components can be a complete new tree.
For instance:
P(x) = P(f1) and P(f1i) and P(f2i) and P(b)
or
P(x) = P(f1) + P(f1i) + P(f2i) + P(b)
Note: If the mantle-component is locked, it is assumed that the fault variable is calculated for internally for the total component.This value is taken and the internal components are not used in the calculation.
Example (faildieselgroup.mod):
Figure 1 Example of a propulsion installation with three failure modules
In this example a propulsion installation is given with three diesel engines and three independent failure modules. Failure moduleFail_1 calculates the probability when the propulsion installation fails. Failure module Fail_2 calculates the probability of coil failureand the failure module Fail_3 calculates the failure probability of the diesel engine group.
Figure 2 And/or fault tree for example
Figure 3 And/or fault tree for diesel group
In an example the fault values for diesel 1-4 are taken as 01. , 0.2 , 0.3 and 0.4. The user fault is taken as 0.2 and the fault of thefuel-tank as 0.4. The resulting fault value for the diesel group now is 0.413. The approximated value is 0.422 and the Mean TimeBetween Failure approach gives 2.42.
Note 1: As can be seen from the formulas, failure rates should be smaller than 1. an consequently the Mean Time Between Failure
must be larger than 1.Note 2: The assumption that the failures on parallel input gates should be treated as parallel in the fault tree is not always true. Forinstance, if an component needs both input signals to operate, than the faults behave like a series.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > fappend
fappendFunction fappend opens a text file for writing at end of file.
Syntax fappend(value x) ‘string’; ‘string’ is the file name with or without a path.
Remarks fappend opens a file for writing at the end of the file or creates the file for writing if the file does not exist. x istruncated (behind the decimal point) and is the unit number of the file. This value must be 0,...90, else the parserof GES gives the error message "file unit between 0-90". An other value is treaded as filepointer.
Example fappend(2) ‘c:\ges\data\test.dat’;
Appends the file test.dat for writing in the directory c:\ges\data.
You can write to unit 2 using the functions: fwritestr, fwriteval, fwriteval_f, fwritenl, fprintf.
The unit number in GES is global, so you can write from other apparatuses to that file.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > fclose
fcloseFunction Fclose closes a file. Syntax fclose (value x)
Remarks Fclose closes a file assigned to unit x. The truncated (behind the decimal point) x value mustbe 0,...90, else the parser of GES gives the error message "file unit between 0-90".
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > fgetstr
fgetstrFunction fgetstr gets strings from file. Syntax (fp,[read number characters put in] 'string1', [[read number characters put in] 'string2'],......) ;
Example fgetstr(fp,20,name_parameter(0),name_component,12,name_parameter(1));
Read from file 20 characters and put these in parameter(0), read next in name_component, read 12 charactersinto parameter(1)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > First order filter
First order filterFirst order filter with response function π/(s/(2*π*f1) +1).Low pass filter.
Parameters Parameter(0): π Parameter(1): f1
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > fopen
fopenFunction Fopen opens a file. Syntax fopen(value x) ‘string’
Remarks Fopen creates a file for writing. If a file by that name already exists, it will be overwritten.The truncated (behind the decimal point) x value is the unit number of the file. This value must be 0,...90,else the parser of GES gives the error message "file unit between 0-90".‘string’ is the file name with or without a path and optional an open mode.‘string’ = file name [,mode]mode wt write text filew+t write text file update (default)rt read text filer+t read text file update
Example Fopen(2) ‘c:\ges\data\test.dat, wt’;
Opens the file test.dat for writing in the directory c:\ges\data.
You can write to unit 2 with the functions: fwritestr, fwriteval, fwriteval_f, fwritenl, fprintf.
The unit number in GES is global, so you can write from other apparatus to that file.
Be careful if you want to read the file test.dat you must open this file with:fopen2) ‘c:\ges\data\test.dat, rt’;Don’t forget the mode rt !
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Format
Format
Font Change the font type used in the diagram. (See also Diagram)Foreground color Change the color of the lines of the selected element.Background color Change the background color of the selected element.Screen color Change background color of the diagram.Hide name Hide names of the components.Resize Scale the size of the selected componten along the x, y or z axis.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > Fourier
FourierFourier gives the magnitude of the first Fourier component (parameter1=1) or the zeroth component (parameter1=0) from thesignal on e_gate(1) as well as the angle in the complex plane on e_gate(2).
Parameters Parameter(0) is the fundamental frequency of the signal in s. Parameter(1) harmonic 0=DC 1=fundamental
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > fprintf
fprintfFunction fprintf writes text strings to a file. Syntax fprintf (value x) ‘string’
Remarks fprintf writes the 'string' to unit number x. The truncated (behind the decimal point) x value must be 0,...90, elsethe parser of GES gives the error message "file unit between 0-90". The unit number in GES is global, so you canwrite from other apparatuses to the file.
The length of ‘string’ can be 64k characters.
Example fprintf (2) ‘write this string to unit 2’
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > From Workspace
From Workspace input output
gate energy variable symbol unit variable symbol unit
0 no no p [-] flow [-]
Table 1 Gate variables From_Workspace component
The From_Workspace component is used to place the value of a global workspace variable in a parameter of an component.
Parameter(0):For a number this is the index of the internal global buffer of GES (indicated by a number between 0-99). For a global workspacevariable (recommended) this must be a name followed by an exclamation mark. For a system workspace variable this must be aname followed by two exclamation marks.
Parameter(1):The index of the parameter of the connected component. If this parameter is a matrix element, the indices must be given byparameter(2) (row) and parameter(3) (column).
Parameter(2):The row number in the matrix. This value is used if the parameter of the connected component is a matrix.
Parameter(3):The column number in the matrix. This value is used if the parameter of the connected component is a matrix.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > fscanf
fscanfFunction fscanf reads a text file. Syntax fscanf(value x) ‘string’
Remarks fscanf reads a text file depending of the format string. See for the format string the function fwriteval_f. Thetruncated (behind the decimal point) x value is the unit number of the file. This value must be 0,...90, else theparser of GES gives the error message "file unit between 0-90".
Fscanf can only return one value. So the format string must include ‘%lf’.
See for the description of the format string the function fwriteval_f. Example A text file named test.epi contains the following text:
"text1" 20"text2" 30"text3" 40
If you want to read these values in the parameter fields of an apparatus you can use the following code:
fopen(1) 'test.epi, rt';number = fscanf(1) '%lf'; // read first line total numberi=0;while(i<number){parameter(i)=fscanf(1)'%*s%lf'; //'%*s' skips the commenti=i+1;}fclose(1);
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Ges DocumentationInput and output functions: FSCANF
FSCANF
Function FSCANF reads a text file.
Syntax FSCANF(value x) ‘string’;
Remarks FSCANF reads a text file depending of the format string. See for the format string thefunction FWRITEVAL_F. The truncated (behind the decimal point) x value is the unit number of thefile. This value must be 0,...90, else the parser of GES gives the error message "file unit between 0-90".
FSCANF can only return one value. So the format string must include ‘%lf’
See for the description of the format string the function FWRITEVAL_F.
Example:
A text file named test.epi contains the following text:
"text1" 20"text2" 30"text3" 40
If you want to read these values in the parameter fields of an apparatus you can use the followingcode.
fopen(1) 'test.epi, rt';number = fscanf(1) '%lf'; // read first line total numberi=0;while(i<number){parameter(i)=fscanf(1)'%*s%lf'; //'%*s' skips the commenti=i+1;}fclose(1);
See also: Input and output functions, FWRITENL, FWRITEVAL, FWRITEVAL_F, FWRITECHAR
(c) TNO Building and Research, CMC 2003
Mainindex
Home > Working with GES > Components > Internal > Fuel
Fuel input output
gate energy variable symbol unit variable symbol unit
0 neg no f [-] effort e [-]
Table 1 Gate variables fuel component
This component gives the enthalpy of combustion.
The component is derived from the E constant component.
Parameter(0): Is the enthalpy of combustion in kJ/kg. Default value is 1.
Some enthalpy values of combustion are:
Diesel oil/fuel 42700 kJ/kg
Diesel fuel (ship) 42600 kJ/kg
petrol 43500 kJ/kgwood 15300 kJ/kg
pit coal 30000 kJ/kg
brown coal 8060 kJ/kg
natural gas 31.5 MJ/m3 38100 kJ/kg
natural gas 37.3 MJ/m3 47600 kJ/kg
Hydrogen density 0.090 kg/m3 120 MJ/kg
Table 2 Enthalpy values of combustion
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Function Index
Function IndexA B C D E F G H I J K L M N O P Q R S T U V W X Y Z Symbols
A
abs (absolute value)
access (see: database) acos
AES(All Electric Ship) evaluation tool
algebraic loops arccos (see: acos)
arcsin (see: asin) arctan (see: atan) array (see: matrix; parameter)
ASCII data (see: printable characters (list of); reading from disk; saving to disk)
ASCII delimited file (see: reading; writing) asinatan atan2 (four-quadrant)
B background color (see:sys.bkgcolor)
binom
box (see: messagebox) C cat strcpy close (also see: close database) color (see: sys.color; sys.bkgcolor; sys.textcolor)
command line interface (see: simulation) comments (characters)
component (see structure, language)
connect gate to a mantled component
control program (see directives)
conversion ( string to value; value to string)
cos cosh
COM (interface) creating online help for your own GES-files connect sys.connect.toparent cumulative (see: sum workspace and sum parameters) curve fitting (polynomial) (see: linint1d)
D database
date and time functions
DDE interface
deleting files
delimiter in parameter file
directory (getting system directory, changing working, root)
directives (#IF #ELSE #ENDIF #STOP)
dismantle components
diss_component
dll (see: run.dll)
draw (see: sys.draw.figure and sys.draw.text)
drawing (changing)
E edit parameter values else (see: if) e_gate e_name_gate
e_append_gate (#)
e_append_gate.first(#) see f_append_gate.first(#)
error catching (generating, error) error message end_functione unit gate (see: unit_gate) e_value execution (see: run) eff_component (efficiency) effort iteration
eval (see: matlab)
excluding source code
exp expression, GES F fac failure module fappend f_append_gate(.first) fclose f_gatefgetsrt file (see: closing; deleting; opening) flow iteration (see also: else; if; while) f name gate
fopen fprintf
from Workspace fscanf f unit gate (see: unit_gate) function definition function property (see: sys.function.property)
f_value fwritechar fwritenl fwritestr fwriteval
fwriteval_f (formated) G gates; (see: number of) gate dimension #dimgate gate_energy general (insert window) ges.exe <command line> GES Language global variable (clearing, defining) (see: GES Language) Hhelp (string block) hyperbolic (see: cosh; sinh; tanh) heun (integration method) hydraulic generator hydraulic motor I if statement include including (see: comments) include path init_function init_matrix
init_parameters inputbox integral integration methods interpolation (see one-dimensional; two-dimensional) inverse (see: acos; asin; atan) iteration (see: root) iteration process (see: init function) J Junctions (0-junction; 1-junction) K - L
limit linint1d linint2d linear interpolation (see: linint1d, linint2d) lmax ln load locate location (sys.location) locked component log (logarithm, natural) log10 (logarithm, base ten)
log file lookvalstr M mantle components Matlab (Simulink) matrix max messagebox min mod N name_component name_model name_parameter neg_gate nowarning (see: sys.nowarning) nr_gates nr_parameters numtostr (number to string) O open database (sys.opendatabase) operators (indirect) operational profile (COM) options
P parameter parameter list (see: sys.parameter.list) parameter numbers #parameters parameter values p unit gate (see: unit_gate) pi plot and sys.plot pointer pointer component polint1d
pop-up menu component (right mouse click) post_function postenergy_function post_type pos_gate pow pow10 pre_function pre_type property (see: sys.function.property, sys.component.property) probox project file Q query (see: sys.query) query.file (see: sys.query) query.result (see: sys.query.result) query.table (see: sys.query.table)
R random reference functions read parameters read_workspace /regserver remove (file) results from database
return (see: function) round root run run.component run.dll run.e_gate run.f_gate (see: run.e_gate) run function (see COM interface)run.parser run.shell runga kutta (integration method) S Server (see: COM) Simulink (see: Matlab) sin, asin size drawing (see: drawing) sinh sgn solution process sqr sqrs sqrt
statements strcpy strtoval sum_parameter sum_workspace sum_workspace.localtree system workspace sys.axis.title (see sys.plot)
sys.bkgcolor sys.charttype sys.closedatabase (see database querys) sys.color sys.component.dissipation (diss_component) sys.component.efficiency (eff_component)
sys.component.gate sys.component.property sys.connect.toparent sys.draw.figure sys.draw.text sys.f1 sys.function.property sys.help sys.help.file sys.iteration.maxits sys.iteration.tolf sys.iteration.tolmin sys.iteration.tolx sys.iteration.stpmx sys.iteration.io_offset sys.location sys.model.location sys.nowarning sys.option.(maxits.tolf.tolmin,stpmx.io_ofset.stopmaxits.showmessages.showtree,realtime,runfunction)
sys.parameter sys.parameter.list sys.plot sys.query sys.rgb sys.search sys.search.component sys.search.component.variable sys.size sys.statusbar sys.textcolor sys.user.location sys.warning T tangent (tan) tangent, hyperbolic (tanh)
tangent, inverse (atan) tangent, inverse (four quadrant) (atan2) time and date functions to workspace trunc U unit_gate unit parameter unmantle components (see: mantle) unmask components user_type user defined mouse actions (see sys.function.property) V valstr
valtostr variables, global
variables, local variables, system version W while statement workspace (see: to workspace, from workspace) workspace, system write_parameters write_workspace writing a ascii character to a file (see: fwritechar) writing values to a file (see: fwriteval) writing values to a file formatted (see: fwriteval_f) X - Y - Z - Symbols $(ges) $(help) $(include1) $(include2) $(model) $(working) #dimgate #gates #parameters
#pi
[Go to top of page]/strong>
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > fwritechar
fwritecharFunction fwritechar writes an ASCII character to a file. Syntax fwritechar (value x, value y);
Remarks fwritechar writes one ASCII character to unit number x. The truncated (behind the decimalpoint) x value must be 0,...90, else the parser of GES gives the error message "file unit between 0-90".The unit number is global in GES, so you can write from other apparatus to the file.
The truncated (behind the decimal point) y is the decimal value of the ASCII character. Some values for yare:
decimal y Character ASCII name8 BS back space10 LF line feed12 FF form feed13 CR carriage return27 ESC escpae
Conversion decimal to ASCII
Example Write new line to unit 2 fwritechar (2,10); this is equal to fwritenl(2);
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Ges DocumentationInput and output functions: FWRITECHAR
FWRITECHAR
Function FWRITECHAR writes an ASCII character to a file.
Syntax FWRITECHAR (value x, value y);
Remarks FWRITECHAR writes one ASCII character to unit number x. The truncated (behind thedecimal point) x value must be 0,...90, else the parser of GES gives the error message "file unitbetween 0-90". The unit number is global in GES, so you can write from other apparatus to the file.
The truncated (behind the decimal point) y is the decimal value of the ASCII character. Some valuesfor y are:
decimal y Character ASCII name
8 BS back space
10 LF line feed
12 FF form feed
13 CR carriage return
27 ESC escape
Table Conversion decimal to ASCII
Example: Write new line to unit 2 FWRITECHAR(2,10); this is equal to FWRITENL(2);
See also: Input and output functions, FWRITEVAL, FWRITEVAL_F
(c) TNO Building and Research, CMC 2003
Mainindex
Home > Working with GES > GES Functions > Input and output functions > fwritenl
fwritenlFunction fwritenl writes a new line character. Syntax fwritenl(value x)
Remarks fwritenl writes a new line (CR) character to unit x. The truncated (behind the decimal point)x value must be 0,...90, else the parser of GES gives the error message "file unit between 0-90".
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > fwritestr
fwritestrFunction fwritestr writes text strings to a file.
Syntax fwritestr(value x) ‘string’;
Remarks The same function as the function fprintf.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > fwriteval
fwritevalFunction fwriteval writes a value to file. Syntax fwriteval(value x, value y)
orSyntax fwriteval(value x, value y) ‘string’; (from GES version 1.06. see fwriteval_f)
Remarks Fwriteval writes value y to unit number x. The truncated (behind the decimal point) x value must be 0,...90, elsethe parser of GES gives the error message "file unit between 0-90". The unit number is global in GES, so data canwritten from other components. The argument y is printed in style e, E or f, with the precision of 4 significant digits.Trailing zeros are removed from the result, and a decimal point appears only if necessary. The minimum numberof characters to print is 10, padding with blanks or zeros.
Example Writing a value to a file:
Example with unit number:a=10;fopen(99) 'test.txt';fwriteval(99,a);fclose(99);
Example with file pointer:a=10;fopen(fp) 'test.txt';fwriteval(fp,a);fclose(fp);
Writing a value to the screen (component-name):
Example: fwriteval(-1,Vs*sgn(f_gate(0))) ':%4.2lf [m/s]';
The handle -1, neglects the already existing component name.
Example: fwriteval(-2,Vs*sgn(f_gate(0))) ':%4.2lf [m/s]';
The handle -2, writes the value behind the component name.(Note: the component name should be without spaces)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > fwriteval_f
fwriteval_fFunction fwriteval_f writes a formatted value to file. Syntax fwriteval_f (value x, value y) ‘string’
Remarks Fwriteval_f writes value y to unit number x in the format given by ‘string’. The x value is truncated (behind thedecimal point) and must be 0,...90, else the parser of GES gives the error message "file unit between 0-90". Theunit number is global in GES, so you can write from other components to the file.
The format string controls how value y will be converted. The format string must contain two types ofobjects: Plain characters and a conversion specification for value y.
- Plain characters are copied verbatim to the output stream.- Conversion specification fetch the argument y and apply formatting.
The format string has the following form:% [flag] [width] [.prec] type
Each format specifier begins with the percent character %. After the % comes the following, in this order:- An optional sequence of flag characters [flag]- An optional width specifier [width]- An optional precision specifier [prec]- The conversion-type character [type]
Flag character:[flag] What it specifies- Left-justifies the result, pads on the right with blanks. If not given, it rightjustifies the result, pads on the
left with zeros or blanks.+ Signed conversion results always begin with a plus (+) or minus (-) sign.
Blank If value y is non negative, the output begins with a blank instead of a plus; negative values still beginwith a minus.
Width specifier:[width] How output width is affected
n At least n characters are printed. If the output value has less than n characters, the output is paddedwith blanks (right-padded if - flag given, left-padded otherwise).
0n At least n characters are printed. If the output value has less than n characters, it is filled on the leftwith zeros.
* If value y is not being formatted.
Precision specifier:[prec] How output precision is affected
none Precision set to default:default = 6 for e, E, f typesdefault = all significant digits for g, G types
.0 For e, E, f types, no decimal point is printed.
.n n characters or n decimal places are printed. If the output value has more than n characters, the outputmight be truncated or rounded. (Whether this happens depends on the type character.)
Type:[type] Format of output (input argument y is floating-point)f signed value of the form [-]dddd.dddd.e signed value of the form [-]d.dddd or e[+/-]ddd.G signed value in either e or f , based on given value and precision.E Same as e, but with E for exponent.G Same as g, but with E for exponent if e format used
Example fwriteval_f(2,3.1415) ‘Ges value y = %10.3g [-]’;results in file: Ges value y = 3.14 [-]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > G2 Port
G2 Port input output
gate energy variable symbol unit variable symbol unit
0 pos effort e [-] flow f [-]
1 neg effort e [-] flow f [-]
Table 1 Gate variables G2 Port
This component is a combination of a 1-junction and a conductance component. The equation of this component is:
f = G(e0 - e1)
e0 is effort value of gate 0
e1 is effort value of gate 1
f is the flow value of gate 0 and gate 1
G is the conduction constant
Parameter(0):Contain the conduction constant G. Default is 1.
Remark:This component is very useful if you have causality problems in your system. If you cannot connect an component to an energy flowwith an effort as output, you can place a G2_port component between these two. The parameter of the conduction between the twocomponents must be carefully chosen to make the effort error small. The next figure shows an example of a G2_port component toavoid connection problems.
Figure 2 G2 Port component used for causality problems
The E constant component delivers an effort value e0. The input of the resistance is the flow value f1. It is not allowed to connectthese two components. If you connect a G2 Port component between the E constant component and the Resistance componentyou can make a connection, but you make an error. This error depends on the parameter values of the resistance R and theconductance G.
The input value f0 of the E constant component is calculated by GES as follows:
f0 = f1 = G (e0 - e1) //equation from G_2 (f=f1=f0)
e1 = R f1 //equation from resistance
Combination of these two functions gives:
Without the G_2 component the results must be:
The relative error in f0 is:
The conduction G is:
To obtain a relative error of 0.001, the conduction G must be: 1000 / R
In practice can R be the impedance of a subsystem.
Remark:If in menu>tools>options>model the box auto create generate causal element is set, then a special component is automaticallygenerated between these two components. The effect is that the functions are placed in the iteration process. In this case a G2 Portis not necessary. The error depends on the simulation parameters.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > gate_energy
gate_energyFunction gate_energy returns the direction of a specific gate. Syntax gate_energy(gate number x)
return value is +1 for energy flow ( half arrow) to the componentreturn value is -1 for energy flow(half arrow) from the component
Remarks The truncated (behind the decimal point) x value is a gate number of the component. Example
For changing the gate direction of a resistance component, the resistance must be negative to consume power.e_gate(0)=gate_energy(0)*R*f_gate(0);In this case use the resistance component always energy if the gate direction is changed from gate (0).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
HomHome > GES User Interface > Diagram > Gate popup menu
Gate popup menu
Connect to New Import a new component
Connect to Surrounding Select a surrounding gate to connect to
Disconnect Disconnect gate
Plot Plot the simulation results
Inspect state Results
Properties Set gate properties like Unit, Energy direction, ...
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
HomHome > GES User Interface > Diagram > Gate popup menu > Gate properties
Gate properties
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > General marine systems
General marine systemsThis chapter is focused on systems generally used in the maritime sector. The conversion of the either physical systems ormarine specific system descriptions to an energetic system description is explained in the next paragraphs. It is no the purposeof this chapter to give a physical background of the systems but to explain how to create an elementary energetic model of it. Insome cases it is impossible to split the system in smaller energetic elements. This gives insight in the method of describingsystems by connecting the separate parts energetically.
Simulations of coupled energetic systems can predict the behaviour of the total system. This is explained in more detail in thenext chapter.
The first part in describing the system is determining the system boundaries of all elements. These boundaries can depend onmany variables and can vary for every element. The direction of the power arrow is of importance, generally the direction of thepower arrow is regarded as unimportant and its direction is chosen based on feeling. One of the common choices is that thepower of the diesel engine is positive and therefore the arrow is pointing away from it and a resistance is dissipating power andtherefore the arrow is pointing towards it. A negative resistance with a power arrow towards it causes a negative power andthus the resistance being a source.
Read the entire chapter in the manual. Chapter 4 General marine systems.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Generator standard (3 coeff.)
Generator standard (3 coeff.) input output
gate energy variable symbol unit variable symbol unit
0 pos flow ω [rad/s] effort M [Nm]
1 neg flow i [A] effort u [V]
Table 1 Gate variables Generator Standard
This component describes a standard three-phase industrial electrical alternator.
Efficiency of the standard alternatorFor this component the load dependent efficiency curves for standard alternators are given as polynomial formulas. For each speedan efficiency curve for a larger powered alternator (upper curve) and a lower powered alternator (lower curve) is given. Forcalculation of the efficiency of alternators with a power size between the upper and lower curve an interpolation according to thecube root will be executed. Also extrapolation of power sizes until 10 % above the upper curve and 10 % below the lower curve canbe executed according to the cube root.
Example of interpolation calculation:
Asked: efficiency at 50 % load of a 1200 rpm alternator of 4000 kW
Calculation: efficiency of a 1200 rpm, 6150 kW alternator at 50 % load is
according to the formula 95.5 %.
efficiency of a 1200 rpm, 350 kW alternator at 50 % load is
according to the formula 91.5 %.
efficiency of a 1200 rpm, 4000 kW alternator at 50 % load can be calculated with:
Parameter(0):The effective output voltage of the standard generator.
Parameter(1):The nominal power of the generator.
Parameter(2):
The nominal power of the maximum (upper) given generator.
Parameter(3):Contains the coefficients of the load and efficiency in fractions of the upper power line.
The load fraction is the actual power divided by the nominal power and is placed in column The efficiency (fraction) is placed incolumn 2.
Parameter(4):The nominal power of the minimum (lower) given generator.
Parameter(5):Contains the coefficients of the load and efficiency in fractions of the lower power line.
The load fraction is the actual power divided by nominal power and is placed in column 1. The efficiency (fraction) is placed incolumn 2.
An example of the lower and upper curves are given in figure 1.
The efficiency is given in per cent. In parameter(3) and parameter(4) you must insert the fraction!
Figure 1 Example lower and upper curves alternator
Example: The efficiency curves of the standard alternator are given as polynomial formulas.
First you must create a user defined component with two gates and five parameters.
The parser string may look as follows:
// Shaft generator 900 rpm = 94.2477 rad/s for all voltage
// gate(0) input mechanical energy e = torque[Nm]
// f = speed[rad/s]
// gate(1) output electric energy e = voltage[V]
// f = current[A]
// parameter(0) = output voltage alternator [V]
// parameter(1) = not used
// parameter(2) = normal load of the alternator in kW
// parameter(3) = normal load of the upper alternator in kW
// parameter(4) = normal load of the lower alternator in kW
name_parameter(0)'voltage';
unit_parameter(0)'[V]';
name_parameter(2)'normal load alternator';
unit_parameter(2)'[kW]';
name_parameter(3)'normal load upper curve';
unit_parameter(3)'[kW]';
name_parameter(4)'normal load lower curve';
unit_parameter(4)'[kW]';
power = e_gate(1)*f_gate(1)/1000; //actual electric power kW
win = f_gate(0); //actual speed in rad/s
pu = power*94.2477/(parameter(2)*win); //load fraction
//polynomial curves of the upper and lower lines
//efficiency % of the upper alternator example
eff_max = -6.97*pu^2 + 13.5*pu + 90.4;
//efficiency % of the lower alternator example
eff_min = 8.53*pu^3 - 27.8*pu^2 + 28.5*pu + 83.1;
eff = eff_min + ((parameter(2)-parameter(4)) /
(parameter(3)-parameter(4)))^(1/3) *
(eff_max-eff_min);
eff = eff / 100; //efficiency fraction of the actual alternator
e_gate(0) = power * 1000 / (win*eff); //torque shaft
neg_gate(1);
e_gate(1) = parameter(0); //output voltage alternator
See alternator in model ges\examples\altenatr.mod.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Generator
Generator input output
gate energy variable symbol unit variable symbol unit
0 pos flow ω [rad/s] effort M [Nm]
1 neg flow i [A] effort u [V]
Table 1 Gate variables Generator
This component describes a simple commutator machine which is operated as a generator. Its speed is determined by thecharacteristics of its prime mover. It is convenient to classify commutator machines as generators or motors, depending on thedominant direction of the power flow in the application. Commutator machines normally operate with direct voltage supplies and areusually referred to as direct-current machines. They are widely used in vehicles that have electric storage batteries, as motors forauxiliary equipment, and as starters. A major area of use for the motors is in the variable-speed drives where the ability to controlspeed and position is important.
The relations of the ideal generator are:
T = K I //torque (T) is linear with the current (I)
U = K ω //voltage (U) is linear with the speed (ω )
K = electric magnetic field constant (EMF constant)
If we assume that for the generator U is constant and we know the efficiency η of the generator, then the torque is written as:
T = K I / η
The parameter list of the commutator generator is:
Parameter(0):The output voltage of the generator.
Parameter(1):The electric magnetic field constant of the generator.
Parameter(2):The efficiency of the generator.
Example: In this example the equations are given if the generator is created with the user defined component. First you must createa user defined component with 2 gates and 3 parameters.
The parser string may look as follows:
//gate(0)is mechanical side e_gate(0)=torque
// f_gate(0)=speed
//gate(1)is the electric side e_gate(1)=voltage
// f_gate(1)=current
//parameter(0)=output voltage [V]
//parameter(1)= EMF
//parameter(2)=efficiency
e_gate(0) = f_gate(1)*parameter(1)/parameter(2); //torque T
neg_gate(1);
e_gate(1) = parameter(0); //output voltage U
See component commutator in model ges/examples/comu_tor.mod.
In APPENDIX B "Parser equations of an asynchronous machine" an example is given of an asynchronous machine. Seecomponent asynchrone in model ges/examples/asynaand.mod.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface
GES User Interface
1 Menu File, Edit, View, ...2 Toolbar New, Open, Safe, Print, ...3 Diagram Displays the diagram of the model4 Tree view List of components used in the model, right click for component popup menu
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Function definition
Function definitionFunction The keyword function is used as word for the definition of a GES function.
Syntax function 'function keyword' (value u1, ...., value un){
}
Remarks For the function keyword can not used build in functions such as sin, cos etc. Example function function_name1 (b){
a = 10*b;return a*3;}
f_gate(0) = function_name1(2);
The function function_name1 returns by calling the value 60. Remark: the workspace variable a is global!. a is overruled if the function is called.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Tools > Project file
Project fileIn de projectfile moeten alle filenamen van de GES modellen die achter elkaar worden gedraaid staan. Vanwege de eenvoudwordt gebruik gemaakt van een 'comma separeted' file. Dit heeft als voordeel dat de file met Excel gemaakt kan worden.Daarnaast is gedacht dat dezelfde file eventueel gebruikt kan worden voor het verzamelen van alle belangrijke aspecten van deberekeningen. Dit wordt uitgelegd in hoofdstuk Macro 'RunProject' .
Het formaat van de project file staat in Tabel 3.1 Formaat projectfile .
Dummy regel ; <Directory voor model 1> ; <Filenaam voor model 1> <Directory voor model 2> ; <Filenaam voor model 2> <Directory voor model 3> ; <Filenaam voor model 3>Etc. Etc.
Tabel 3.1 Formaat projectfile
De projectfile bestaat eigenlijk uit twee kolommen waarin opgenomen zijn de directorynaam en de filenaam van het model. Denamen zijn in de praktijk gescheiden door een puntkomma.
De eerste regel wordt genegeerd en wordt gebruikt als kop voor de velden directory en filenaam. Een voorbeeld van deprojectfile gepresenteerd in Excel staat in Figuur 3.1 Voorbeeld projectfile in Excel .
Figuur 3.1 Voorbeeld projectfile in Excel
Alleen de eerste twee kolommen worden door GES gebruikt, eventuele informatie in de andere kolommen wordt genegeerd.De filenaam dient opgegeven te worden zonder de extensie mod.
In GES kan de projectfile opgegeven worden bij Simulation->Run Window->Run Project. De projectfile heeft de standaardextensie csv.
Een voorbeeld van de afhandeling van de projectfile staat in Figuur 3.2 Simulatie project . De projectafhandeling kan voortijdiggestopt worden door op Close te drukken.
Figuur 3.2 Simulatie project in GES
Macro 'RunProject'
Ieder GES model schrijft ook zijn resultaten weg naar een Excel file. Deze naam moet opgegeven worden in de GEScomponent Profile en worden ingevuld in parameter 151. Zie hiervoor Figuur 4.1 Parameter lijst component "Profile" .
Figuur 4.1 Parameter lijst component "Profile"
De extensie van de uitvoer file is csv en moet bij het invullen worden weggelaten. De uitvoerfile kan door Excel wordeningelezen en worden bewerkt met de Macro TNOGES welke zich bevindt in de file GES_macros_e.xls. Na iedere GESberekening moet deze macro gedraaid worden. Voor het automatiseren van deze handeling voor een groot aantal resultaatfilesis in Excel een macro RUNPROJECT ontwikkeld.
Deze macro loopt een lijst langs waarin de resultaatfiles in opgeslagen zijn. Deze projectfile heeft dezelfde structuur als deprojectfile die door GES gebruikt wordt voor het sequentieel draaien van de modellen. Daarnaast haalt de macro debelangrijkste aspecten uit de resultaatfile en zet die resultaten in de projectfile zelf. Deze aspecten zijn opgenomen in Tabel 4.1Resultaat attributen in projectfile .
Investment cost [k€] Volume [m^3] Mass [ton] Maintenance cost [k€/yr] Availability [%] Fuel cost [k€/yr] CO2 [ton/yr] SOx [ton/yr]
NOx [ton/yr] HC [ton/yr] CO [ton/yr] Floor area [m^2]
Tabel 4.1 Resultaat attributen in projectfile
Het is voor de gebruiker handig om de resultatenfile van GES dezelfde naam te geven als het model, zodat de projectfile doorGES als door de Excel macro RUNPROJECT gebruikt kan worden. De macro kan gebruikt worden nadat de projectfile isingelezen. Zie Figuur 4.2 .
Figuur 4.2 Starten project macro in Excel
Indien de macro opgestart wordt, wordt eerst gevraag welke files achtereenvolgens gedraaid moeten worden. Opgegeven moetworden de beginpositie en de eindpositie van de files die in de projectfile gedraaid moeten worden. Daarvoor komt de macroeerst op met een dialoogbox voor de beginpositie (Zie Figuur 4.3 ) en dan met een dialoogbox voor de eindpositie (Zie Figuur4.4 ).
Figuur 4.3 Start index in projectfile
Standaard staat de index op 2, omdat op die plaats de eerste resultatenfile staat.
Figuur 4.4 Eind index in projectfile
In dit geval worden de resultaten van 2 tot en met 14 aangepast. Een voorbeeld van een resultaat van een projectfile dataangepast is door de Excel macro RUNPROJECT is gegeven in Figuur 4.5 .
Figuur 4.5 Voorbeeld resultaten in projectfile
De macro maakt zelf op de eerste rij de kopjes van de resultaten aan. In eerste instantie is alleen van belang de directory en defilenaam van de resultaten die op rij twee moeten beginnen. De resultaten van de attributen worden in de kolommen achter defilenaam weggeschreven.
Werkwijze
Maak in Excel een projectfile aan voor GES, zoals die opgegeven is in hoofdstuk Projectfile .
Maak daarna in hetzelfde formaat een projectfile aan die geschikt is voor de macro RUNPROJECT. De namen van deresultatenfiles die in deze projectfile staan kunnen overgenomen worden uit de GES modellen. Indien deze resultaatnamenhetzelfde zijn als de namen van de GES modellen, dan kan de projectfile van GES hiervoor gebruikt worden.
Start daarna GES en Run de GES projectfile. Alle modellen worden nu achtereen volgens gedraaid. Daarna kan Excelopgestart worden en kan de projectfile in Excel ingelezen worden. Start dan de macro RUNPROJECT. De resultaten worden indiezelfde projectfile gezet. Op deze manier is het mogelijk een grote hoeveelheid modellen achtereenvolgens te analyseren.Tevens worden de resultaten naast elkaar gelegd, zodat op een eenvoudige wijze ook de resultaten gecontroleerd kunnenworden.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Introduction > GES Directory Structure
GES Directory StructureGES is distributed in compressed format. The installation procedure moves the files to the hard disk, decompresses them, andinstalls them in the Windows environment.After installation, the GES directory will posses the following files and subdirectories:
\DOC\GESDOC\MASTER The master and sub word documents for generating help files and the manual\GES The GES binary and associated files\GES\DATA The data work directory
\GES\DOC The documentation files\GES\Model The example model directory\GES\HELP The Help files\GES\LIB The available libraries
\GES\MODEL The default user model directory\GES\PROTOTYPES The prototype model files
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions
GES FunctionsFunction Index All functions Component initialisation functions name component, e unit gate,....Component mathematical functions e_gate, e_value, efficiency, dissipation, number of gates, parameters,...Dynamic functions intergral,...Initialization functions inti_matrix, pre-type, post_type, user_type,...Input and output functions fopen, fclose, fwriteval,...Interface functions COM, Matlab, DDE, Database,...Manipulation functions Include, init- pre- post function,....Mathematical functions sin, cos, asin,...Pointers *, &,...String functions numtostr,...System functions sys....Time and date functions datetime,.... Function definition function keyword
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Toolbar > GES Organizer
GES Organizer
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package >
GES packageFull GES version; based on model version 1.09; CRS compatible, but no restrictions.
HTML GES help system Decription of internal models, Ges language functions
Internal component library First principle models implimented in the Ges kernelOperational profile library Static efficiency and ecomic maritime models based on statistics
Dynamic library Dynamic first principle models
Simulink interface library Interface example modelsMaritiem library First principle maritiem models; ship resistance, propulsors, engines
Interfaces Communication with external programs; COM, DLL,s (C Fortran), Matlab/Simulink, Accessdatabase (SQL language)
Prototype toolbox Basic ship models build from Operational profile library
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language
GES Programming languageThe structure for physical systems
Read a more detailed explanation chapter in the manual. Chapter 7 GES Programming langugage.
Component language
MatricesComplex numbers
Language structure (syntax)System workspaceStatementsCommentsDirectivesExpressionsLexical Elements
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > get_matlab
get_matlabFunction get_matlab returns a value of a Matlab variable Syntax get_matlab'string';
Remarks The string must contain a MATLAB variable name.
Example Gesvalue = get_matlab ’A’; //get value of variable A from MATLAB and put the valuein Gesvalue
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > get_matlab_matrix
get_matlab_matrixFunction get_matlab_matrix returns a matrix of a Matlab matrix Syntax get_matlab_matrix 'string';
Remarks The string must contain a MATLAB variable name.It is only possible to store the MATLAB matrix in the parameter field of a GES component.
Example parameter(1) = get_matlab_matrix ’A’; //get matrix of variable A from MATLAB andput the value in parameter(1)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Getting started
Getting startedTo get started with GES, chapter 8 'Using GES' from the manual, will give an overview of the most common functions used inGES.
This practical is very useful to get more extensive practice using GES. (Dutch)
Make new documentInsert componentMake modelStart a simulation
Plot
Error
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram
Diagram
Right mouse click on a selected component or component name of in the treemenu to open the component popup menu.Right mouse click in the diagram to open the diagram popup menu.Right mouse click on a gate to open the gate popup menu.
Controls
Shift Manually move diagramScroll Move diagram up and downCtrl + scroll Zoom in/outClick + drag Select mutiple components
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > Gyrator
Gyrator input output
gate energy variable symbol unit variable symbol unit
0 pos flow f [-] effort e [-]
1 neg flow f [-] effort e [-]
Table 1 Gate variables ideal gyrator
This component describes an ideal gyrator with a flow variable as input. The equations for this component are:
e1 = n . f0e0 = n . f1
n is the gyrator ratio
f1 is the input flow of gate 1
fo is the input flow of gate 0
eo is the output effort of gate 0
e1 is the output effort of gate 1
Remark:The word gyrator was invented originally for the sort of gyrational coupling that exists in mechanical systems. A gyrator is a morefundamental element than a transformer. The cascade combination of two gyrators is equivalent to a transformer as the followinggyrator components demonstrate:
The f_constant component delivers a constant flow value. The gyrator reverses the flow to an effort and the user gyrator reversesthis effort value to a flow value. See for this model ges\example\gyrators.mod.
Thus one could, in principle, consider each transformer a cascade combination of two gyrators and dispense with the transformer asa basic element. Since certain physical systems occur naturally in a form that may be represented as a transformer, the transformeris set in the basic component library. It is important to realize that the gyrator reverses the roles of the effort and flow in a system.
Parameter(0):
Contains the transformer ratio n.
Example:If you want to have a gyrator with an effort variable as input you can make it with the following parser string. You must create a userdefined component with two gate numbers and one parameter number.
//example gyrator with effort as input and output
//gate(0) = energy input
//gate(1) = energy output
//parameter(0) = n
name_parameter(0) 'n';
neg_gate(1);
f_gate(1) = parameter(0) * e_gate(0);
f_gate(0) = parameter(0) * e_gate(1);
See component user gyrator in model ges\examples\gyrators.mod.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > HTML GES help system
HTML GES help systemDecription of internal models, Ges language functions.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Hull
Hull input output
gate energy variable symbol unit variable symbol unit
0 neg flow Vs [m/s] effort R [N]
1 pos effort T [N] flow va [m/s]
Table 1 Gate variables Hull
This component describes the hull efficiency of a ship. This component is usually used in combination with the propeller component.
The wake fraction w determines the relation between the entrance velocity Va at the propeller and the ship speed Vs by the relation:
In this model only the average wake will be used for the propeller inflow and unsteady effects will be neglected.
The increase of the resistance due to the propeller action is expressed as the trust deduction factor t.
Te is the thrust to maintain a certain design speed and Rs is the resistance without propeller at that speed.
The hull efficiency ηh is:
The thrust deduction t can be smaller than the wake fraction w, so the hull efficiency can be larger than 1. So it is possible that apropeller with a lower open water efficiency but a smaller diameter gives a higher total efficiency because the interaction with thehull is better.
Parameter(0): The thrust fraction t.
Parameter(1):The wake fraction w.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Ideal gas
Ideal gas input output
gate energy variable symbol unit variable symbol unit
0 pos effort T [K] flow ds/dt [Js-1K-1]
1 pos effort P [N/m2] flow dV/dt [m3/s]
2 neg effort h [kJ/kg] flow dm/dt [g/s]
Table 1 Gate variables ideal gas component
This component calculates the gas properties in a certain temperature range for some ideal gases. These gas properties are:enthalpy h, entropy s, cv and cp. The parameters cv and cp are set in the parameter fields 5 and 6 of the component.
An ideal gas is defined as a gas that obeys the relation:
The ideal gas equation provides a relation among the temperature T, pressure P, and the specific volume v of the system.Specifying any two of the system properties apparently fixes the other, without regard to the mass of the system.
For an ideal gas is cv - cp= R.
The specific heats at constant pressure are given by polynomials in appendix [D].
cp in kJ/kmolK is:
T in Kelvin.
The enthalpy h is obtained from:
The entropy s is obtained from:
The reference state is chosen at absolute zero temperature and atmospheric pressure.
Pref is 1e5 / 0.98692 N/m2
The specific entropy flow ds/dt is calculated as ds/dt = s *dm/dt
The volume flow dV/dt is calculated as dV/dt = v * dm/dt
Parameter(0): Is the gas constant R.
Parameter(1):Is the molecular weight.
Parameter(2):Contains the cp coefficients a, b, c, d in the first row.
Parameter(3):The minimum temperature of the range.
Parameter(4):The maximum temperature of the range.
Parameter(5):Gives by running the actual cv value. (is a calculated value!).
Parameter(6):Gives by running the actual cp value. (is a calculated value!).
Parameter(7):The entropy value Sref by 25 °C.
Parameter(8):The enthalpy value href by 25 °C.
Remark:Gas properties of different ideal gasses can be found in the file ges\data\idealgas.cp
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > linint2d
Idwint2dIdwint2d returns a weigted interpolated value of two dimensions for x y for list of xi yi zi points Idwint2d(value x, value y, value matrix[xi yi zi]);
The Inverse distance weight Idwint2d function calculates a weighted distance in a xi yi zi list given in a matrix.M long the 5 nearest points are taken into account. So more then 5 point must be in the matrix.Test[1,1]=[ //xi yi zi1 2 34 5 67 8 910 11 1213 14 15];
//the answers returns the best weigted zi value ans1 = IDWINT2D(4,5, Test);ans2 = IDWINT2D(5.5,6.5, Test);init_function;
sys.nowarning;
ans1 = 6ans2 = 7.50024
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > include
includeFunction include imports a parser text file in the parser string. Syntax include ‘string’;
Remarks ‘string’ must contain the file name to be included. If the file name does not exist the parser gives an errormessage.If no path is defined the search sequence is defined in the include file list
Example Parser string is:
//starta = sin(f_gate(0));include 'c:\ges\data\ges.equ';e_gate(0)= b*a;//end// The include file ges.equ could contain:// include 'c:\ges\data\next.equ';// and the include file next.equ could contain:// b=10;// so the following expression can calculated// e_gate(0)= b*a;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > init_function
init_functionFunction init_function defines functions to be executed after the pre-type functions. Syntax init_function;
<GES source code block with functions>init_function;
Remarks This function (init_function;) is used to as a delimiter in the GES source code. All function before this delimiter andafter another delimiter, if present, are executed one time before the actual calculations. "postfunction","prefunction",e_gate and "f_gate also act as delimiters.
This function could also be used as a normal function. The syntax is:
init_function{<GES source code block>}
The GES code is placed between braces. Example <ges code>
init_function;
init_function{<gescode>}
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Init Gate
Init Gate input output
gate energy variable symbol unit variable symbol unit
0 no no I [-] flow [-]
Table 1 Gate variables init gate component
The init gate component can be used to set a gate value of an component. This can be the effort or flow value of a gate. BecauseGES uses the actual gate values as the starting points for the iteration process this component can be used as initialization for theiteration process.
Before you use this component, you must first find out which variables in the model are solved by iteration. You can do that bytyping manually the sort numbers in the Edit menu. An automatic iteration list for setting this values is not worked out in GES.Therefore, you must use this component for difficult iteration processes.
Parameter(0):The start point value for energy solution at a particular gate.
Parameter(1):The gate variable type effort or flow that is set. 0 is effort. 1 is flow.
Parameter(2):The gate number of the connected component where the start point value is set.
See "Example Thermodynamic cycle".
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions > init_matrix
init_matrixFunction init_matrix initializes a matrix in the parameter field of the component. Syntax init_matrix (value parameter_index, value rows, value columns)
Remarks Only the parser executes this function. The argument parameter_index, rows and columns aretruncated (behind the decimal point). If the parameter of the apparatus is not a matrix, a new matrix isgenerated in the parameter field on the position of parameter_index. A parameter on this position mustexist. The parser gives no error message. If the parameter is an existing matrix, only a new one isgenerated if the dimensions are different. If the new dimensions are larger, than the new matrix fields arefilled with zeroes. If the new dimension are smaller, the old values are lost. If both rows and columns arezero, the matrix is removed from the parameter list with indes parameter_index.
Example init_matrix(3,20,100);
init_matrix(3,0,0); (matrix 3 removed)
This function generates a [20:100] matrix, provided that the parameter field 3 exists.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions > init_parameters
init_parametersFunction init_parameters initializes a matrix in the parameter field of the component Syntax init_parameters (from parameter_index, to parameter_index, value rows, value columns,
total no. of values (optional) )
Example init_parameters(18,18,120,10);
matrix(18,!!step,0)=p_gate(0)/1000; // delivered power [kW]
This function generates a [120:10] matrix, at parameter field 18. If parameter(18) does not exist, GESgenerates this parameter field automatically after a warning message. The function matrix is needed to putthe right value on the right place in the matrix. In this example, the power of gate(0) (in kW, divided by1000) is put on the place !!step of column 0.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions
Initialization functionsinit_matrix init_parameters post_type
pre_type
user_type sys.location sys.model.directory sys.user.location
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions
Input and output functionsinputbox eval_matlab get_matlab get_matlab_matrix put_matlab fappend fclosefopen fprintf fscanf fwritechar fwritenl fwritestr fwriteval fwriteval_floadmessagebox read_parameters remove run run.component run.dll run.e_gate run.parser run.shell write_parameters
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > inputbox
inputboxFunction inputbox shows a input box on the screen. Syntax inputbox'string'
Remarks This function shows a input box on the screen. The part of the string up to a comma (,), if present, is the text andthe text after the comma the caption of the input field box and the text of the last string is the default value of theinput box . the output of this function is a value if the value of the input box is a value else the value is zero.
Example error = inputbox 'error,state 0 or 1,',valtostr(error)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Inspect state
Inspect state
For the complete component the dissipation and efficiency are calculated. The efficiency is zero for an component with one gate.The power of every gate is calculated. When assigned, the units of the variables are also shown. The items present in the localworkspace are shown.
By clicking on Global workspace, in the options-menu, the variables in the global workspace are displayed (marked with oneexclamation mark). If the system variable view_syswrkspc=1 in the initialization file GES.INI is set to 1 the system workspace is alsodisplayed.
By clicking on Parameters, in the options-menu, the parameter list of the component is displayed. See also Edit parameter values .
If you select another component a new results dialog box is displayed over the old one. You can move the results dialog boxes tocompare the results.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Dynamic functions > Integral
IntegralFunction Integral returns the results of an integrated value. Syntax Integral(value io, value x, [value type], [value dt] )
io is the integration.
The Integral solvers can integrate systems of differential equations of one of theseforms: dx/dt = f (x, t).
Remarks The type of individual integration method and the integration stap dt is optional. Not al this individual methods areimplemented jet.
Explicit types:type 1 is explicit first order (Euler)type 2 is explicit second ordertype 3 is explicit third ordertype 4 is explicit fourth ordertype 5 is Runga Kuttatype 6 is Heun
Implicit types:type -1 is implicit first order (Euler)type -2 is implicit second order (Trapezium)type -3 is implicit third ordertype -4 is Static calculation
The default integration method (type = 0) is chosen in the simulation setup. Example First order filter in Laplace domain:
y(s) = x(s)/(s/wo+1)
Or in the time domain:dy/dt / wo + y(t) = x(t)dy/dt = wo * (x(t)- y(t))
Implementation in GES:y = integral(0, wo*(x - y))
This expression can also be written in GES as:y = integral(0, dy)dy = wo*(x - y)
First integral function(s) and than calculation of the input of the integrator(s)!
Wrong is:dy = wo*(x - y)y = integral(0, dy)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > Solvers > Integration methods
Integration methodsThere are two integration methods in GES implemented the implicit and explicit method.
First order: y(t) = y(t-dt) + x(t)*dt
Second order: y(t) = y(t-dt) + (x(t) + x(t-dt))*dt/2
Third order: y(t) = y(t-dt) + (5 x(t) + 8 x(t-dt) - x(t-2dt))*dt/12
Static: dy(t)/dt = 0
First order: y(t+dt) = y(t) + x(t)*dt
Second order: y(t+dt) = y(t) + ( 3 x(t) - x(t-dt))*dt/2
Third order: y(t+dt) = y(t) + ( 23 x(t) - 16 x(t-dt) + 5 x(t-2dt))*dt/12
Fourth order: y(t+dt) = y(t) + ( 55 x(t) - 59 x(t-dt) + 37 x(t-2dt) - 9 x(t-3dt))*dt/24
Runga Kutta:
k1 = f(t, y(t)) = x(t)
k2 = f(t + dt/2, y(t) + k1dt/2)
k3 = f(t + dt/2, y(t) + k2 dt/2)
k4 = f(t + dt, y(t) + k3 dt)
y(t+dt) = y(t) + (k1 + 2 k2 + 2 k3 + k4) dt/6
Heun:
k1 = f(t, y(t)) = x(t)
k2 = f(t + dt/2, y(t) + k1dt/2)
y(t+dt) = y(t) + (k1 + k2/2)* dt
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Interface functions
Interface functionsCom DDE (Dynamic Data Exchange) Database Matlab
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Interfaces
InterfacesCommunication with external programs; COM, DLL,s (C Fortran), Matlab/Simulink, Access database (SQL language).
File IOODBCCOMDDEGes DLLMatlab/simulinkAdd In
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Internal component library
Internal component libraryFirst principle models implimented in the Ges kernel.
User Defined ComponentParameter change, components set and parDiesel exhaust
Power Distributors flow and effort
Hydro motorHydro generator
Basic element import library
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Introduction
IntroductionPurpose of GESSystem requirementsGES dictory structure
The development of the GES software package based on the bond graph method began in 1993. GES stands for GeneralEnergy Systems and is used for the Royal Netherlands Navy for simulation of stationary energy systems on board navalvessels. The architecture of GES makes is possible to modulate all kinds of physical systems. The development of the GESsoftware package is based on the bond graph method. This domain-independent graphical notation of physical systemmodelling is the basis of the object-oriented system modelling in GES. Through this concept, re-use of models and sub modelsis facilitated. Component descriptions consist of a flexible number of inputs and outputs (gates). Each in- or output is defined asan energy flow of the component. Interactions of the components are described with variables of the power of the gate. Withthis structure it is possible to replace and import components without losing the system structure. Components could begrouped to have a better view of the system. GES comes with a number of standard components, which allows the user to buildhis own simple or complex model.
With the user-defined component and an equation editor, using a GES model decryption language, the user can build his ownnon-linear component. For some projects by TNO large model libraries are developed. These external models could easilyselect in the design phase and is/could automatically connect to the right component in the new model.
The philosophy of the program GES is that model developers on differed fields independent of each other can modulate theirproduct. GES brings the differed business fields together, with the idea that connecting of their models is not the problem. Thisis done by describe the edges of the models with a pair of variables which described the ideal exchange of energy between thesub models. For every physical domain a pair of variables is available to describe the energy flow.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Language structure
Language structureDigits Letter Characters ConstantsIdentifier Local workspace Global workspace System workspace String Unsigned number Factor Exponential expression Multiplicative expression Additive expression Relational expression Equality expression Assigment expression Expression Statement Program
This chapter provides a formal definition of the GES parser-equations for the user defined apparatus and for the init- pre- andpost_function. It describes the legal ways in which tokens can be grouped together to form expressions, statements and othersignificant units. The Parser-equations provide a powerful mechanism for building your code.
GES language syntax report
Digits
0 1 2 3 4 5 6 7 8 9
[top]
Letters
a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
[top]
Characters
Digits and Letters and:
! @# $ % ^ & * ( ) _ + = - | \ { } [ ] : ; " < > , . ? /
remark: not '
[top]
Constants
#pi = 4*atan(1) = 3.14..
[top]
Identifier
Figure 1 Identifier
[top]
Local workspace
Figure 2 Local workspace
[top]
Global workspace
Identifier names in the local, global and system workspace can be concatenated with a string
Figure 3 Global workspace
[top]
System workspace
Figure 4 System workspace
[top]
String
Figure 5 String
[top]
Unsigned number
Figure 6 Unsigned number
[top]
Factor
Figure 7 Factor
[top]
Exponential expression
Figure 8 Exponential expression
[top]
Multiplicative expression
Figure 9 multiplicative expression
[top]
Additive expression
Figure 10 Additive expression
[top]
Relational expression
Figure 11 Relational expression
[top]
Equality expression
Figure 12 Equality expression
[top]
Assignment expression
Figure 13 Assignment expression
[top]
Expression
Figure 14 Expression
[top]
Statement
Figure 15 Statement
[top]
Program
Figure 16 Program
See: user defined component for implementation of this language in a component
[Go to top of page]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Lexical elements
Lexical elementsComments Case sensitivity Punctuators ParenthesesBraces Comma Semicolon Equal sign
This chapter provides a formal definition of the GES lexical elements. It describes the different categories of words-like units(tokens) recognized by the language.
Comments
Comments are pieces of text used to annotate a program. Comments are for the programmer's use only; they are automaticallyskipped from the source text before parsing.
There are two ways to delineate comments: The single line method and the multi line method. Both are supported by GES.
Multi line comments
A multi line comment is any sequence of characters placed after the symbol pair /*. The comment terminates at the firstoccurrence of the pair */ . The entire sequence is automatically skipped from the parser string.
Example:
a = /* declaration */ 10 /* value */ ;
parses as these four tokens:
a = 10 ;
Single line comments
Single line comments allows a single-line comment using two adjacent slashes (//). The comment can start at any position, andextends until the next new line.
Example:
a = 10 ; //declaration of local variable a
Case sensitivity
GES function identifiers are not case sensitive, so Sin(x), SIN(x), sin(x) are equal functions.
But the identifiers for the local and global workspace are case sensitive, so that Sin, SIN and sin are distinct workspacevariables. Remark: An identifier of a workspace can have the same name as a function.
[top]
Punctuators
The punctuators (also known as separators) in GES are defined as follows:
punctuator: one of
( ) { } , ; =
[top]
Parentheses
) (open and close parentheses) group expressions, isolate conditional expressions, and indicate function calls.
Examples:
d = c * (a + b); //override normal precedence
if (y == z) x = x + 1; // essential with conditional statement
sin(x); // function call
sin; // no function but declaration of local workspace
sin = 0;
[top]
Braces
{ } (open and close braces) indicate the start and end of a compound statement.
Example:
if (y == z){x = x +1;!a = sin(x);}
The closing brace serves as a terminator for the compound statement, so a ; (semicolon) is not required after the }, except instructure declarations. Sometimes, the semicolon is illegal, as in the following:
Example:
if (statement)
{ x = x + 1}; // illegal semicolon
else
[top]
Comma
The comma (,) separates the elements of a function argument list.
Example:
d = limit(a,b,c);
[top]
Semicolon
The semicolon (;) is a statement terminator. Any legal GES expression followed by a semicolon is interpreted as a statement,known as an expression statement. The expression is evaluated and its value is discarded. If the expression statement has noside effects, GES might ignore it.
Examples:
a + b; // may be evaluate a + b , but discard value
; // empty expression = null statement
A semicolon is often used to create an empty statement
Example:
if(i<10){;}
[top]
Equal sign
The = (equal sign) separates variable declarations.
In GES the declaration of the workspace variables is done automatically at any point within the code. The default value is zero ifthe variable is not in memory.
Examples:
a = !b = c = 100; // Gives these workspace variables the value 100.
z ; // is equal to z = 0;
[Go to top of page]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Libraries
Libraries
Library List of libraries currently avaiable. A library contains predefined components. To add a componentfrom the library press insert in the menu bar.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Libraries
LibrariesGES package Select libraries
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > limit
limitFunction limit returns an excursion. Syntax limit (value lower, value x, value upper)
Remarks The limit function imposes upper and lower bounds of x. Within the range of the specified limits, x passes throughunchanged. Outside the bounds lower and upper x is clipped to the minimum or maximum bound.
Example LIMIT(-10,-20,100); results is -10
LIMIT(-10, 22,100); results is 22LIMIT(-10,101,100); results is 100
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > linint1d
linint1dFunction linint1d returns an interpolated value. Syntax linint1d(value x, value parameter_index, value column_index);
linint1d(value x, matrix, value column_index);
Remarks The linint1d function interpolates between two data pairs linearly. Extrapolation outside the x-range is performedlinearly. The data pairs are in the parameter list of the component on the position given by argumentparameter_index. The arguments parameter_index and column_index are truncated (behind the decimalpoint).The parameter must be a matrix with at least two columns. Column 0 contains always the Xi values (with Xi< Xi+1) and column column_index contains the Yi values.
parameter_index can be a matrix Example linint1d(3.14,5,2);
parameter(5) of an component contains a matrix [6:3].
For instance:column 0 column 1 column 2
-1 0.1 1.11 0.22 4.51.4 0.34 6.7
3 < i 0.4 8.4 < i
4 < i+1 0.2 6.2 < i+17 -10 0.1
Matrix representation LININT1D
x (3.14) lies between Xi en Xi+1 in Column 0. The result lies between Yi and Yi+1 in column 2 and is:
for parameter index is variable ii;ii = 5;linint1d(3.14,ii,2); //parameter(5) must be a matrix; define for instance: matrix(5,m,n)
lint1d for normal matrix:
b[1,1]=[1,2,4;3,4,7;5,6,7]; //define matrix ba=linint1d(3.14,b,1);
remark:If b is not defined before, define b in argument with [1,1]:a=linint1d(3.14,b[1,1],1);
TNO Structural Dynamics Van Mourik Broekmanweg 6 Send mail to Helpdesk with questions or comments.
www.tno.nl/ges P.O. Box 49, 2600 AA Delft, The Netherlands Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > linint2d
linint2dFunction linint2d returns a bilinear interpolated value of two dimensions. Syntax linint2d(value x, value y, value parameter_index);
linint2d(value x, value y, matrix);
Remarks The linint2d function interpolates linearly between four data pairs. Extrapolation outside the x-range and y-range isperformed linearly. The data pairs are in the parameter list of the component on the position given byargument parameter_index. This argument is truncated (behind the decimal point). The parameter must be amatrix [m][n]. Column 0 must contain the Xi values (with Xi < Xi+1) and row 0 the Yjvalues (with Yj < Yj+1). Thesub matrix [1:m-1,1:n-1] must contain the function values Zi,,j. The elements in the x-direction are:Z1,j,....Zi,,j.....Zm-1,j. The elements in the y-direction are: Zi,1,....Zi,,j,.....Zi,n-1.
Example LININT2D(3.14,0.5,2);
parameter(2) of a component contains a matrix [m=8:n=6]. For instance:
x y->v
column 1-10
column 2-5
column 30
column 41
column 51.5 column n-1
row 1 –1 Z1,1 Z1,3 Z1,n-1
row 2 1
row 3 1.4
row 4 3 Z4,1 Z4,3 Z4,4
row 5 4 Z5,1 Z5,3 Z5,4
row 6 7
row 7
row m-1 Zm-1,1 Zm-1,n-1
Matrix representation LININT2D
The resulting interpolated value of point (3.14,0.5) is calculated in the square Z4,3, Z5,3, Z5,4, Z4,4.
for parameter index is variable ii;ii = 2;linint2d(3.14,0.5,ii); //parameter(2) must be a matrix; define for instance: matrix(2,m,n)
lint1d for normal matrix:
b[1,1]=[1,2,4;3,4,7;5,6,7]; //define matrix ba=linint2d(3.14,0.5,b);
remark:If b is not defined before, define b in argument with [1,1]:a=linint2d(3.14,0,b[1,1]);
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > lmax
lmaxFunction lmax returns the logical maximum of two values. Syntax lmax(value x, value y)
Remarks If x >= y then lmax returns 1.0 else lmax returns 0. Example LMAX(2.34,4.0); results in 0.0.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > ln
lnFunction ln returns the logarithm of base e (the natural logarithm). Syntax ln(value x)
Remarks if x > 0 then ln(x) calculates the natural logarithm of x. For x <= 0 the function is not valid. Because a runtime errormessage is not generated by GES an error terminates the program GES!
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > load
loadFunction load 'filename'. Syntax load ' filename.drw '; load a drawing into the component
load 'filename.ico'; load an icon into the component load 'filename.gob'; load an object fileload 'filenams.bmp'; load a bitmap fileload 'filename.jpg'; load a jpg fileload 'filename.jped'; load a jpeg fileload 'filename.mod' load ges model into modelload 'filename.ges' load ges model into model
Remarks Load from file: drawings, bitmaps, icons, models, code into the component Example 1 load ' /drawings/four_blades.drw ';
Loads a typical drawing file from a the assigned drawings-subdirectory (located in the lib_new subdirectory).Example 2 load model with changing internal model depending on parent parameter list
See also: sys.connecttoparent
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > locate
locateFunction locate returns the index of a row in a matrix for a specific value.
Syntax locate.row(value x, value parameter_index, value row, value col);
Syntax locate.col(value x, value parameter_index, value row, value col);
The default values for row and col are 0.
Remarks Row, col is de start search position for the row in the sub matrix.The row must contain the Xi values (with Xi < Xi+1) andthe colon Yj values (with Yj < Yj+1) for using the function locate.
Row search in de row direction with starting point [row][col]
Col search in de column direction with starting point [row][col] Example Parameter(3) of a component contains a matrix [m=8:n=6]. For instance:
x y->v
column 1-10
column 2-5
column 30
column 41
column 51.5
column n
row 1 3 1row 2 4 3 row 3 5 6 row 4 2 6 7 8 11 19row 5 7 9 row 6 8 10 row 7 9 12 row m 10 16
Matrix representation locate
Locate.row(7.4, 3, 4, 2) looks for a value in row 4 in the matrix of parameter 3. The starting position is column 2, the returnvalue is 3 value between 7 (in column 3) and 8 (in column 4).
Locate.col(7.4, 3, 0, 2) looks for a value in column 2 in the matrix of parameter 3. The startingposition is row 0, the return value is 5 value between 7 (in row 5) and 8 (in row 6).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Locations
Locations
In this screen the system directories can be set.
Help files Select the help directoryModel files Working Include paths
See also: System Directories
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu > Locked
LockedWith this option, it can be prevented to access a mantled component . A locked component is drawn normally. If you select alocked component in the edit equations mode you can look in this component, using the open lock (see above) menu-item.
Note: It should be noted that the local workspace of the locked component is the global workspace for the components insidethe locked component. This is not the case when the component is mantled.
Example of a locked component. Notice the small lock icon in the tree-window.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Model > Log file
Log fileThe log-file gives information about the GES process. The number of history log files can be set in the options menu.
The recent GES log file is ges.log and is placed in the working directory of GES.
The history log files have an extension number.
In the log-file is set:
The time of starting the GES program. The opening model file with the name of the GES version. The apparatuses which are calculated The iteration error. The last calculated apparatus if there is an error.
A typical log-file is:
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > log
logFunction log returns the logarithm of base e (the natural logarithm). Syntax log(value x)
Remarks if x > 0 then log(x) calculates the natural logarithm of x. For x <= 0 the function is not valid. Because a runtimeerror message is not generated a error terminates the program GES!
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > log10
log10Function log10 returns the logarithm of base 10. Syntax log10(value x)
Remarks if x > 0 then log10 calculates the logarithm of x on base 10. For x <= 0 the function is not valid. Because a runtimeerror message is not generated by GES a error terminates the program GES!
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > lookvalstr
lookvalstrFunction lookvalstr returns the value of a workspace variable given in a string. Syntax lookvalstr 'string';
Remarks This function is used to get the value of a workspace variable whit's given in the string. Example aa = 10;
lookvalstr ‘aa’;
Returns the value of aa (10).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions
Manipulation functionsincludeinit_function end_function
valstr
lookvalstr
sum_parameter sum_workspace sum_workspace.localtree post_function postenergie_function pre_function
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu > Mantle
MantleWith this option you can mantle selected components. In this mode you can put different (model)-components in onecomponent (the mantle-component). The name of the mantled component changes and is now beginning with m_ and isappended with the name of the first selected component. This mantle component has the same number of gates as theselected component.
If the selected components has connections with other components the number of gates of the mantled component is adjusted.The minimum number of gates is always one because otherwise you could not select the component.
The mantled component is drawn with a dotted line. To see the contents of the mantled components double click on themantled component.
Fig. the difference between a normal, mantled and masked component
To dismantle the components choose dismantle in the component popup menu.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Maritiem library
Maritiem libraryFirst principle maritiem models; ship resistance, propulsors, engines.
Propeller, Wageningen B-series Propeller, Four quadrant CPP based on Wageningen B seriesPropeller, Ka4-55 19A NozzlePropeller, Ka4-70 19A NozzlePropeller,Whale tailPropeller, Gawn-seriesPropeller, Gutsche and SchroederSSP propulsor SiemensPOD Calculation module propeller diameter
Ship resistance, HoltropShip resistance, Cf Ca CwShip resistance, User defined
Ship hull, HoltropShip hull, generalShip hull, merchant ships
Waterjet, Cp CtWaterjet, databaseWaterjet, basic
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Failure Module > Markov
MarkovThis model gives an exaple of a Markov model in GES.
More information about the markov model can be found in this document. Source: www.isograph-software.com
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu > Masked
MaskedWith this option you can mask a selected mantled component. You mask a component for preventing it to be calculated. If youwant to mask a not-mantled component you must first mantle the component. A masked component is drawn with a thick blue line. If the selected component is correct the following window is opened.
Fig. the difference between a normal, mantled and masked component
Remarks:With a run component you can simulate masked components individually. A component can easily be unmasked by clickingagain on the "masked" item and then changes to a mantled component.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions
Mathematical functionsabs acos asin atan atan2 binom
cos cosh exp fac limit
linint1d linint2d lmax ln log log10 max min mod polint1d pow pow10 randomroot round sgn sin sinh sqr sqrs sqrt tan tanh trunc
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Interface functions > Matlab
MatlabGES provided functions to access with MATLAB.Matlab Functions
eval_matlab Evaluate a MATLAB string in MATLABput_matlab Put a GES variable or parameter matrix in MATLABget_matlab Get a variable from MATLABget_matlab_matrix Get a matrix from MATLAB
There exists an automatic link between GES and Matlab/Simulink. If a MATLAB path in WINDOWS exist GES use the following Matlabdll's:- libeng.dll - libmat.dll - libut.dll - linmx.dll
In the following example, the equations are given which are used. The explanation is given behind the '//' characters.
Example (equations of a user defined component):
/* Demo matlab transformer We use Simulink model: matlabtransformer.mdl */
eval_matlab 'cd c:\ges\matlab'; //set workdirectory in matlab of model//eval_matlab 'matlabtransformer;'; //view the Simulink model (calculation is than slow)put_matlab(parameter(0))'gain'; //put gain parameter in Matlab variable gainput_matlab(parameter(1))'eff'; //put efficiency parameter of GES in Matlab variable effinit_function;put_matlab(f_gate(0))'f0'; //put the flow in matlab variable f0//eval_matlab "sim('matlabtransformer')"; //example run the Simulink modeleval_matlab "sim('",name_parameter(2),"')"; //run the Simulink modelf_gate(1)=get_matlab 'f1'; //put the results in gate 1put_matlab(e_gate(1))'e1'; //put the effort in matlab variable e1eval_matlab "sim('",name_parameter(2),"')"; //run the Simulink modele_gate(0)=get_matlab 'e0'; //get result and set in effort of gate 0
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Matrices
MatricesA matrix in GES is defined a follows:
a = [1,2,3;4,5,6;7,8,9] //a is a 3x3 matrixb = a(1:2;1:2) //b is a submatix of a
More examples can be found in this model. The matrices can be opened in the inspect state window by clicking on the variable.
Different matrix operations are possible in GES.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > matrix
matrixFunction matrix returns or sets an element value of a parameter matrix.
Syntax matrix(value x, value row, value column);
Remarks x is the index number of the parameter. The first parameter index of the apparatus starts with 0,.....,etc. Thefunction is not executed if the index number is not present. The index values row and column are truncated(behind the decimal point). The function returns or sets the element value of the matrix. Be careful if theparameter is not a matrix. GES could be terminated.
Example Example 1:
matrix(0,0,0)=10; //sets the first element of the parameter matrix on 10
!a = matrix(0,0,0); //sets the global variable a with a parameter matrix //element
Example 2:
matrix(18,!!step,0)=p_gate(0)/1000; // delivered power [kW]
In this case the function matrix puts the right value on the right place in the matrix. In this example, the power ofgate(0) (in kW, divided by 1000) is put on the place !!step of column 0.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > max
maxFunction max returns the maximum of two values. Syntax max (value x, value y)
Remarks If x >= y then max returns x else max returns y. Example max (2.34,4.0); results in 4.0.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > Mean value
Mean valueThe Mean value gives the average of the signal on e_gate(0) over the averaging period.
Parameters Parameter(0) is the averaging period in seconds.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu
MenuFile Make new, open, save, print and preview files.Edit Cut, copy, paste, delete and select all.View Change the view of the diagram.
Insert Insert default components and components from libraries.
Simulation Run simulation and change simulation settings.Format Change colors and fonts used in the diagram.
Tools Protection, show log, options..Window Change arrangement of the diagrams. This can also be done by using the buttons in the toolbar.Help Help contents, help for selected component, link to website and About...
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Simulation
Simulation
Run Window Open window with simulation procesStop Stop simulationSetup Edit simulation parameters
Parameters Manage parameters used in simulationPlot window Sets a screen to plot result data in 2DRead GES data Save GES data Parse model This option is useful when include files are changed. All equations for the model are parsed again, to
reflect the changes in the include files.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > messagebox
messageboxFunction MESSAGEBOX shows a messagebox on the screen. Syntax MESSAGEBOX 'string';
Remarks This function shows a message on the screen. The part of the string up to a comma (,), if present, is the text andthe text after the comma the caption of the box. Output of this function is 1 if the user presses the OK-button and 0if the user presses the CANCEL-button.
Example Example 1: messagebox 'text,caption' init_function;
Example 2:messagebox' TITLE MESSAGEBOX----------------------------------------------ship speed : ',valtostr(Vs,"%3.3lg"),' m/sship speed: ',valtostr(Vs_kn,"%3.3lg"),' knotsresistance: ',valtostr(e_gate(0)/1000,"%3.3lg"),' kN',',',name_component;
init_function;
Run this messagebox model for an example.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > min
minFunction min returns the minimum of two values. Syntax min(value x, value y);
Remarks if x >= y min returns y else min returns x. Example min(2.34,4.0); results in 2.34.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > mod
modFunction Calculates x modulo y (the remainder f, where x = ay + f for some integer a, and 0 < f < y). Syntax mod(x,y)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Model
Model
Connect Check gate dimension Auto change gate direction Auto create causal element
Open most resent file at startup
'Include' use '*.gob' files Only if '*.equ' file missing
Inspect system workspace Include shared workspace Use external editor for include
Log files in history Log fileShow messages Show parameters Show plots Show figures Show math errors Show system help Show junctions in tree Show %comment in variable Show model tree Show hint gate Show hint tree
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > name_component
name_componentFunction name_component sets or gets the name of the component. Syntax name_component ‘string’
Remarks The string is used to set the name. Example name_component‘new’, name_component puts new every time for the name.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > name_model
name_modelFunction name_model gets the name of the component. Syntax name_model
Example name_parameter(0) name_model; sets in name parameter(0) the name of the
program of the name of the first locked component.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > name_parameter
name_parameterFunction name_parameter sets or gets the string of parameter field name of the component. Syntax name_parameter(value x) ‘string’; [set name parameter]
if string contains one punt comma text after ; it is set as unit_parameterif string contains two punt commas text after first ; it is set as valuetext after second ; is set as unit_parameter
name_parameter(value x) [get name parameter]
Remarks The truncated (behind the decimal point) x value is the parameter index in the apparatus. The function is notexecuted if the parameter index number is not present. The first parameter index starts with 0,....., etc. For thename only the first 30 characters of the string will be used.
Example name_parameter(11) 'par',name_parameter(10); sets the name parameter of parameter 11 to par concatenated to
the name of parameter 10.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component initialisation functions > neg_gate
neg_gateFunction neg_gate sets a negative energy flow direction of a gate. Syntax neg_gate (value x)
Remarks The truncated (behind the decimal point) x value is a gate number of the apparatus. Thefunction is not executed if the gate number is not present. A negative energy flow is an energy flow out ofthe apparatus.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > nr_gates
nr_gates, #gatesFunction nr_gates returns the number of parameters for the component. Syntax nr_gates of #gates
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > nr_parameters
nr_parameters, #parametersFunction nr_parameters returns the number of parameters for the component. Syntax nr_parameters or #parameters
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > n-th order filter
n-th order filterChange the matrix size in order to change filter order, and fill the matrix with the radial frequencies corresponding to the n-thcomponent of the filter.
Parameters Parameter(0): Matrix with the radial frequencies s1 t/m sn.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > numtostr
numtostrFunction numtostr writes a variable value in integer format to an output string. Syntax numtostr (variable)
Example vs = 3.14;
numtostr(Vs);
Writes the variable Vs to a string.The format string is: '3'
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Operational profile library
Operational profile libraryStatic efficiency and ecomic maritime models based on statistics
Ship Work Breakdown StructureElectric motor, AC, PM, DCElectric motor, from databaseElectric generator, from database
TransformerTransformer, from database
Switch boardsAuto switch boards
Fuel tanksDiesel enginesDiesel engine, from databaseGasturbinesGasturbine, from database
ShaftsConverters
RectifiersInvertersChopper
Fuel cellsFuel cells, from database
PV arrays
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Tools > Operational profile
Operational ProfileQuick startOperational profile with COM interface (Dutch)
The operational profile concept in GES is a module with al kinds of components to build a propulsion system with integratedpower system of a ship. This method is especially useful in comparing different preliminary designs. For example, in designingthe on-board energy management, a fully comprehensive system analysis of all the relevant energy components is necessary.Due to the open architecture of GES, many aspects are included in the simulation, such as initial purchase costs, maintenanceand operational costs, size and weight of the installation, fuel consumption and efficiency, availability, and exhaust emissions.Within the framework of the Netherlands national AES-study of the NIM an extensive component library has developed,containing models for most of the components that can be found in a propulsion and energy system of all kind of vessels. Thecomponent library is developed by three participants in the AES-study: TNO, RNLN and the Netherlands research instituteKEMA. For this concept it is necessary to have the operational profile of the ship.
Parts of the operational profile concept are used in ADEPT.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options
OptionsDiagram SimulationSolution Process Model Locations Libraries Popup libraries Add Ins
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > P constant (effort out)
P constant (effort out) input output
gate energy variable symbol unit variable symbol unit
0 pos flow f [-] effort e [-]
Table 1 Gate variables P constant (effort out)
The equation for this component is:
P is the constant power of the component
If the gate is positive then the constant power is the dissipation of the component. If you change the gate energy too negative, thenthe component delivers power.
Parameter(0):The internal power of the component.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > P constant (flow out)
P constant (flow out) input output
gate energy variable symbol unit variable symbol unit
0 pos effort e [-] flow f [-]
Table 1 Gate variables P constant (flow out)
The equation for this component is:
P is the constant power of the component
If the gate is positive then the constant power is the dissipation of the component. If you change the gate energy too negative, thenthe component delivers power.
Parameter(0):The internal power of the component.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > P Distributor effort out
P Distributor effort outA distributor can be used to split the energy flow of a gate with a certain factor to two gates. The component has three gates. Thepower equations are:
Pin1 = Pout fac Pin2 = Pout (1-fac)
fac is the distributor factor.
Hence,
Pout = Pin1 + Pin2
Because in GES the power is a product of effort and flow, two distributors can be defined. Firstly an effort out-distributor, where theoutput gate has an effort variable as input. Secondly a flow out-distributor, where the output gate has a flow variable as input.
input output
gate energy variable symbol unit variable symbol unit
0 neg effort e [-] flow f [-]
1 pos flow <0> [-] effort e [-]
2 pos flow <1> [-] effort e [-]
Table 1 Gate variables P Distributor effort out
The internal equations for the P Distributor effort out are:
Parameter(0):Is the distributor factor. The default value is 1.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > P Distributor flow out
P Distributor flow outA distributor can be used to split the energy flow of a gate with a certain factor to two gates. The component has three gates. Thepower equations are:
Pin1 = Pout fac Pin2 = Pout (1-fac)
fac is the distributor factor.
Hence,
Pout = Pin1 + Pin2
Because in GES the power is a product of effort and flow, two distributors can be defined. Firstly an effort out-distributor, where theoutput gate has an effort variable as input. Secondly a flow out-distributor, where the output gate has a flow variable as input.
input output
gate energy variable symbol unit variable symbol unit
0 neg Flow f [-] effort E [-]
1 pos Effort <0> [-] flow F [-]
2 pos Effort <1> [-] flow F [-]
Table 1 Gate variables P Distributor flow out
The internal equations for the P Distributor flow out are:
Parameter(0):Is the distributor factor. The default value is 1.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component initialisation functions > p_unit_gate
p_unit_gateFunction p_unit_gate sets the power unit name of a gate. Syntax p_unit_gate(value x) ‘string’
Remarks The truncated (behind the decimal point) x value is the gate number of the apparatus. Thefunction is not executed if the gate number is not present. The first gate number starts with 0,.....,etc. Thestring can be 64k characters long. For the name only the first 10 characters of the string will be used.
If this function is not used the default string is ‘[W]’. Example Set the unit of the power of gate 3 with name [W].
p_unit_gate(3) ‘[W]’;
This name can also be set in the edit gate mode.
see also: unit_gate
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Parameter Change param var
Parameter Change param var input output
gate energy variable symbol unit variable symbol unit
0 no no p [-] flow [-]
Table 1 Gate variables set component
The par component changes a parameter of the connected component until the set-point value of the set component is reached.You must always use a par component and a set component together.
Parameter(0):Is the iteration start value of the parameter change routine in GES. It is recommended to use an expected value in the neighborhoodof the solution. If there are more solutions you must choose this value properly.
This start value is only used in the first step of the program. For the following steps the solution of the previous is used as startvalue. By strong changing of the set point there could be problems if the system converge near a system boundary. The user canforce the start value for every step by the following parser code in the par component:
f_value(0)=parameter(0);
pre_function;
or
post_function;
For every step in the system the start value of the par component is parameter(0).
Parameter(1):Is the index number of the parameter of the connected component. If the parameter of the connected component is a matrix theposition in this matrix must be given by parameter(3) and parameter(4).
Parameter(2):This value is the row number of the matrix of the parameter of the connected component. This value is only used if the controlledparameter is an element of a matrix.
Parameter(3): This value is the column number of the matrix of the parameter of the connected component. This value is only used if the controlledparameter is an element of a matrix.
Parameter(4):
You can use this parameter to change other parameters of some components at the same time. The output value (changingparameter value) of this component could be set in an internal global buffer of GES (indicated by a number between 0-99) or setinto the global workspace (recommended!!). If the user uses a global workspace variable in the par component it is not necessary toconnect the par component to a compoment.
pre function of par component
If the par component has a pre function this pre function is collect first before all the other pre functions in the system. This makes itpossible to write a special controler for the model in the pre function of the par component.
E.g. the user can change the changing parameter value to a other parameter by using global variables in the system. The method isas follows: Set in parameter(4) a local variable (e.g. A). In the pre function of the par component can set as example:
if (A>10) !B=A;
else !C = A;
pre_function;
The global variables !A and !B can be placed in a parameter list of two independent components, so it is possible to switch betweencomponents during the iteration proces for parameter changing.
Example of using par- and set components
In Figure 1 a GES example is given for changing a parameter (by the par component) of the diesel engine until the set-point value ofthe set component is reached. The set-point value could be the flow (the speed of the ship) of the gate between the Hull_Prop_Rotcomponent and the Resis. component.
Figure 1 Parameter changing with set- and par component
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Parameter Change set point
Parameter Change set point input output
gate energy variable symbol unit variable symbol unit
0 no no p [-] flow [-]
Table 1 Gate variables set component
The set component is used as a set-point in the system. The par component changes a parameter in the system until the set-pointvalue is reached. You must always use a set component with a par component as a pair. GES solves the system for more than onepair of set-par components. The set-point value can be the flow, effort or power of a gate. In the parameter list of the set componentyou choose the set-point variable and the gate number of the connected component that you will use as a set-point.
Parameter(0):This parameter is the set-point value. The energy type is defined with parameter(1).
Parameter(1):is the number of the set-point type. There are four types: 0, 1, 2 and 3.
set-point type 0 is the effort of the gate.
set-point type 1 is the flow of the gate.
set-point type 2 is the power of the gate.
set-point type 3 is the efficiency of the gate.
Remark:
If the set-point type is negative the user can switch off the set-point controller from the system, without removing the set component.This is very useful if temporary in the calculation process not a set-point in the system is necessary.
Parameter(2):This parameter is the gate number of the controlled gate of the connected component. Running GES changes the par componentsuntil the set-point values of the controlled gates are reached.
Parameter(3):This parameter multiplies the set point error with the factor lambda. If Lamda is zero no solution is found.
TNO Structural Dynamics Van Mourik Broekmanweg 6 Send mail to Helpdesk with questions or comments.
www.tno.nl/ges P.O. Box 49, 2600 AA Delft, The Netherlands Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > Parameter
ParameterFunction parameter returns or sets a parameter value of the component.
Syntax parameter(value x);
Remarks The truncated (behind the decimal point) x value is the parameter index number of the component. The firstparameter index of the component starts with 0,.....,etc. The function is not executed if the index number is notpresent. If the parameter is a matrix this function has no effect.
If parameter is a matrix the matrix element on position m,n is set or get by syntax (m,n)
Syntax PARAMETER (value x)(m,n);
Example Example 1:
parameter(0) = 10; //sets the first parameter in the list on 10
!a = parameter(0); //sets the global variable a with parameter(0)
Example 2:
parameter(0)(3,4) = 10; //sets element 3,4 of parameter 0 on 10
!a = parameter(0)(2,1); //sets the global variable a with element 2,1 from parameter(0)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component mathematical functions > nr_gates
#parametersFunction #parameters is a constant that returns the total number of parameters of the component Syntax #parameters
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Simulation > Parameter Setup
Parameter Setup
In this menu you can change the parameters of an apparatus in a few steps. In the Free entities tree box the apparatuses arelisted. The selected parameters for variation in steps are listed in the Variated entities. The actual parameter value is given inthe Current field. In the From and To fields you must set the minimum and maximum required value of the parameter. If theselected parameter is a matrix you must set the element indexes in the m and n fields.
> Button
Places a selected parameter of the Free entities box to the Variated entities box.
< Button
Places a selected parameter of the Variated entities box to the Free entities box.
Clear button
By clicking on the Clear button you can remove the parameters from the Variated entities list.
Number of steps field
You can set or change the number of steps in Numbers of steps field. This number changes also the Number of output steps.
The default number of steps is one. For varying a parameter from the minimum until the maximum value a step size of 100 isrecommended
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > PD-controller
PD-controllerLinear first order PD controller with the response function π/(s/(2*π*f1) +1).
Parameters Parameter(0): π (pi)Parameter(1): f1
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > PID-controller
PID-controllerLinear PID controller set by the three parameters corresponding to the parameters in the time or radial frequency domain (forDi and Li).
Parameters Parameter(0):PiParameter(1):DiParameter(2):Li
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Pipe Resistance CW
Pipe Resistance CW input output
gate energy variable symbol unit variable symbol unit
0 pos flow dV/dt [m3/s] effort Pi [N/m2]
1 neg effort Pu [N/m2] flow dV/dt [m3/s]
Table 1 Gate variables Pipe Resistance CW
This component describes the pipe resistance for Re > 2300 (turbulent flow).
See for the equation Pipe resistance lambda. For turbulent flows in rough pipes the resistance value of Colebrook and White ischosen, where λ is:
K is roughness.
Parameter(0): Is the length of the pipe.
Parameter(1):Is the diameter of the pipe. If the pipe is not circumferential, you can use d is 4* flow area / wet outline.
Parameter(2):Is flow area. If this value is 0, GES calculates a circumferential area with diameter Parameter(1).
Parameter(3):Is mass density ρ [kg/m3].
Parameter(4):Is the roughness. The default value for steel pipe is 0.8e-3 m.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Pipe Resistance lambda
Pipe Resistance lambda input output
gate energy variable symbol unit variable symbol unit
0 pos flow dV/dt [m3/s] effort Pi [N/m2]
1 neg effort Pu [N/m2] flow dV/dt [m3/s]
Table 1 Gate variables Pipe Resistance lambda
This component can be used to described pipe resistance in the following form:
The usual expression for pipe resistance is:
v is velocity of the liquid flow [m3/s]
ρ is density [kg/m3]
l is length of the pipe [m]
d is diameter of the pipe [m]
λ is resistance constant [-]
The resistance constant λ depends of the Reynolds constant Re.
Re is defined as:
η = dynamic viscosity [Ns/m2]
v = kinematic viscosity [m3/s]
In GES the flow variable is expressed in m3/s. The effort variable is the pressure Δ P. Then the effort variable is written as:
To determine λ two area's must be discerned.
- laminar flow: Re < 2300
- turbulent flow: Re > 2300
Parameter(0): Is the length of the pipe.
Parameter(1):Is the diameter of the pipe. If the pipe is not circumferential, you can use d is 4* flow area / wet outline.
Parameter(2):Is flow area. If this value is 0, GES calculates a circumferential area with diameter Parameter(1).
Parameter(3):Is resistance constant λ [-].
Parameter(4):mass density ρ [kg/m3].
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Pipe Resistance re
Pipe Resistance re input output
gate energy variable symbol unit variable symbol unit
0 pos flow dV/dt [m3/s] effort Pi [N/m2]
1 neg effort Pu [N/m2] flow dV/dt [m3/s]
Table 1 Gate variables Pipe Resistance re
This component describes the pipe resistance for Re < 2300 (laminar flow).
λ is assumed to be 64/Re. See for the equation Pipe resistance lambda.
Parameter(0): Is the length of the pipe.
Parameter(1):Is the diameter of the pipe. If the pipe is not circumferential, you can use d is 4* flow area / wet outline.
Parameter(2):Is flow area. If this value is 0, GES calculates a circumferential area with diameter Parameter(1).
Parameter(3):Is mass density ρ [kg/m3].
Parameter(4):Is the Reynolds constant Re.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Simulation > Plot Window
Plot WindowThere are two types of plotwindows in GES: Basic and Extended.
The layout of the Simple plot routine is also used in GES version 1.08
The Extended plot routine is available in GES version 1.10.
In a plot window you can plot your results as a linear graph of 2D data. You can also make a set of data. If you choose thismenu a window for plotting your data is opened. You can open more than one plot windows.
If you click on one of the gates of an apparatus (the black and the white rectangle confirms this selection), and then use theright mouse key, the plot option appears.
In the pull down menu item, the component can be chosen which should be plotted (in this example, dieselengine+governor).With this selection the choice now can be made (pull down menu marked with fx) which energy related variable should beplotted. A choice can made between, effort, flow, power, dissipation and efficiency.
The push-pin option can be used to fix the plot window of one simulation and compare it with a second simulation (with differentparameter values). After the second simulation, again the plot (right mouse click) should be chosen, to generate a secondresult-plot in the same plot-window.
The chart as shown above can be exported in different graphical formats. Available are:
*.bmp bitmap*.emf enhanced metafile*.wmf windows metafile
The chart also can be saved as list of numerical values in a comma separated format (*.csv), which can be imported in anExcel-sheet.
See also: sys.plot
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Pointers
PointersA variable in GES could contain a address of a variable.
The value of this variable is get or set if an asterisk(*) is placed for the address that is stored in a variable.
For instance:If the address of variable aa is stored in bb.Then the value of aa is *bb.
cc = *bb;The value of pointer bb is stored in variable cc.
*bb = cc;The value of cc is stored in the variable aa. bb contains address aa.
Reference
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > polint1d
polint1dFunction polint1d returns an interpolated value. Syntax polint1d (value x, value parameter_index, value column_index)
Remarks The polint1d function interpolates between two data pairs with a second order polynoom. Extrapolation outside thex-range is performed linearly. The data pairs are in the parameter list of the component on the position given byargument parameter_index. The arguments parameter_index andcolumn_index are truncated (behind the decimalpoint).The parameter must be a matrix with at least two columns. Column 0 contains always the Xi values (withXi < Xi+1) and column column_index contains the Yi values.
Example polint1d (3.14,5,2);
parameter(5) of an component contains a matrix [6:3]. For instance:
-1 0.1 1.11 0.22 4.51.4 0.34 6.73 < i 0.4 8.4 < i
4 < i+1 0.2 6.2 < i+17 -10 0.1
Matrix representation POLINT1D
x (3.14) lies between Xi en Xi+1 in Column 0. The result lies between Yi and Yi+1 in column 2.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Popup Libraries
Popup Libraries
Library List of libraries currently avaiable in the popup menu. A library contains predefinedcomponents. To open the popup menu click on the right-mouse button in thediagram and select insert. To manage the libraries use the buttons below the list.
Show junctions in popup libraries Display/hide junctions in the popup menu
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component initialisation functions > pos_gate
pos_gateFunction pos_gate sets a positive energy flow direction of a gate. Syntax pos_gate(value x)
Remarks The truncated (behind the decimal point) x value is a gate number of the apparatus. Thefunction is not executed if the gate number is not present. A positive energy flow is an energy flow to thecomponent.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > post_function
post_functionFunction post_function defines functions to be executed after the energy calculation. Syntax post_function;
<GES source code block>post_function;
Remarks This function is used to as a delimiter in the source code. All function before this delimiter and after anotherdelimiter, if present, are executed after the energy calculation. init_function, post_function, e_gate and f_gate alsoact as delimiters.
This function could also be used as a normal function. The syntax is:
post_function{<GES source code block>}
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions > post_type
post_typeFunction post_type sets the apparatus in the post-calculation mode. Syntax post_type
Remarks This function is used to give an apparatus priority for execution in thepost calculation mode. This mode is necessary if some calculations are requiredafter the overall calculations.
Be careful: If this function is used once and this function is removed from theparser string the apparatus remains a POST_TYPE. We recommend always atype setting command when firstly using an apparatus type setting.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > postenergie_function
postenergie_functionFunction postenergie_function defines functions to be executed after the energy calculation. Syntax postenergy_function
Remarks This function is used to as a delimiter in the parser string. All function before this delimiter and after anotherdelimiter, if present, are executed after the energy calculation. init_function, post_function, e_gate andf_gate also act as delimiters.
Example The function is calculated direct after the energy calculation of the model. If there is a iteration process the
function isexecuted continue in the iteration process.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > pow
powFunction pow returns x to the power of y. Syntax pow(value x, value y)
Remarks x is unrestricted. Pow calculates x y.Also in GES could be used x ^ y
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > pow10
pow10Function pow10 returns 10 to the power of x. Syntax pow10(value x);
Remarks x is unrestricted. pow10 calculates 10x .
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > pre_function
pre_functionFunction pre_function defines functions to be executed after the pre-type functions. Syntax pre_function;
<GES source code block>pre_function;
Remarks This function is used to as a delimiter in the GES source code. All function before this delimiter and after anotherdelimiter, if present, are executed after the energy calculation. init function, post_function,e_gate and f_gate also act as delimiters.
This function could also be used as a normal function. The syntax is:
pre_function{<GES source code block>}
The function is calculated direct before the energy calculation of the model. If there is an iteration process thefunctionis executed continue in the iteration process.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions > pre_type
pre_typeFunction pre_type sets the apparatus in the pre-calculation mode. Syntax pre_type
Remarks You can give an apparatus priority for execution in the pre calculation mode. This mode is necessary if somecalculations are required before the overall calculations.
Be careful: If this function is used once and the function is removed from the parser string the apparatus remainsa pre_type. We recommend always a type setting command when firstly using an apparatus type setting.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Tools > Probox
ProboxProbox is a probabilistic toolbox. Which is developed at TNO Built Environment and GeoSciences.
Email [email protected]
With the use of GesModel.dll and ProGes.dll by Probox an interface with GES is possible. The interface uses the LAN.
In GES the Ges Network must be start and set on Listen.
By Adding the GesModel.dll in Probox a dialogbox appear to log into the GES network
In the root of the GES model are first placed the Probox variables. These root variables are automatically globals for the GESmodel.
The number of used Probox variables must be set in the global GES variable: PROBOX_VARIABLES
For instance: a GES model with the output variable sigma and input variable F
sigma '"sigma", "N/m2" , "OUTPUT", "SCALAR", "resulting stress" ';F '"F" , "N" , "INPUT" , "SCALAR", "applied load" '; PROBOX_VARIABLES = 2; init_function;
An internal GES model is for instance:
crosse=30; init_function;
force = !F; sigma = force/crosse;f_gate(0)=sigma;
!sigma=sigma; post_function;
!F and !sigma are the GES root variables.
Example: examples\protest.mod
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > The structure for physical systems
GES The structure for physical systemsGes used for the in- and outputs the bond graph notation. The components of GES are based on block-diagram structures, butthe description of the components is textual.Every gate of a component is expressed as a half arrow with two variables (effort and flow) and the product is power in thedirection of the half arrow.For every gate is for the variable (effort or flow of the gate) an equation defined, depending on the other gate variables.
The ges programming language is block structured, The gate functions (with effort and flow) described the physical behaviour of the component. For initialisation, pre and post calculations in the component additional equations can be defined.All the equations blocks are placed together in the equation editor to have overview. More than one init, pre and post functionblocks can be defined in the component.
The first comment block in the code can be called with the help key F1 or help button.
1. Help block
The block start with /* and end with */
Results in messagebox
2. Initialisation function
The initialisation function block(s) runs in the first simulation step.
Syntac:
<code> init_function or init_function{ <code>};
//end other block definition.…………….…………….Init_function;
Or
Init_function {…………..…………..};
Only in the first step these equations are execute. More than one block can be defined in the code on different places and theyare cat together and also execute together.During the simulation all the init blocks of the components are running together ones.
3 Pre function
The pre function block(s) runs by every simulation step.
Syntac:
<code> pre_function or pre_function{ <code>};
//end other block definition.…………….…………….pre_function;
Or
pre_function {…………..…………..};
For every step are these equations executed. More than one block can be defined in the code on different places and they arecat together and also execute together.During the simulation all the pre blocks of the components are running together.
4 Gate functions
For every gate only one effort of flow function can be defined. The gate has an index number started with 0. All the gates mustbe defined and only ones else ges gives a warning. The equation block of the gates is in depended and the execution isdepending on the structure of the model. The gate definition is in depended of the gate sequence in the code. For 3 gates withindexes 0, 1, 2. The sequence can be gate(1), gate(2), gate(0)
An effort has the keyword e_gate and a flow keyword f_gate. The keywords are always followed by index number #.
For effort function:
<code>e_gate(#) = <code>;
or;
e_gate(#){<code>e_gate(#) = <code>;};
For flow function:
<code>f_gate(#) = <code>;
or;
f_gate(#){<code>f_gate(#) = <code>;};
Definition gate 1 for effort is:
// end other block definition (for instance: init_function; pre function;f_gate(#) = ,,,,)……….a = b * 3;e_gate(1)=a;
or;
e_gate(1){a = b * 3;e_gate(1)=a;}
5 Dependency of the gates
If the keyword e_gate(#); or f_gate(#); is defined free then the key word is used as depended gate function even as: b =e_gate(#); but no assignment.So a gate can be depended of other gates for instance e_gate(1) is depended of f_gate(0) and e_gate(2) like:
a = f_gate(0);b = e_gate(2);a = b * 3;e_gate(1)=a;
so e_gate(1) = function of f_gate(0) and e_gate(2);but
a = f_gate(0);
b = e_value(2);a = b * 3;e_gate(1)=a;
is not depended of e_value(2)
and
f_gate(0);b = e_value(2);a = b * 3;e_gate(1)=a;
e_gate(1) is a function of f_gate(0); but executed if f_gate(0) is first executed
6 Gate vector functions.
Effort and flow gate vectors can be defined with dimension m for gate number # as:
e_gate(#,m);
or
f_gate(#,m);
Before the gate function is worked out.Gate effort function definition is:
e_gate(#,m) { <code>e_gate(#,0)=<code>;<code>e_gate(#,i)=<code>;<code>e_gate(#,m-1)=<code>;}
Gate flow function definition is:
f_gate(#,m) { <code>f_gate(#,0)=<code>;<code>f_gate(#,i)=<code>;<code>f_gate(#,m-1)=<code>;}
For instance effort vector with enthalpy 42780 kJ/kg and density 835 kg/m3
e_gate(0,2){e_gate(0,0)=42780;e_gate(0,1)=835;}
Results in
With vector values
7 Remark equation definitions
Equation blocks without function keywords are not executed.For instance:
//c has no function keyword and shall never be executed
a=b*3;init_function;
c =a*3; //no function keyword
//c has no function keyword and shall never be executed
a=b*3;init_function; //end function definition
c =a*3;
f_gate(0){ //start gate function definition, so c is not in function blockdefinedf_gate(0)=4;}
//cat equation blocksa=b*3;init_function;
g =7;pre_function;
c =a*3init_function;
is the same as:
a=b*3;c =a*3init_function;
g =7;pre_function;
8 Ges Calculation sequence for the model.
The execution sequence of the blocks for all the components in the model is:
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Propellor (2 coefficients)
Propellor (n Kt Kq coefficients) input output
gate energy variable symbol unit variable symbol unit
0 neg flow Va [m/s] effort T [N]
1 pos flow ω [rad/s] effort Q [N/m]
Table 1 Gate variables Propeller
The propeller is characterized by its open water performance as represented in the Kt - Kq - J diagram. An important parameter forthe thrust of the propeller is the axial displacement per revolution or Va / n. This can be expressed in non-dimensional term as theadvance ratio J:
D is the propeller diameter, n is the rotation rate (s-1) and Va is the undisturbed velocity upstream of the propeller.
The trust T and the torque Q are usually made non-dimensional with the tip speed of the propeller and the propeller diameter D. r isthe density of the fluid.
The thrust coefficient Kt is:
and the torque coefficient Kq is:
The efficiency of the propeller is defined without interference between propeller and hull and with uniform inflow. The propellerperformance at uniform flow has the characteristics as given in the following figure. The characteristics of Kt en Kq can beexpressed in one figure by plotting 10 Kt instead of Kt.
Figure 2 Open water diagram of a propeller
In this propeller component the Kt and Kq characteristics must be specified as polynomials with coefficients in parameter(2).
Parameter(0): Is the diameter propeller [m].
Parameter(1):Is the fuel mass [kg/m3].
Parameter(2):Contains the coefficients of the polynomials Kt and Kq characteristics.
Column 1 contains the Kt coefficient's c*. In order c0 + c1 J + c2 J^2 + ...
Column 2 contains the Kq coefficient's d*. In order d0 + d1 J + d2 J^2 + .....
ExampleColumn 1 Column 2 c0 d0 c1 d1 cn dn
Parameter(3):Is the active number of coefficients to be used. For the Kt and Kq polynomials the number can be less than the number of rows(maximum coefficients) of parameter(2).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu> Properties
PropertiesInfo
Gates
Drawing
Function
Properties
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu> Properties > Drawing
Drawing
you click on the button Export, the drawing of the selected apparatus is written to the file.
The format of the drawing is:
Text format of the drawing. Format code between the brackets [ ] is optional.
(Number of points) (number of columns) [x scale] [y scale] [z scale] [comment] x-position y-position z-position line-output # [line color] [comment] . . . . . . . . . .
[(number of gates) (gate number) x-position, y-position, z-position, object nr, [color nr] //start of energyvector (gate number) x-position, y-position, z-position, object nr, [color nr] //end of energyvector //empty line (gate number) x-position, y-position, z-position, object nr, [color nr] (gate number) x-position, y-position, z-position, object nr, [color nr]
The number of points is usually the number of x-y-z-values. This number may be less than the real numbers given in the file.The number of columns must be 4 for figures without a line color (default color is black). If you want to give the line-outputfunctions an individual color, the number of columns must be 5.
from ges version 1.10 the number of colums are default set on 5.
If the color number is zero (black) the user can set with sys.color(X) the line and fill colors
The x y and z scale factors are optional and are used to size the incoming line-output functions. The default value is 1. Thecomment is optional and can be 64 characters in length.
The x-y-z-positions are floating point values of at least 10 characters in length. The x-y-z-positions must be given in localcoordinates.
There are 9 line-output functions:
line-output functions line-output # number of x-y-z-positions Descriptionline 1 2 draws a linepoly line 2 ending with -2
20a set draws a set of line segments
draws a filled poly linetriangle 3
303 draws a triangle
draws a filled squaresquare 4
404 draws a square
draws filled squareText place 5 1 text placeTrans vector (local) 11 1 Translate the next object(s) with this vectorEnd trans vector -11 1 End object translationAbsolute scale 10 1 Scale componentBitmab 100 2 Size of bitmap
Table 3 Line-output functions
Example line code 1
1.000000 0.003184 1.500000 1.000000 0.000000 line-1.000000 0.003186 1.000000 0.000000 0.000000
Example poly line code 2 and with -2
0.000000 0.000000 1.000000 2.000000 1.000000 poly line0.149999 -0.000478 0.500000 0.000000 0.0000000.000000 0.000000 0.000000 0.000000 0.000000-0.149999 0.000478 0.500000 0.000000 0.0000000.000000 0.000000 1.000000 -2.000000 0.000000 end poly line
Example triangle code 3/30
-0.433013 -0.250000 0.500000 30.000000 12.000000 triangle fill0.066987 -1.116025 -0.500000 0.000000 0.0000000.066987 -1.116025 0.500000 0.000000 0.000000
An example in GES can be found here: TestFill.ges
Example square code 4/40
-0.433013 -0.250000 0.500000 40.000000 1.000000 square fill0.433013 0.250000 0.500000 0.000000 0.0000000.433013 0.250000 -0.500000 0.000000 0.000000-0.433013 -0.250000 -0.500000 0.000000 0.000000
Example text place code 5
-5.000000 -0.000000 -4.000000 5.000000 0.000000 text place
The name of the component is placed relative on position -5 0 -4
Example transvector code 11
110.000000 -20.000000 0.000000 11.000000 1.000000 local trans vector
move next lines to x=110 y = -120 z = 0
Example scale code 10
120.000000 6.000000 10.000000 10.000000 0.000000 local scale vector
size of model is x = 120 y = 6 z = 10
Example bitmap code 100
0.000000 0.000000 0.000000 100.000000 1.000000 bitmap10.000000 5.000000 5.000000 0.000000 0.000000
size of model is x=10 y=5 z=5
You can build your figure by mixing the line-output functions.
There are 6 line colors:
color [line color]black 0blue 1green 2cyan 3red 4magenta 5
Table Line colors
Number of gates is the number of gate vectors you want to change. This feature is optional. You can change the position of thegate energy vector, by giving the positions of the start and the end vector. The positions are given by a gate number and the x-y-z-positions. The scale-factors [x][y][z] have no effect on these values. Every position must be written on a new line. Betweenthe gate vectors an empty line (CR) must be inserted.
Example: Block model of the apparatus diesel (only one poly line)
10 4 Diesel
-0.500000 -0.500000 0.000000 2.000000 poly line
0.500000 -0.500000 0.000000 0.000000
0.500000 -0.500000 1.000000 0.000000
-0.500000 -0.500000 1.000000 0.000000
-0.500000 -0.500000 0.000000 0.000000
-0.500000 0.500000 0.000000 0.000000
0.500000 0.500000 0.000000 0.000000
0.500000 0.500000 1.000000 0.000000
-0.500000 0.500000 1.000000 0.000000
-0.500000 0.500000 0.000000 -2.000000 end poly line
2 nr gates
0 -0.500000 0.000000 0.500000
0 -1.500000 0.000000 0.500000
1 0.500000 0.000000 0.500000
1 1.500000 0.000000 0.500000
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu> Properties > Function
Function
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu> Properties > Gates
Gates
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu> Properties > Info
Info
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Diagram > Component popup menu> Properties > Properties
Properties
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Prototype toolbox
Prototype toolboxBasic ship models build from Operational profile library.
Chemical tanker Container shipCruise shipHarbour tug
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Pump (hyd. generator)
Pump (hyd. generator) input output
gate energy variable symbol unit variable symbol unit
0 pos flow ω [m3/s] effort M [N/m2]
1 neg effort Ph [N/m2] flow qh [rad/s]
2 neg effort Pl [Nm] flow ql [m3/s]
Table 1 Gate variables Pump (hyd. generator)
qh is the driving flow in the high pressure pipe.
ql is the return flow in the low pressure pipe.
ω is the motor speed.
M is the motor torque.
Ph is the pressure in the high pressure pipe.
Pl is the pressure in the low pressure pipe.
Because P = Ph-Pl, Q = qh the equations of the hydraulic-generator are:
The general hydraulic motor is adjustable with α.
Mo is the starting torque of the motor.
q0 is the transmission. Practically q0 = Qmax / ω max .
Ys is the flow conductance. This factor is depending on the leakage of the motor. A practical value is 3%. So a value for Ys is forinstance Qmax 3% / Pmax
Parameter(0): Is the transmission factor α.
Parameter(1):Is the transmission ratio q0.
Parameter(2):Is the leak conductance Ys.
Parameter(3):Is the starting torque M0.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Pump (hyd. motor)
Pump (hyd. motor) input output
gate energy variable symbol unit variable symbol unit
0 pos flow qh [m3/s] effort Ph [N/m2]
1 neg effort M [N/m2] flow ω [rad/s]
2 neg effort Pl [Nm] flow ql [m3/s]
Table 1 Gate variables Pump (hyd. motor)
qh is the driving flow in the high pressure pipe.
ql is the return flow in the low pressure pipe.
ω is the motor speed.
M is the motor torque.
Ph is the pressure in the high pressure pipe.
Pl is the pressure in the low pressure pipe.
Because P = Ph-Pl, Q = qh the equations of the hydraulic-motor are:
The general hydraulic motor is adjustable with α.
Mo is the starting torque of the motor.
q0 is the transmission. Practically q0 = Qmax / ω max .
Ys is the flow conductance. This factor is depending on the leakage of the motor. A practical value is 3%. So a value for Ys is forinstance Qmax 3% / Pmax
Parameter(0): Is the transmission factor α.
Parameter(1):Is the transmission ratio q0.
Parameter(2):Is the leak conductance Ys.
Parameter(3):Is the starting torque M0.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Introduction >Purpose of GES
Purpose of GESThe purpose of the computer program GES is to facilitate, during the pre-design stage of a naval vessel, comparisons ofdifferent systems for propulsion and electricity generation, concerning a number of important items:
- energy consumption and efficiency of the ship as a whole; - pollution through engine emissions; - heat emissions in air and water (in view of infrared detection); - dimensions of the installations (in view of required volume); - weight of the installations.
It should be noted that originally these items also incorporated:
- sound and vibrations on board; - emissions of sound in air and water.
However, these items could not be simulated with the same model as required for the energy analysis. It was concluded that itwas better to analyze these items by means of separate, specific computer programs.
Some typical applications of the program GES are:
- analysis of highly integrated and interdependent propulsion and energy systems on board naval vessels; - determination of benefits and drawbacks of new types of systems; - optimization of propulsion and energy systems; - determination of the residual capacity of a ship in case of malfunctioning of certain installations (which missions can still beperformed?).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > put_matlab
put_matlabFunction put_matlab put a value or matrix from GES in a Matlab variable Syntax put_matlab (variable) ‘string’;
Remarks The variable is a GES variable or a GES matrix parameter.The string must contain a MATLAB variable name.
Example put_matlab(A) ’A’; //put GES variable A in MATLAB variable A
put_matlab(parameter(1)) ’A’; //put GES parameter(1) in MATLAB variable A. Ifparameter(1) is a matrix the whole matrix is set in MATLAB
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Quaestor Interface epi
Quaestor Interface epi input output
gate energy variable symbol unit variable symbol unit
0 no no p [-] flow [-]
Table 1 Gate variables epi component
The epi component reads just one value from a text file in epi format from one particular place. This value is set in theparameter list of the connected component. The position in the epi file and the position of the parameter in the connectedcomponent must be specified in the parameter list of the epi component.
Parameter(0):Contains the position in the epi file for reading the value. If the value is 0, then no value is read.
Parameter(1):The path and name of the epi file must be placed in the field Name. Path and filename maximum 30 characters.
Parameter(2):Is the index number of the parameter of the connected component. If the parameter of the connected component is a matrix theposition in this matrix must be given by parameter(3) and parameter(4).
Parameter(3):This value is the row number of the matrix of the parameter of the connected component. The value is only used if theparameter is a matrix.
Parameter(4):This value is the column number of the matrix of the parameter of the connected component.
Parameter(5):If wait for flag is 0 the epi component reads the value from the epi file.
If wait for flag is 1 the epi component reads only the value from the epi file if there is a special file, called the flag file. The nameof the flag file is derived from the epi file name. See for the file name parameter(1). The extension of the flag file is .flg.
Example: In this example an epi component is connected to a diesel component. GES executes first the epi component.The epi component reads one value from an epi file and places this value in the parameter list of the diesel component. Thiscould for instance be the speed of the diesel engine.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Quaestor Interface epo
Quaestor Interface epo input output
gate energy variable symbol unit variable symbol unit
0 no no e [-] flow f [-]
Table 1 Gate variables epo component
The epo component writes result values of one gate to an epo file in a particular place. The values are of the connected component.These values can be the effort, flow and power of one gate of the connected component and the dissipation and the efficiency of thecomponent as a whole. The epo component first writes the chosen values in an internal buffer (not visible for the user). Aftercalculation GES writes the values from the buffer to the epo file. You can use more than one epo component. All these epocomponents write in the same buffer, but only one epo file is created. If a position in the epo file is not mentioned in the parameterlist of one of the epo components a value of -999999 is placed at that position. The name of the epo file is obtained from the lastrunning epo component. It is recommended to use the same epo file name in all epo componentes. The maximum position numberin the parameter list of one of the epo components is its total number of values in the epo file.
Example: an epo file if only one flow value of 1.880000e+02 is written in position 3.
3
"1" -9.999990e+05
"2" -9.999990e+05
"3" 1.880000e+02
If there is a flag file created by another program the flag file is removed.
Parameter(0):The effort value of the gate of the connected apparatus. Value is the place in the epo file. If this value is 0 no effort value is placed inthe epo file.
Parameter(1):The flow value of the gate of the connected apparatus. Value is the place in the epo file. If this value is 0 no flow value is placed inthe epo file.
Parameter(2):The power value of the gate of the connected apparatus. Value is the place in the epo file. If this value is 0 no power value is placedin the epo file.
Parameter(3):The dissipation value of the connected apparatus. Value is the place in the epo file. If this value is 0 no dissipation value is placed inthe epo file.
Parameter(4):The efficiency value of the connected apparatus. Value is the place in the epo file. If this value is 0 no efficiency value is placed inthe epo file.
Parameter(5): The name of the epo file must be placed in the text box Name. Path and filename maximum 30 characters.
Parameter(6):In Value the appropriate gate number of the connected apparatus must be inserted. This number is the gate number of theconnected apparatus.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Tools > Operational profile > Quick start
Quick start1 Start in Excel the file lib_new\GES_macros_com.xls. The following macros are loaded.
For the operational concept analyses the following macros are used:RunOperationalProfile for a operational profile run with GESTNOGES for making graphical figures of the results.
Remark: the user can connect the macro to a custom button
The list separator in Windows must be a semicolon (;)The number notation must be English.
2 Start a prototype model from the Prototypes_com directory.
For instance: \Cruise ship\Cruis_ship_DE.mod. 3 Start the operational profile OP_xxxxx.xls from the same directory as the GES model.
For instance: \Cruise ship\OP_cruisehip.xls.GES used the sheets until <Sheet1>. <Sheet1> is the collection sheet of the GES results.
4 To start a GES simulation Run the macro RunOperationalProfile from the active Operational profile file.
The data collection sheet Sheet1 is now updated if the GES simulation is done.
5 Run the macro TNOGES to update the results sheets:
<Operational profile><Totals><Cash out>Until <Total emission>
6 For an other operational profile RUN the user can modify the sheets:
<OpCond> The conditions are used until key word End and duration -1<PowerConsumers><ControlParameters>
After the simulation the user can also check the results in the GES environment. See the normal GES commands
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Getting started > Quick start
Quick startIf you would like to start GES quickly, this section describes a short series of actions you can take to get going.
1. Start up GES in Windows by double-clicking the icon GES or run GES.EXE in the GES directory. 2. Select New in de menu File. A new GES window will appear, with name New model 1.3. Select in the tree view New model 1 which is an user defined component and drag the component int to the model screen.The user defined model is copied into himself see
4. In the menu Simulation. A simulation model of a propulsion installation will appear. 5. By clicking on Run in the menu Simulation you can start a simulation. 6. When you hold your cursor on a gate of an component the results of that particular chosen component are displayed in adialog box. 7. You can adjust the parameters of your model by selecting Parameters values from the component pop-up menu. When rightclicking the component.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > R2 Port
R2 Port input output
gate energy variable symbol unit variable symbol unit
0 pos flow f [-] effort e [-]
1 neg flow f [-] effort e [-]
Table 1 Gate variables R2 Port
This component is a combination of a 0-junction and a resistance component. The equation of this component is:
e = R(f0 - f1)
f0 is flow value of gate 0
f1 is flow value of gate 1
e is the effort value of gate 0 and gate 1
R is the resistance constant
Parameter(0):Contains the resistance constant R. The default value is 1.
Remark:This component is very useful if you have causality problems in your system. If you cannot connect an component to an energy flowwith a flow as output, you can place a R2_port between these two. The parameter of the resistance between the two componentsmust be carefully chosen to make the flow error small. An example of a similar problem for an effort variable is given in G2 Port. Theproblem is analogously, so you can change the effort and flow variables.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > random
randomFunction random returns a random number
Syntax random(value x)
Remarks x is the value to be round off behind the comma.Random returns a random number between 0 and x-1.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > read_parameters
read_parametersFunction read_parameters reads parameters from file into the parameter list. Syntax read_parameters 'string';
Remarks This function reads parameters that are stored with write_parameters or from the Editparameter values menu.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > read_parameters
read_workspaceFunction read_workspace reads workspace values from text file into the workspace of the component Syntax read_workspace 'filename';
Remarks This function reads local variables that are stored with write_workspace. Delimiter is ;Only existing local variables with the same names are updated
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Pointers > Reference
Reference functionsThe address of a local variable is get if an and (&) is placed for the variable.
For instance:
The address of variable aa is &aa
bb = &aa;
The local variable bb contains the address of aa.
*bb = 10;
The constant value 10 is stored in variable aa with the pointer function.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > remove
removeFunction Remove deletes a file. It returns 0 on success. On error it returns -1.
Syntax remove 'string'
Remarks This function deletes the file specified by string. Example remove 'c:\q\gesintf.flg'
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > Resistance (2 coefficients)
Resistance (2 coefficients) input output
gate energy variable symbol unit variable symbol unit
0 pos flow f [-] effort e [-]
Table 1 Gate variables Resistance component
The relation for the effort (e) variable is:
e = abs(a0 + a1 . f + a2 . f2 + .... + ai . fi + .... + an . fn) sign(f)
The absolute (abs) value of the effort (e) and the sign of the flow (f) are taken into account, because it is assumed that for mostphysical systems the resistance behavior is like a vector. The negative curve looks is similar to the positive curve.
Parameter(0):Contains the coefficients of the resistance polynomial. The coefficients are in order ao, a1, ai, .., an. Default number is 2. a0, a1 arerespectively 0, 1.
Parameter(1):Contains the number of coefficients that are actually used. This number is less or equal to the maximum number of coefficients. Thedefault value is the number of rows of parameter(0).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > RMS
RMSMeasure the Root Mean Square (RMS) of the signal on the e_gate(0), the RMS output is on e_gate(1). Averaging is done over1/frequency seconds.
Parameters In parameter(0) the fundamental frequency of the signal has to be given.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > root
rootFunction root returns the root of a function. Syntax root (function(x), value x)
Remarks x is the function argument of the function that is changed to find a zero solution for the function. The solutionis returned by the function and is zero if the solution is not found.
Example Y=root(X^2-3,X); returns 1.73
Y=root(X^2+3,X); returns 0 because solution is imaginary
Or in combination with and external user defined GES function:function test(x,a){return x^2-a;}
Y=root(test(X,3),X); returns 1.73
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > round
roundFunction round returns a rounded value. Syntax round (value x)
Remarks x is the value to be round off behind the comma. Example round(3.678); returns 4
round(14.467); returns 14
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > Run Component
Run Component input output
gate energy variable symbol unit variable symbol unit
0 no no r [-] flow [-]
Table 1 Gate variables run component
The run component is used to run a component individually. The run component runs its connected component if its parametercontrol flag is set to 1. To run the connected component properly it is recommended to run only masked components, because themasked components are not placed in the calculation list.
Remark: If the connected component is not a masked component then this connected component is running twice, once by theglobal running process and once by the run component. This may give illegal results.
Parameter(0):The control flag for running the connected component of the run component. If this value is 0 no connected component is running. Ifthis value is 1 the connected component is running individually. You can control your application by using a global variable for theflag variable. Other component models can change the flag variable to start and stop the connected component.
Example:In the next figure a configuration of a run component in a model is given. The flag variable in the run component is set by an epicomponent with name gin1.
Fig. 1 Example run component configuration
The Run1 component and gin1 component are signal component types. The masked component flex_gasturbines is running ifparameter(0) of the Run1 component is 1. In this example this is indirectly set by the gin1 component. The gin1 component readsthe parameter value from file and sets this value in parameter(0) of the Run1 component.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Simulation > Run Window
Run window
See starting a simulation
Run Project see Project file
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > run.component
run.componentFunction run.component runs a GES component and his childs with a number of steps. Syntax run.component([io], steps, [clear gates], [timestep])';
Remarks The function runs the component where he is defined.
[i0] is optional : 1 = use the integration constants of the integrators in the model
0 = use the actual integration states.
default is Simulation -> Setup: IO calculation
steps = number of running steps. 0 is no running
[clear gates] is optional (must be used together with option [io]
: 1 = clear gates before running
: 0 = don not clear gates before running. (default)
[timestep] is optional in s
default is Simulation -> Setup: Time steps[s] Example sys.nowarning;
function run_app(){ //define functionsys.function.property(2); //function available under right keyrun.component(i0,1); i0=0; }
messagebox 'test'; //this init_function is defined into the same component and isrunning by run.componentinit_function;
Run the function run_app (by clicking on the component with the right mouse, or with the COM interface function'RunFunction')
run.component(0,1)is running ones and the internal states [0] are the actual values.
This key word is very useful for running the component individual.
This function run's the component dynamic with 200 steps and time step 1e-3 function run_app(){ //define function for instance run_app()
sys.function.property(2); //function available under right keyrun.component(1,200,1,1e-3); //use internal integration values, run this componentand all inside with 200 steps, clear the gates, time step is 1e-3}
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > run.dll
run.dllFunction run.dll calls a dll entry name Syntax run.dll "string";
Remarks The function calls a function in a DLL which is specified by “string”. Example Example of C code for two DLL entries
GesMessageBox
with GES code:run.dll 'GesModelDll.dll,GesMessagebox'; //call GesMessagebox in GesModelDll.dllinit_function;e_gate(0)=1;
GesDllResistance
with GES code
f_value(0)=f_gate(0); run.dll 'GesModelDll.dll,GesDllResistance'; e_gate(0)=e_value(0);
see also the Borland project file GesModelDll //------------------------------------------------------------------------
//Example C++ DLL for GES interface//------------------------------------------------------------------------
#include <vcl.h>#include <windows.h>
//Ges DLL entrysextern "C" __export void _stdcall GesMessagebox(void);extern "C" __export void _stdcall GesDllResistance(void);
//Ges functionsextern "C" __import void _stdcall GesCurrentComp(int &pComp, int &gate);extern "C" __import void _stdcall GesSetEffort(int &pComp, int &GateNr, double&value);extern "C" __import void _stdcall GesSetFlow(int &pComp, int &GateNr, double&value);extern "C" __import void _stdcall GesEffort(int &pComp, int &GateNr, double&value);extern "C" __import void _stdcall GesFlow(int &pComp, int &GateNr, double &value);extern "C" __import void _stdcall GesParameter(int &pComp, int &ParNr, double&value);extern "C" __import void _stdcall GesSetParameter(int &pComp, int &ParNr, double&value);
void (__stdcall *CurrentComp)(int &pComp, int &gate); //Run external routine in.DLLvoid (__stdcall *SetEffort)(int &pComp, int &gate, double &value); //Run externalroutine in .DLLvoid (__stdcall *SetFlow)(int &pComp, int &gate, double &value); //Run externalroutine in .DLLvoid (__stdcall *Effort)(int &pComp, int &gate, double &value); //Run externalroutine in .DLLvoid (__stdcall *Flow)(int &pComp, int &gate, double &value); //Run externalroutine in .DLL
void (__stdcall *Parameter)(int &pComp, int &par, double &value); //Run externalroutine in .DLLvoid (__stdcall *SetParameter)(int &pComp, int &par, double &value); //Run externalroutine in .DLL
#pragma hdrstop//------------------------------------------------------------------------
#pragma argsusedint WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved){HANDLE hLibrary = LoadLibrary("ges.exe");if (hLibrary){CurrentComp = (void (__stdcall *)(int&, int&))GetProcAddress(hLibrary,"GesCurrentComp"); //External routine GESPRG in .DLLSetEffort = (void (__stdcall *)(int&, int&, double&))GetProcAddress(hLibrary,"GesSetEffort"); //External routine GESPRG in .DLLSetFlow = (void (__stdcall *)(int&, int&, double&))GetProcAddress(hLibrary,"GesSetFlow"); //External routine GESPRG in .DLLEffort = (void (__stdcall *)(int&, int&, double&))GetProcAddress(hLibrary,"GesEffort"); //External routine GESPRG in .DLLFlow = (void (__stdcall *)(int&, int&, double&))GetProcAddress(hLibrary,"GesFlow"); //External routine GESPRG in .DLLParameter = (void (__stdcall *)(int&, int&, double&))GetProcAddress(hLibrary,"GesParameter"); //External routine GESPRG in .DLLSetParameter = (void (__stdcall *)(int&, int&, double&))GetProcAddress(hLibrary,"GesSetParameter"); //External routine GESPRG in .DLL}return 1;}//------------------------------------------------------------------------void _stdcall GesMessagebox(void){::MessageBox(NULL, "DLL", "GES", MB_OK); //use C messagebox
}//------------------------------------------------------------------------void _stdcall GesDllResistance(void){int pComp;int gate;double value;CurrentComp(pComp, gate); //Get current component pointer and gate number
Flow(pComp, gate, value); //Get the flow value from gate value=value*5,0; //Do some calculation
SetEffort(pComp, gate, value); //Set a value to the effort of a gate}//------------------------------------------------------------------------
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > run.e_gate
run.e_gateFunction run.e_gate runs a GES component gate effort function. Syntax run.e_gate(#);
Remarks The function runs the effort gate function with gate number # Example a=10;
e_gate(0)=a;
b=run.e_gate(0);
post_function;
The post function runs the effort gate function and the results is placed in variable b.
The function is very useful to examine the component individual.
for instance to plot the characteristics of the component by double clicking on the component. e_gate(0)=10*f_gate(0)^2;
function resistance(){ variable x[1,100],y[1,100],i; //variable definition
//GES versions after 1 oktober 2007 2.00sys.function.property(7);
i=0; while(i<100){ // 100 calculations are donex(0,i)=f_value(0)=i/10; // a flow value is placed on the gaterun.e_gate(0); // the effort function defined above is runedy(0,i)=e_value(0); // the results is get from the effort gatei=i+1; }
sys.plot(0,x,y); / the results is plot}
function resistance make the following plot
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > run
runFunction Run starts an external program. Syntax run "string"'
Remarks If the name of the executable file in the string parameter does not contain a directory path, Windows searches forthe executable file in this sequence:
1. The directory from which the application loaded.2. The current directory.3. The Windows system directory.4. The Windows directory.5. The directories listed in the PATH environment variable.
Example Run Excel with run:
run ‘excel’ path in windows to Excel must exist!
Starts next ges.exe and model with run and start directly the simulation:run 'ges c:\ges\bench.mod /run';
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > run.parser
run.parserFunction run.parser runs a GES function Syntax run.parser "string"
Remarks The function runs a GES function specified by “string”. Example function test(){
run.shell $(WORKING),'doc';}
run.parser 'test';
If the parser compiles run.parser 'test' the function test is directlyexecuted.
This key word is very useful for initializations of the program bystartup and changes of the whole program.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > run.shell
run.shellFunction run.shell runs a GES component gate effort function. Syntax run.shell"string";
Remarks The function opens the file specified by "string".The file can be an executable file or a document file. The file can be a folder to open.
Example run.shell $(working),'doc';
opens
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > sgn
sgnFunction sgn returns 1 or -1 depending on the sign of the argument. Syntax sgn(value x)
Remarks This function returns 1.0 if x >= 0 and -1.0 if x < 0.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Ship Resistance
Ship Resistance input output
gate energy variable symbol unit variable symbol unit
0 pos effort R [N] flow Vs [m/s]
Table 1 Gate variables Ship Resistance
The required propeller power Pprop can be estimated by a model using the Admiralty Constant:
Pprop is power in kW
D is displacement in m3
vs is ship speed in knots
Adm is Admiralty Constant in m2kn3/kW
The Admiralty Constant, however, is far from constant, the difference being mainly caused by the relative importance of wavemaking resistance to skin friction [5].
The required propeller power is:
Because the propeller model in GES delivers the propeller force R and to avoid causality problems the speed vs is calculated withthis component. Actually not the resistance is calculated but the conductance.
Remark: the propeller efficiency is included in the equation, so a correction must be made if the correct propeller curve is known.
Parameter(0): Is the volume of the ship.
Parameter(1):Is the Admiralty Constant Adm0 at Vs0 (nominal speed)
Parameter(2):Is the nominal speed Vso of the ship.
Parameter(3):Is a table for fractional Adm’s (Admi/Admo) as function of the fractional speed (Vsi/Vso).
Column 1 contains the speed fractions Vsi/Vso. Default values are 0, 0.5
Column 2 contains the fractions Admi/Adm0. Default values are 1.3, 1.2
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Ges DocumentationSimulation parameters
Simulation parameters
In this menu you can change the parameters of a dynamic calculation.
Start time is the simulation start time.
Stop time is the stop time of the simulation. This time is also automatically calculated if Time step, Samplefrequency or Number of steps is changed.
Time step is the time of the simulation time step. This time is also calculated is the Sample frequency is changed.
Number of steps is the number of simulation steps.
Number of steps output is the number of saved steps used for the plot routines. If this number is more than theNumber of steps than the results of the calculation is extrapolated (0e order).
Uses this layout for the simulation parameters else only the number of steps could be changedwith the following screen.
Calculate the integration constants of the integrators.
Sets the iteration parameters for the implicit integration method.
Integration methods
Mainindex
There are two integration methods in GES implemented the implicit and explicit method.
First order: y(t) = y(t-dt) + x(t)*dt
Second order: y(t) = y(t-dt) + (x(t) + x(t-dt))*dt/2
Third order: y(t) = y(t-dt) + (5 x(t) + 8 x(t-dt) - x(t-2dt))*dt/12
Static: dy(t)/dt = 0
First order: y(t+dt) = y(t) + x(t)*dt
Second order: y(t+dt) = y(t) + ( 3 x(t) - x(t-dt))*dt/2
Third order: y(t+dt) = y(t) + ( 23 x(t) - 16 x(t-dt) + 5 x(t-2dt))*dt/12
Fourth order: y(t+dt) = y(t) + ( 55 x(t) - 59 x(t-dt) + 37 x(t-2dt) - 9 x(t-3dt))*dt/24
Runga Kutta:
k1 = f(t, y(t)) = x(t)
k2 = f(t + dt/2, y(t) + k1dt/2)
k3 = f(t + dt/2, y(t) + k2 dt/2)
k4 = f(t + dt, y(t) + k3 dt)
y(t+dt) = y(t) + (k1 + 2 k2 + 2 k3 + k4) dt/6
Heun:
k1 = f(t, y(t)) = x(t)
k2 = f(t + dt/2, y(t) + k1dt/2)
y(t+dt) = y(t) + (k1 + k2/2)* dt
Home > Working with GES > Getting started > Start a simulation
Simulation start procesA Simulation can be started from Simulation > Run Window , Controlbar or Command line.
Normally the simulation is started with the Run button
With this menu you can calculate your model at four methods.
1. Manually by clicking on Manual>>, Clear, Sort_C_Func, Sort_I_Func and then by clicking on Calculate. Clear sets all gates at zero. These are the starting values of the iteration process. Sort_C_Func sorts all explicit functions. Sort_I_Func sorts all implicit functions and the remaining explicit functions. Calculate starts the simulation of the manual sorted functions.
2. In the foreground by clicking on the Run button. The simulation starts in the foreground with a specified number of steps. 3. By clicking on the Run Continual button. The simulation starts in the background continuously. 4. By clicking on the Run Project button. The simulation asks for a project file, which contain the simulation models to simulatesimultaneous the models.
Command Line Interface
You can start GES from an other program by using the command line
ges.exe <model filename> <command>
<model filename>:File name of the model
<command>:/run calls Run/runcontinue calls Run Continual/runwindow calls Run Window
Example: Ges started and run’s model from the command string.
ges.exe bench.mod \run
Example: project file in comma (; ) separated format that could be edit with Excel
Directory FilenameC:\Ges\prototypes\Chemical tanker (inland waters)\ Chemical_tanker_DD_FPPC:\Ges\prototypes\Chemical tanker (inland waters)\ Chemical_tanker_DE_3D_FPPC:\Ges\prototypes\Chemical tanker (inland waters)\ Chemical_tanker_DE_2FC_FPPC:\Ges\prototypes\Cruise ship\ Cruise_ship_DDC:\Ges\prototypes\Cruise ship\ Cruise_ship_DEC:\Ges\prototypes\Cruise ship\ Cruise_ship_DE_POD
The status of the calculation is displayed in the list box.
First the number of steps.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Simulation
Simulation
Default run mode Number of steps Continuous Window only Run init_function every step Dynamic iterationStop by maximum iterations
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Simulation > Simulation parameters
Simulation parameters
In this menu you can change the parameters of a dynamic calculation.
Start time is the simulation start time.
Stop time is the stop time of the simulation. This time is also automatically calculated if Time step, Samplefrequency or Number of steps is changed.
Time step is the time of the simulation time step. This time is also calculated is the Sample frequency ischanged.
Number of steps is the number of simulation steps.Number of steps output is the number of saved steps used for the plot routines. If this number is more than the results of
the calculation is extrapolated (0e order).Time calculation uses this layout for the simulation parameters else only the number of steps could be changed
with the following screen.
IO calculation calculate the integration constants of the integrators.Iteration tolerance sets the iteration parameters for the implicit integration method.Change Goto Options -> Solution ProcesSet default Set selection default for GesIntegration method Implicit, Explicit
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Simulink interface library
Simulink interface libraryInterface example models.
TransformerLoadDiesel simpleHull
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > sin
sinFunction Sin returns a trigonometric sine. Syntax sin(value x)
Remarks x is an angle specified in radians.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > sinh
sinhFunction Sinh returns a hyperbolic sine. Syntax sinh(value x)
Remarks x is an angle specified in radians. The hyperbolic tangent SINH(x) gives a similar result as the expression: 0.5 * (EXP(x) - EXP(-x)).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools > Options > Solution process
Solution Process
Numerical parameters Maximum number of iterators is the maximum number of iterations (sys.iteration.maxits)Tolerance function values sets the convergence criterion of function values (sys.iteration.tolf)Tolerance funtion minimun sets the criterion for deciding whether spurious convergence to a minimum of a
function has occurred. The function value is checked until Tolmin a real minimumhas occurred. If the new step is too close to the old step size this check is made ifthe convergence is spurious (sys.iteration.tolmin)
Tolerance on step size is the convergence criterion on the step size (sys.iteration.tolx)Maximum steps in line search is the scaled maximum step length allowed in line searches (sys.iteration.stpmx)Initial guess is the offset value of the starting values of the iteration process
(sys.iteration.io_offset)
Equation system Flow based Effort and Flow IterationEffort based With the radio buttons you can choose whether GES first searches for a flow or an
effort function at the iteration equations. Iteration system Single based Iteration method components Iteration method Par and Setcomponents
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > Solvers
SolversAlgebraic solversIntegation methods
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > sqr
sqrFunction sqr returns a square function Syntax sqr(value x)
Remarks sqr calculates x * x.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > sqrs
sqrsFunction sqrs returns a square root Syntax sqrs(value x);
Remarks sqrs calculates
This function is useful for physical systems if x is a vector.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > sqrt
sqrtFunction sqrt returns a square root Syntax sqrt(value x);
Remarks sqrt calculates for x>0 else x=0
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > Statements
StatementsStatements specify the flow of control as the program executes. Statements are executed sequentially in the order ofappearance in the source code.
If statementWhile statement
If statement
The if statement has the following pattern:
if (expression) if-statement < else else-statement >
The expression is evaluated. If the value is exactly zero the expression is false, otherwise it is true.
If there is no else clause and the expression is true the if-statement is executed; otherwise the if-statement is ignored.
If the optional else else-statement is present and the expression is true the if-statement is executed; otherwise the if-statementis ignored and the else-statement is executed.
GES does not have a specific Boolean data type. Any expression can play a Boolean role in conditional tests.
The if-statement and else-statement can be if statements themselves, allowing for a series of conditional tests nested to anydepth. Care is needed with nested if...else constructions to ensure that the correct statements are selected. There is no endifstatement. Any else ambiguity is resolved by matching an else with the last encountered if without an else at the same blocklevel.
For example:
a = 0; a = 0; if (x == 1) if (x == 1) if (y == 1) a = 10; if (y == 1) a = 10; else a = 20; else a = 20;
draws the wrong conclusion. The else matches with the second if. So if x = 1 then a = 0; Note the effect of the braces:
a = 0; if (x == 1) { if (y == 1) a = 10;} else a = 20;So if x = 1 and y = 1 then a = 10. If x != 1 then a = 20;
[top]
While statement
The general format for this statement is:
while (expression) statement
The statement is executed repeatedly until the expression compares equal to zero (false).
Example:
fopen(0) 'test.dat';i=0;while(i<3){parameter(i)=i;fwriteval(0,parameter(i));fwritenl(0);i=i+1;}fclose(0);
f_gate(0)=i;
The expression must change during evaluation to prevent unwanted endless loops.
[top]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > strcpy
strcpyFunction strcpy converts and cat strings to a string Syntax strcpy( resultstring) string1, [string2],.....,[stringend];
Example
strcpy(name_parameter(0))'test',name_component;
(Copy and cat the strings 'test' and the name of the component to parameter 1 in field Name.)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions
String functions$(ges) $(help)
$(include1) $(include2) $(model) $(working)comment stringdirectiory fgetsrt name_component
name_model name_parameter numtostr strcpy strtoval unit_parameter
valtostr
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > strtoval
strtovalFunction strtoval converts the string to a value. Syntax strtoval 'string';
Example val = strtoval '3.14';
Converts the string with 3.14 to a real value. If the conversion didn't succeed the return value is 0.The variable val is 3.14.
It is also possible to put words in the string and add the numbers with a #.
a = strtoval 'test #10' a now has the value 10.
Example In this example the name of the component is used as input for the conversion.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > Structure of GES
Structure of GESGES is based on the bond graph method. The elements are connected using bonds. The object orientated system modelling inGES is based on this domain independent graphical notation of physical modelling. This structure offers the possibility to reusemodels and sub models.
Every component is modelled as an element with a number of entrance and/or exit gates. The general structure of a simulationmodel in GES is given in Figure 75. All components are identical, only the equations describing the relations between the effortand flow variables of the gates that are inside the components are different. The example given in Figure 75 consists of fourcomponents: app1, app2, app3 and app4. In app1, two components are defined: app2 and app4. In app2 one component isdefined: app3. The functions for the effort and flow are given in the most internal components: app3 and app4.
Components app2 and app4 are energetically connected to each other. Inside app4, app3 calculates the effort F with thefunction f2. App4 calculates the flow V with function f3. A sorting algorithm in GES controls the order of calculation of theinternal functions. This structure allows adding and removing components or complete models without the need toaccommodate the changes manually. Components in GES do not need to be connected to each other.
Figure 75: example of the general structure in GES
The same model that is given in Figure 75 can be presented using a tree structure. That tree structure is given in Figure 76.
Figure 76: tree structure in GES
GES uses this tree structure only for displaying the location of a component inside the model. This view gives a clear overviewof the components and is therefore suitable to be used for displaying the components in libraries. The energy equations aregenerally located in the bottom elements. 6.2 Mantled Systems
Read the entire chapter in the manual. Chapter 6 Structure of GES.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > sum_parameter
sum_parameterFunction sum_parameter calculates the sum of parameters with the same name. Syntax sum_parameter ‘string’
Remarks This function is used to calculate the sum of all parameters given by the name in ‘string’. Only the first namein 'string' will be used; all characters behind the first non-leading space will be omitted. The calculation is done fortheconnected component. This is the component witch is connected on gate 0 of this user component. From version1.06 on internal mask component are not taken into account.
Example sum_parameter ‘mass’;
(Returns the sum of all parameters starting with the name mass.)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > sum_workspace
sum_workspaceFunction sum_workspace calculates the sum of workspace variables with the same name. Syntax sum_workspace ‘string'
Remarks This function is used to calculate the sum of all workspace variables given by the name in ‘string’. Only thefirst name in 'string' will be used; all characters behind the first non-leading space will be omitted. From version1.06 on internal mask components are not taken into account.
Example sum_workspace ‘mass’;
(Returns the sum of all parameters starting with the name mass.)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > sum_workspace.localtree
sum_workspace.localtreeFunction sum_workspace.localtree calculates the sum of workspace variables with the same name. Syntax sum_workspace.localtree ‘string'
Remarks This function is used to calculate the sum of all workspace variables, for all connected components in tree form,given by the name in ‘string’. Only the first name in 'string' will be used; all characters behind the first non-leadingspace will be omitted.
Example sum_workspace.localtree ‘mass’;
Returns the sum of all parameters starting with the name mass. The connected component is the root of the tree.
All of the components in this tree are passed through. If the variable exist then the value (of mass) is add to thetotal result.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > Synchronous motor
Synchronous motorParameters Parameter(0): number of phases in the AC voltage.
Parameter(1): number of pole pairsParameter(2): stator resistance [Ohm]Parameter(3): stator inductance [H]Parameter(4): motor constant [Vs/rad]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.bkgcolor
sys.bkgcolorFunction sys.bkgcolor
Syntax sys.bkgcolor(value x);
Remarks Changes the background color of the GES model viewThis initialization function overruled the custom background colors.
Example (for values between 0-13, basic colors)
sys.bkgcolor(4);value 0: blackvalue 1: bluevalue 2: greenvalue 3: cyanvalue 4: redvalue 5: magentavalue 6: yellowvalue 7: whitevalue 8: blackvalue 9: lightbluevalue 10: lightgreenvalue 11: lightcyanvalue 12: lightredvalue 13: lightmagenta
Example (for RGB-palette)sys.color(red+green*2^8+blue*2^16);red,green,blue could have a value between 0-255
For instance:sys.color(255); redsys.color(255*2^8); greensys.color(255*2^16); bluesys.color(255+255*2^8+255*2^16); white
also could be used sys.rgbFor instance:sys.bkgcolor(sys.rgb(200,255,255));
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.charttype
sys.charttypeFunction sys.charttype
The sys.charttype routine is written to give the user a possibility to make a choice in which format the data in theplot window are presented. This routine should be implemented in the sys.plot routine.
Syntax sys.plot(..., sys.charttype'type', ..);
Example sys.plot(h,sys.flow(0),sys.charttype'line',sys.flow(2),sys.flow(1)'');
Several chart types are available:
charttype 'line'
charttype 'bar'
charttype 'stackedbar'
charttype 'horz.bar'
charttype 'area'
charttype 'point'
charttype 'pie'
As can be seen in the "area" chart-type the different sets of data can be linked to different type of charts, thuscombining different data, with different chart types in the same chart.
This can be done by a right-click on the plotted data-set, changing the chart-type accordingly
The chart as shown above can be exported in different graphical formats. Available are:
*.bmp bitmap
*.emf enhanced metafile
*.wmf windows metafile
The chart also can be saved as list of numerical values in a comma separated format (*.csv), which can beimported in an Excel-sheet.
See also: sys.plot
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.color
sys.colorFunction sys.color
Syntax sys.color(value x);
Example (for values between 0-13, basic colors)sys.color(4);value 0: blackvalue 1: bluevalue 2: greenvalue 3: cyanvalue 4: redvalue 5: magentavalue 6: yellowvalue 7: whitevalue 8: blackvalue 9: lightbluevalue 10: lightgreenvalue 11: lightcyanvalue 12: lightredvalue 13: lightmagenta
Example (for RGB-palette)sys.color(red+green*2^8+blue*2^16);red,green,blue could have a value between 0-255For instance:sys.color(255); redsys.color(255*2^8); greensys.color(255*2^16); bluesys.color(255+255*2^8+255*2^16); white
also could be used sys.rgbFor instance:sys.color(sys,rgb(255,255,255)); white
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.component.dissipation
sys.component.dissipationFunction sys.component.dissipation (diss_component) returns the dissipated energy of the component.
Syntax sys.component.dissipation;
Example dissipation = sys.component.dissipation;post_function;Calculation of the dissipation of the component. The result is set in the local variable dissipation.The efficiency and dissipation of an component are also presented in the "inspect state window".
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.component.efficiency
sys.component.efficiencyFunction sys.component.efficiency returns the efficiency of the component.
Syntax sys.component.efficiency;
Example efficiency = sys.component.efficiencypost_function;
Calculation of the efficiency of the component. The result is set in the local variable efficiency.
The efficiency is defined as: η = Pout / Pin
The efficiency and dissipation of an component are also presented in the "inspect state window".
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.component.gate
sys.component.gateFunction sys.component.gate
Syntax sys.component.gate(value);
Returns the pointer of the component where the gate number is given in value. If the component is not find thefunctionreturns null.
Example app = sys.component.gate(1);The function get the pointer of the component which is connected to gate 1. The result is stored invariable app.With the indirect operator -> it is possible to get local variables of the component if the variableexist.for instance if the component app contains the variable speed_diesel.speed = app->speed_diesel.the value op speed_diesel in app is stored in variable speed.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.component.property
sys.component.propertyFunction The sys.component.property is a statement in which the GES component can be showed.
Syntax sys.component.property 'property word, [property word],....,[property word]';
property words are:sys.component.property 'HIDE'; //hide the figure of the componentsys.component.property '<HIDE>'; //unhide the figure of the componentsys.component.property 'HIDE_TEXT'; //hide the name of the componentsys.component.property '<HIDE_TEXT>'; //unhide the name of the componentsys.component.property 'HIDE_E_TEXT'; //hide the effort name of the componentsys.component.property '<HIDE_E_TEXT>'; //unhide the effort name of the componentsys.component.property 'HIDE_F_TEXT'; //hide the flow name of the componentsys.component.property '<HIDE_F_TEXT>'; //unhide the flow name of the componentsys.component.property 'HIDE_LINES'; //hide the gate lines of the componentsys.component.property '<HIDE_LINES>'; //unhide the gate lines of the componentsys.component.property 'HIDE_ARROW'; //hide the arrow of the gatessys.component.property '<HIDE_ARROW>'; //unhide the arrow of the gates
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.component.gate
sys.connect.toparentFunction sys.connect.toparent
Syntax sys.connect.toparent(gate# component, gate# parent);
connect during parsing the gate number of the given componet to the parent gate
Example
See also: load 'model filename'
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.draw.figure
sys.draw.figureFunction sys.draw.figure
Syntax sys.draw.figure ( x, y, z, phi x, phi y, phi z);
The sys.draw.figure routine draws the component drawing in runtime on position x,y,z and with orientation phi x,phiy, phi z.With this function it is possible to make animations.
Remark It is very useful to use this function in the post_function
Example sys.color(4); //color of the following drawingsys.draw.figure(!x*parameter(0),!y*parameter(0),parameter(1)*parameter(0),0,0,0); //draw the figure of thecomponentsys.textcolor(0); //color of the following textsys.draw.text(!x*parameter(0)+2,!y*parameter(0),parameter(1)*parameter(0))valtostr(!z*1000),' [mm]'; //draw textpost_function;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.draw.text
sys.draw.textFunction sys.draw.text
Syntax sys.draw.text ( x, y, z) string;
The sys.draw.text routine draws the text in string in runtime on position x, y, z.With this function it is possible to make animations.
Remark It is very useful to use this function in the post_function
Example sys.color(4); //color of the following drawingsys.draw.figure(!x*parameter(0),!y*parameter(0),parameter(1)*parameter(0),0,0,0); //draw the figure of thecomponentsys.textcolor(0); //color of the following textsys.draw.text(!x*parameter(0)+2,!y*parameter(0),parameter(1)*parameter(0))valtostr(!z*1000),' [mm]'; //draw textpost_function;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.f1
sys.f1Function sys.f1
Syntax sys.f1;
The function run's GES help as pressed on the F1 key.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.function.property
sys.function.propertyFunction sys.function.property
The sys.function.property is a statement in which the GES functions can be controlled. The functions can bedivided in action functions and visible functions.
Syntax sys.function.property (value);
This function can be used in functions for calling the function with a mouse click (double)
1 action function available2 visible function available4 action function in normal view8 click in parameter list10 Double click in parameter list. See also property 832 If gate selected with mouse64 if selected gate is clicked with mouse128 RunFunction by run console
Value Property 1 action function availablean action function means, that this function will be available by double-click on the component, in which thefunction isimplemented (in the equations-window).Function is called by double click of the component in the tree view.
Property 2 visible function availablea visible function means, that this function will be available by the run command (under the right-click) at thecomponent, in which the function is implemented (in the equations-window)
Property 4 action function in normal viewThe function with this property is called by double click the component in the normal view. Normally theparameterlistof the component is showed.The user can select more actions by adding the values. For instance property 1 + 2 + 4 = 7 means all actionfunctionspossible.
Property 8 click in parameter listThe function generates two system variables !!parameter_row and !!parameter_col with the index of the cellfor instance:
function test(){sys.function.property(10);}
This function test() is executed if is clicked in a parameter cell 'Click here' see below
the variables !!parameter_row and !!parameter_col are set on 2 and 2
the index started with 0
Property 10 Double click in parameter list. See also property 8
Property 32 Gate selected with mouse.The system variable !!gate_index is generated and set on the mouse index
f_gate(0)=1;function test(){sys.function.property(32);messagebox 'test';}
messegebox test is plot if on the pointed gate is clicked
Property 64 GateThe system variable !!gate_index is generated and set on the mouse index
f_gate(0)=1;function test(){sys.function.property(64);messagebox 'test';}
messegebox test is plot if on the selected gate is clickedremark: the user can use the variable !!gate_index to do some user defined actions in the specified function
Property 128 RunFunctionThis property is used to activate the function for running with the running button in console.See sys.option "RunFunction"
Example f_gate(0)=!global_variable1;f_gate(1)=!global_variable2;f_gate(2)=!global_variable3;function function_name1 (){sys.function.property(1);handle=0;sys.plot(handle,sys.flow(0),sys.charttype'line',sys.flow(2),sys.flow(1)'');}
The function function_name1 is called by clicking on the component with this function in the tree view.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.gates.efficiency
sys.gates.efficiencyFunction sys.gates.efficiency returns the efficiency of the gates.
Syntax sys.gates.efficiency;
Example efficiency = sys.gates.efficiencypost_function;
Calculation of the efficiency of the gates, independent of the direction of the arrows. The result is set in the localvariable efficiency.
The efficiency is defined as: η = Pout / Pin
The efficiency and dissipation of an component are also presented in the "inspect state window". Example The difference between sys.component.efficiency and sys.gates.efficiency is illustrated by this example.
Since the component efficiency is defined as Pout / Pin the efficiency is calculated with the negative values -2/-1 =2.The gates efficiency however is calculated with the direction the power is actually going, as 1/2 = 0.5.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.help.file
sys.help.fileFunction sys.help.file
Syntax sys.help.file ‘test.html’;
The function is only executed in a statement else the first sys.help.file statement is called with thefunction key F1.This function opens the file ‘test.html’ with the explorer of the system. The advance of this system is that wholerapport’s can coupled to the component as a help file.In the Options menu of GES the mark ‘system help’ must on to give this help system priority for string blocks.
Example sys.help.file 'e constant.html'; //this html help file is called by pressing the F1 key
Example Help system used in GES functionfunction help1(){ //definition of function help1sys.function.property(7); //execute this function by double mouse clicksys.help.file 'f constant.html'; //this help file is called by executing function help1,}
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.help
sys.helpFunction sys.help
Syntax sys.help 'string';
The simplest help system is viewing a string block given in the equations of the component. The first string blockin the equations is viewed as help.
Example In the following example a simple help string is demonstrated for the component named user defined.
/* Help string in GES */
The response on the help button in GES gives for component user:
The same result could be obtained by using the statement:
sys.help 'Help string in GES';
in the equations. If there are more than one statements in the equations the first help statement is used.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.iteration.io_offset
sys.iteration.io_offsetFunction sys.iteration.io_offset
Syntax sys.iteration.io_offset=value;
Is the offset value of the starting values of the solution process. After this function is implemented in a equationswindow, the value is automatically set in the solutions process-window, as "initial guess", in the options menu.
Example sys.iteration.io_offset=10;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.iteration.maxits
sys.iteration.maxitsFunction sys.iteration.maxits
Syntax sys.iteration.maxits=value;
Is the maximum number of iterations. After this function is implemented in a equations window, the value isautomatically set in the solutions process-window, as "maximum number of iterations", in the options menu.
Example sys.iteration.maxits=1000;
See also: sys.option 'maxits' = 1000
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.iteration.stpmx
sys.iteration.stpmxFunction sys.iteration.stpmx
Syntax sys.iteration.stpmx=value;
Stpmx is the scaled maximum step length allowed in line searchesAfter this function is implemented in a equations window, the value is automatically set in the solutionsprocesswindow, as "maximum steps in line search", in the options menu.
Example sys.iteration.stpmx=100;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.iteration.tolf
sys.iteration.tolfFunction sys.iteration.tolf
Syntax sys.iteration.tolf=value;
Sets the convergence criterion of function values. After this function is implemented in a equations window, thevalue is automatically set in the solutions process-window, as "tolerance function values", in the options menu.
Example sys.iteration.tolf=1e-6;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.iteration.tolmin
sys.iteration.tolminFunction sys.iteration.tolmin
Syntax sys.iteration.tolmin=value;
Sys.iteration.tolmin sets the criterion for deciding whether spurious convergence to a minimum of a function hasoccurred. The function value is checked until tolmin a real minimum has occurred. If the new step is too close tothe old step size this check is made if the convergence is spurious.After this function is implemented in a equations window, the value is automatically set in the solutionsprocesswindow, as "tolerance function minimum", in the options menu.
Example sys.iteration.tolmin=1e-6;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.iteration.tolx
sys.iteration.tolxFunction sys.iteration.tolx
Syntax sys.iteration.tolx=value;
Tolx is the convergence criterion on the step size.After this function is implemented in a equations window, the value is automatically set in the solutionsprocesswindow, as "tolerance on the step size", in the options menu.
Example sys.iteration.tolx=1e-7;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions > sys.location
sys.locationFunction Sys.location set the actual include path and is global for all mdels Syntax sys.location(value include_index)
RemarksIf the include index number is negative the include path is not active.The include name is overruled.
Example
sys.location(3) 'C:\Ges\lib_new'set on position 4 include path 'C:\Ges\lib_new'
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions > sys.location
sys.model.directoryFunction Sys.model.directory sets an existing include path above the system list and is only a search path for the model
This function is very usefull for different library locations by different users. Syntax sys.model.directory(index number) 'post path'
RemarksThe include index number is the orde number in the include list.same index numbers are overruled.
Example
sys.model.directory(3) '\lib_new';
\libnew is the post path in the list. The first post path is set above the include list.
Do not forget the \
If no include path exist in the include list a warning is given.
If orders 0, 1, 2 are not defined orde 3 is the first path in the include list
Sys.model.directory must be defined in the root component of the model
After changing sys.model.directory, Reset the paths by parse the total model
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.nowarning
sys.nowarningFunction sys.nowarning
Syntax sys.nowarning;
The function forces the parser to output no warnings from a particular component.
Example If no gate functions are used the parser gives a warning that a gate function must defined.To force this warning the key word sys.nowarning must be used.
a=10;.....post_function;sys.nowarning;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.parameter
sys.parameterFunction sys.parameter
Syntax sys.parameter( x, y, rows, columns, total);
The sys.parameter routine is written to give the user a possibility to use data from a matrix in the parameter-window toplot in the plot-routine. The values for x and y are respectively the begin and end number of the parameternumbersused. Rows and columns are used to assign both row and column number. The total value (optional) gives thetotalnumber of values.
Example function name () {sys.function.property(3);handle=0;sys.plot (handle ,sys.parameter (18,18,0,4,states),sys.charttype 'line' , sys.axis.title (90)'[-]',sys.parameter(18,18,0,1,states) 'title');}
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.parameter.list
sys.parameter.listFunction sys.parameter.list
Syntax sys.parameter.list;
This function shows the parameter list of the component on the screen.
Example parameter(0) = 2; //set a value in parameter(0)sys.parameter.list; //shows the hole parameter list (program wait)a = parameter(0); // get parameter(0) if the parameter list is closed.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.plot
sys.plotFunction sys.plot
Syntax sys.plot(handle, [x-data], [sys.charttype ‘type’], [sys.axis.title(deg)’text’], [y-data,…,… ] )[’header text’];
x-data or y-data could be: sys.name_parameter (only x-data) //list of parameter names
sys.flow //flow data of a gatesys.effort //effort data of a gatesys.parameter[‘text’] //parameter data of the componentmatrix variable //matrix variable (Professional GES version)sys.xaxis.title(deg) 'text' //write text by x axissys.axis.title(deg) 'text' //write text by y axis left and rightsys.axis 'left' //select left axissys.axis 'right' //select right axissys.series 'none'sys.series 'side'sys.series 'stacked'sys.series 'stacked100'sys.charttype type type is 'line' , 'bar', 'stackedbar', 'horz.bar', 'area', point,'pie'sys.serie (number) //plot data in the same serie number for multipleplotssys.serie.color (color number) //set serie color, see for color number sys.colorand sys.rgbsys.point.style type type is 'rectangle', 'circle', 'triangle', 'downtriangle','cross', 'diagcross', 'star',sys.axis.legend 'text' //changed the legend text
Example The sys.plot routine is written to give the user a possibility to write an own object based plot-routine which can beusedafter each simulation. This plot-routine is visible as a component in the model as a whole.
Fig. plot-routine as component
By double clicking on the component's name in the tree-view, the plot-routine is activated and plots theprogrammedchart on the screen.
The programming of this specific plot is done in the equations-window of the component. f_gate(0)=!global_variable1;
f_gate(1)=!global_variable2;f_gate(2)=!global_variable3;
function function_name1 (){sys.function.property(1);handle=0;sys.plot(handle,sys.flow(0),sys.charttype'line',sys.flow(2),sys.flow(1)'');}
function function_name2 (){sys.function.property(2);handle=0;sys.plot(handle,sys.flow(1),sys.charttype'line',sys.flow(0)'');}
ExportThe chart as shown above can be exported in different graphical formats. Available are:
*.bmp bitmap*.emf enhanced metafile*.wmf windows metafile
The chart also can be saved as list of numerical values in a comma separated format (*.csv), which can beimported in an Excel-sheet.
Example Bar plot for the left axis and a line plot for the right axis, for data collected in the parameter list of the component.
Parameter(0) contains the number of data points. sys.plot(0,sys.name_parameter(1,parameter(0)),sys.charttype'bar',
sys.parameter(1,parameter(0),0,5)'mass[kg]',sys.axis.title(90)'[kg]',sys.charttype'line',sys.parameter(1,parameter(0),0,16)'Cumulative Mass [ton]',sys.axis 'right',sys.axis.title(90)'[ton]')'Mass';
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.query
sys.queryFunction sys.query
Syntax To select data from the database two functions in GES are available to search through the database and find a
selecting. The common query engine uses a convenient subset of SQL to access dBASE, FoxPro, Access, andParadox tables. This subset can also be used to join server-based SQL tables with these tables. GES used twofunctions to make a query on the database with the SQL language.
The GES query function with dynamical string is:HRS = SYS.QUERY ‘dynamical query string’
This function is very useful for queries on the database when some parameters are changed depending of thesimulation result under runtime. If the query succeeds the functions returns a handle of the result set else thefunctionreturned a zero.For getting the results see get database results for getting the data.
Example DB = SYS.OPENDATBASE ‘GESDATABASE’;HB = SYS.QUERY(DB)
‘select diesel from diesels when power > 1000 and power < 2000’;
SYS.CLOSEDATABASE(DB);
This example opens a GES database with alias GESDATABASE. A query is done in table diesels and a selectionis made for all diesels in the range 1000 < power < 2000. The results set is set in handle HB.If the range of the power is for instance given in parameter(0) and parameter(1) of the GES component thefollowingdynamical query string could be used.
‘select diesel from diesels when power > ‘,numtostr(parameter(0)),‘ and power < ‘,numtostr(parameter(1));
The GES function numtostr is used to convert a value of GES to a string in the query language.
The GES query function with the sql query in a file is:
HRS = SYS.QUERY.FILE ‘filename’
This function is used to execute a prepared query. The query is written in the file. If the query returns a result set,thecursor handle to the result set is returned into the address given by result HRS. If the query does not generate aresultset, the returned cursor handle is zero. If no cursor handle address is given and a result set would be returned,the result set is discarded.
Querying different databasesThe application developer can use SQL to join tables from different data sources (for example, a Paradox,InterBase,and Sybase table could all participate in a SQL query). These are called "heterogeneous joins." See Local SQLGuide.
TNO Structural Dynamics Van Mourik Broekmanweg 6 Send mail to Helpdesk with questions or comments.
www.tno.nl/ges P.O. Box 49, 2600 AA Delft, The Netherlands Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.rgb
sys.rgbFunction sys.rgb
Syntax sys.rgb (value Red, value Green, value Blue);
Transfer the three the basic colors to a color value for GES
Example sys.bkgcolor(sys,rgb(255,255,255)); white
Tip: to find the nice color use the manual Define Custom Colors of GESSee <Tools> <Background color> <Define Custom Colors>
sys.bkgcolor(sys.rgb(100,158,201));
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.search.component
sys.search.componentFunction sys.search.component
Syntax sys.search.component 'string';
Returns the pointer of the component where the name is given in the string. If the component is not find thefunction returns null.
Example app = sys.search.component 'Diesel 1';
The function search for component Diesel 1. The result is stored in variable app.With the indirect operator -> it is possible to get local variables of the component if the variableexist.for instance if the diesel contains the variable speed_diesel.
speed = app->speed_diesel.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.search.component.variable
sys.search.component.variableFunction sys.search.component.variable
Syntax sys.search.component.variable 'string';
Returns the pointer of the component where the variable given in string of one of the connected components exist.
Example app = sys.search.component.variable 'speed';
The local variable speed is search in al the connected components. If one is find the search routineis stopped and the pointer of the component is returned. In this example the address of thecomponent (pointer) is stored in local variable app. If the speed variable is not find the return valueis 0;
The value of the speed variable is app->speed.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.search
sys.searchFunction sys.search
Syntax sys.search 'string';
Returns the pointer of the variable given in string of one of the connected components.
Example p1 = sys.search 'speed';
The local variable speed is search in al the connected components. If one is find the search routineis stopped and the pointer of speed is returned. In this example the address of speed (pointer) isstored in local variable p1. If the speed variable is not find the return value is 0;
The value of the speed variable is *p1.
A asterisk * must be placed before the pointer address.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.size
sys.sizeFunction sys.size
Syntax sys.size(matrix variable);
Returns a 1:2 matrix with the dimensions of the matrix variable.
Example a = [1, 2, 3 ; 4, 5, 6];b = sys.size(a);the matrix b contains the values: [2, 3]n = sys.size(a)(0,1);n contain 3m = sys.size(a)(0,0);m contain 2
Example if parameter(1) is a matrix
The dimension matrix is:dim = sys.size(parameter(1));
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.statusbar
sys.statusbarFunction sys.statusbar shows a message in the Windows status bar.
Syntax sys.statusbar(index) 'string'; This function shows a message in the Windows status bar on position index. Example sys.statusbar(1) 'test';
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.textcolor
sys.textcolorFunction sys.textcolor
Syntax sys.textcolor(value x);
Changes the basic color of graphics text, only by animation
Example (for values between 0-13, basic colors):sys.textcolor(4);
value 0: blackvalue 1: bluevalue 2: greenvalue 3: cyanvalue 4: redvalue 5: magentavalue 6: yellowvalue 7: whitevalue 8: blackvalue 9: lightbluevalue 10: lightgreenvalue 11: lightcyanvalue 12: lightredvalue 13: lightmagenta
Example (for RGB-palette):
sys.textcolor(red+green*2^8+blue*2^16);red,green,blue could have a value between 0-255
For instance:sys.textcolor(255); redsys.textcolor(255*2^8); greensys.textcolor(255*2^16); bluesys.textcolor(255+255*2^8+255*2^16); white
also could be used sys.rgbFor instance:sys.textcolor(sys.rgb(255,255,255)); white
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions > sys.location
sys.user.locationFunction Sys.user.location sets the an include path above the system list and is only a search path for the model Syntax sys.user.location(index number)
RemarksThe include index number is the orde number in the include list.same index numbers are overruled.
Example
sys.user.location(3) 'C:\Ges\lib_new';sys.user.location(2) 'C:\Ges\lib_new1';
If orders 0, 1, are not defined orde 2 is the first path in the include list
Sys.user.location must be defined in the root component of the model
After changing sys.user.location, Reset the paths by parse the total model
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.warning
sys.warningFunction sys.warning
Syntax sys.warning;
The function forces the parser to output warnings from a particular component.
By default gives GES warnings.
This function is mostly used if for a part of the component code a warning could be given. The key word is thenused after a sys.nowarning call.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.draw.figure
sys.draw.figureFunction sys.draw.figure
Syntax sys.draw.figure ( x, y, z, phi x, phi y, phi z);
The sys.draw.figure routine draws the component drawing in runtime on position x,y,z and with orientation phi x,phiy, phi z.With this function it is possible to make animations.
Remark It is very useful to use this function in the post_function
Example sys.color(4); //color of the following drawingsys.draw.figure(!x*parameter(0),!y*parameter(0),parameter(1)*parameter(0),0,0,0); //draw the figure of thecomponentsys.textcolor(0); //color of the following textsys.draw.text(!x*parameter(0)+2,!y*parameter(0),parameter(1)*parameter(0))valtostr(!z*1000),' [mm]'; //draw textpost_function;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > sys.iteration.maxits
sys.optionFunction sys.option
Syntax sys.option 'keyword'=value;
keyword is a string. The following kewords are available.
"maxits" ,global set, see also sys.iteration.maxits"Tolf" ,global set, see also sys.iteration.tolf"Tolmin" ,global set, see also sys.iteration.tolmin"Tolx" ,global set, see also sys.iteration.tolx"Stpmx" ,global set, see also sys.iteration.stpmx"IO_Offset" ,global set, see also sys.iteration.io_offset"StopMaxits" ,global set"ShowMessages" ,global set"ShowTree" ,global set"RealTime" ,local set"StartTime" ,local set"StopTime" ,local set"NumberSteps" ,local set, number of steps to calculate"TimeStep" , local set, sample time for dynamic simulation"RunFunction" , start function with function.property(128) on run console
Example 1 sys.option "realtime" = 1; runs the program in realtime mode
Example 2 sys.option "timestep" = 0.1; sys.option "numbersteps" = 10;
Example 3 sys.option "RunFunction"= 1;
function test(){sys.function.property(128); //function to activate by using RunFunctionmessagebox 'run_test'; run.component(1,1); //model is running onesrun.component(1,1); //model is again running ones}
//in this case is the model for one step running two times.
see: sys.function.property
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions
System functionssys.bkgcolor sys.charttypesys.color sys.component.dissipation sys.component.efficiency
sys.component.gatesys.component.property sys.draw.figuresys.draw.text sys.f1sys.function.property sys.gates.efficiency sys.help sys.help.file sys.iteration.maxitssys.iteration.tolf sys.iteration.tolmin sys.iteration.tolx sys.iteration.stpmx sys.iteration.io_offset sys.nowarning sys.option sys.parameter sys.parameter.listsys.plot sys.query sys.rgb sys.search sys.search.component sys.search.component.variable sys.size sys.statusbar sys.textcolor sys.warning version
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory > GES Programming language > System workspace
System workspaceIn GES version 1.05 the system workspace is introduced. The system workspace is used for error reporting and calculation flowreporting to the user. Experienced GES users can optimize the user apparatus by using the default system workspacevariables:
!!error This variable is used to give the user information if there is an error encountered in the calculation process.
!!step This variable is used to give the user information of the actual process step. The first step value is 0 and the last step value is(!!nr_steps-1).
!!nr_steps The user can define the number of steps in the parser e.g. with !!nr_steps=20. Changing this number during runtime has noeffect.
!!flag This variable gives the user information about the state of the calculation process. The flag values are: 0 : pre-calculation1 : parameter iteration2 : parameter iteration and normal iteration 3 : normal iteration4 : normal calculation or initialization calculation (for time version of GES)5 : time calculation (for time version of GES)
!!stop This variable can be used to stop the program by making !!stop=1
It is possible to define your own global workspace variables.
[Go to top of page]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions >String functions > System Directories
System DirectoriesThe system directories of GES could be changed and set in the Tools > Options > Locations.
The user can use this locations in the GES language by using the directive $.
$(working) returns the working directory as string$(model) returns the model directory as string$(include1) returns include path 1$(include2) returns include path 2$(include #) returns help directory$(help) returns the install directory as string (path of ges.exe)$(ges) returns the install directory as string (path of ges.exe)
The user can set the include path also in the model with:
sys.user.location
sys.model.directory
sys.location
Example 1:
fopen(inpf) $(WORKING),'\CTQPRG.INP,w+t';
The file CTPRG.INP is opened in the working directory (C:\Ges) if the file exist in that directory. From GES versions after 1-3-2013 abackslash is include after the system directories of GES, so:
fopen(inpf) $(WORKING),'CTQPRG.INP,w+t';
Example 2: (after 1-3-2013)
Put in local or global variable in the comment the system path name
sys.nowarning;%dir_model =$(MODEL);%dir_ges =$(GES);%dir_include1 =$(INCLUDE1);%dir_include2 =$(INCLUDE2);%dir_help =$(HELP);%dir_working =$(WORKING);%dir_include3 =$(INCLUDE3);i=6;%dir_include_i =$(INCLUDE i); //put in local variable dir_include includepath 6%!dir_include_i =$(INCLUDE i); //put in globalvariable !dir_include include path 6
[Go to top of page]
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Introduction > System Requirements
System RequirementsGES requires:- Windows 95 (some called Windows 4.0) or Windows NT;- a personal computer with the Intel 80486 or Pentium processor and 4 megabytes or more of memory;- an 80387 math coprocessor (of coprocessor intern by the other processors);- a hard disk with 8 megabytes of free disk space;
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > tan
tanFunction tan returns a trigonometric tangent.
Syntax tan(value x)
Remarks x is an angle specified in radians
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > tanh
tanhFunction tanh returns a hyperbolic tangent.
Syntax tanh(value x);
Remarks x is an angle specified in radians. The hyperbolic tangent TANH(x) gives a similar result as the expression:
sinh(x) / cosh(x).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Theory
TheoryEnergetic systemGeneral marine systemsStructure of GESGES Programming languageDatabaseSolvers
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Time and date functions
Time and date functionsdatetime
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > To Workspace
To Workspace input output
gate energy variable symbol unit variable symbol unit
0 no no p [-] flow f [-]
Table 1 Gate variables To_Workspace component
The To_Workspace component is used to place energy values of a particular gate of an component in the global workspacevariables.
Remark: A global workspace variable is a name with at least 3 characters and marked with an exclamation mark (!).
Parameter(0):Gives the global variable where the effort of the inspected gate of the connected component is set. If this value is 0 no setting isdone.
Parameter(1):Gives the global variable where the flow of the inspected gate of the connected component is set. If this value is 0 no setting isdone.
Parameter(2):Gives the global variable where the power of the inspected gate of the connected component is set. If this value is 0 no setting isdone.
Parameter(3):Gives the global variable where the dissipation of the connected component is set. If this value is 0 no setting is done. Theinspected gate value (parameter(5) ) must be one of the gates.
Parameter(4):Contains the global variable where the efficiency of the connected component is set. If this value is 0 no setting is done. Theinspected gate value (parameter(5) ) must be one of the gates.
Parameter(5):The inspected gate number of the connected component.
Parameter(6):The inspected parameter number (index) of the connected component.
Parameter(7):The inspected parameter element row number if the inspected parameter of the connected component is a matrix.
Parameter(8):The inspected parameter element column number if the inspected parameter of the connected component is a matrix.
See also: From Workspace
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Toolbar
ToolbarCreate new fileOpen fileSave filePrint fileShow preview of model
Cut selected component(s)
Copy selected component(s)
Paste component(s)Delete selected component(s)Display diagrams in cascade modeTile diagrams horizontallyTile diagrams verticallyCompile junctionsOpen GES Organizer
Draw figure on/off
Network on/offInspect gates of selected componentShow list of components for selected componentShow equations used in selected component
Go to parent window
Go into system of selected component
Rotation angle, only applies in 3D view
Toggle between 3D and 2D viewRotate clockwise or counterclockwise about the x,y or z axis. The selected
component rotates the number of degrees given in the rotation angle form.Run simulationStop simulation
Cursor
3D rotation (Use Ctrl + Home to return to default view)
Zoom
Parse model
Simulation setup
Options
Opens help
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Tools
ToolsAES Failure module
Operational profile Probox
Project file (Dutch)
VDG
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > Tools
ToolsProtection Change and set passwordsShow log... Shows log fileOrganize Files Opens Ges organizerCombine Junctions GES 3D Screen Opens the 3D viewerNetwork Connect to Host/IP, port numberOptions Diagram, Simulation, Solution process, Model, ...Check for CRS Updates Set update frequency
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
GES package > Dynamic library > Total Harmonic Distortion
Total Harmonic DistortionThe Total harmonic distortion gives the sum of the RMSs for all harmonic components.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Components > Transformer
Transformer input output
gate energy variable symbol unit variable symbol unit
0 pos flow f [-] effort e [-]
1 neg effort e [-] flow f [-]
Table 1 Gate variables ideal transformer
This component describes an ideal transformer with a flow variable as input. The equations for this component are:
f1 = n . f0e0 = n . e1
n is the transformer ratio
f1 is the output flow of gate 1
fo is the input flow of gate 0
eo is the output effort of gate 0
e1 is the input effort of gate 1
Parameter(0):Contains the transformer ratio n.
Example:If you require a transformer with an effort variable as input you can make it with the following parser string. You must create a userdefined component with two gate numbers and one parameter number.
//transformer with effort as input
//gate(0) is energy input
//gate(1) is energy output
//parameter(0) is ratio n
name_parameter(0) 'n';
neg_gate(1);
e_gate(1) = parameter(0) * e_gate(0);
f_gate(0) = parameter(0) * f_gate(1);
See e_transformer in example model ges\examples\transfrs.mod.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > Internal > Transmission
TransmissionThis component describes a simple general transmission. The speed transmission is assumed to be constant and the torque loss isonly dependent of the efficiency factor. The power equations of this model are:
Tout ωout = η Tin ωin
if:
ωout = n ωin
then:
Tin = Tout n / η
with:
Tout = output torque [Nm]
Tin = input torque [Nm]
n = ratio [-]
η = efficiency [-]
Parameter(0): The transmission ratio n.
Parameter(1):The efficiency η.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Mathematical functions > trunc
truncFunction trunc returns a rounded value. Syntax trunc(value x)
Remarks x is the value to be truncated behind the comma. Example
trunc(3.678); returns 3.trunc(14.467) returns 14.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Component initialisation functions > e_unit_gate
unit_gateFunction unit_gate sets the effort;flow;power unit for a gate.
Syntax unit_gate(value x) ‘[unit effort];[unit flow];[unit power] ’
Remarks x is truncated (behind the decimal point) and is the gate number of the apparatus. The functionis not executed if the gate number is not present. The first gate number starts with 0,.....,etc. The string canbe 64k characters long. For the unit names only the first 10 characters are saved.
If this function is not used, the default string is ‘[-]’ and maximum number of characters is 10By using this function in the equations the unit names can be extended
Example Set the units of the mechanical effort of gate 3.
unit_gate(3) ‘[Nm;rad/s;W]’;
see als: e-unit_gate, f_unit_gate, p_unit_gate
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > unit_parameter
unit_parameterFunction unit_parameter sets or gets a name in the parameter field unit of the component. Syntax unit_parameter (value x) ‘string’ [setting]
unit_parameter (value x) [getting]
Remarks The truncated (behind the decimal point) x value is the parameter index of the component. Thefunction is not executed if the parameter index number is not present. The first parameter index startswith 0...etc. For the name only the first 10 characters of the string will be used.
Example unit_parameter(11) 'par', unit_parameter(10);
(Sets the unit parameter of parameter 11 to par concatenated to the unit of parameter 10.)
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Components > General > User Defined
User DefinedProgram
Each user defined program must contain for every gate a function named e_gate(i) or f_gate(i). The gate number i must be aconstant for assignment the function.
In GES are a lot of standard functions available for described the system behavior of the component. The source code block beforethe e_gate or f_gate function is used as one gate program. There is a definition of the GES language syntax.
Example: user defined program for a component with two gates.
//functions for gate 0 for the flow function block
a = 10;
f_gate(0) = a * f_gate(1);
//f_gate(0) = , must be the last assignment expression
//-------------------comment------------------------------------------
//functions for gate 1 for the effort function block
b = 3 + 3 * parameter(0);
e_gate(1) = e_gate(0) * b;
//e_gate(1) = , must be the last assignment expression in the function list
Remark: the assignment expression for the functions e_gate and f_gate could be in different order and are in depended of eachother.
Constructing an user defined component
With a combination of certain import library components, you can build your own model. If you want a special function you mustcombine certain components. Because the model description in GES is based on an energy basis you do not see the internalfunctions of the component directly. The functions are presented by graphical blocks. With the user defined component it ispossible to write your own gate functions. In this tutorial a simple component is constructed. Once you have built a new usercomponent, you can put it in your model like any other component.
For constructing a new component you must know certain things about it. These are:
- How many energy gates are to be defined?
- What are the energy directions of the gates? This is necessary to write a proper energy model. If you start to write a userdefined function it is recommended to define the energy directions of the gates in the code (with pos_gate(gate number),neg_gate(gate number)).
- For every gate you must decide whether it is an effort- or a flow function. The choice depends on how the new componentmust be connected to another and is it possible to make this function. If it is practically not possible to make an effort of flowfunction, you must make the other. In some cases you can have causality problems by connections with other components.
- For every gate function you must choose a gate number. If you have two gates, the numbers are 0 and 1. In the propertiesitem (right mouse click on the component) the user can set the number of gates by adding gates.
- Is the component you want to create an energy component or a signal component ? If it is a signal component you can defineit as a pre_type or a post_type. If you want to do the calculations before the energy model is running, you choose the pre_type.If you want to do the calculations after the calculation of the energy model, you choose the post_type. The default component is
the user_type.
- How many parameters do you want in the parameter list of the component? For the first time this choice is not important,because you can always add new parameters to your component. See the parameter list dialog box. If your parameter shouldbe a matrix, you must define this in your equation code (with the init_matrix function). Remark: It is not possible to removeparameters of the list. In this case you must create a new component.
- Keep in mind that all functions for the user defined component are written in the same string. You can edit the string with ausual editor. The default editor in GES is the Notepad editor of Windows.The e_gate(gate number) function and f_gate(gate number) function are used as an assign function (e_gate(gate number) =expression). The parser of GES recognizes this construction as an end for making the gate function. All functions above thisassigned function are loaded into the particular gate.
Example:
This example component has two gates. For gate number 0 an effort function is written and for gate number 1 a flow function.
> //starting functions of gate 0expression 1 //first expression or functions of //e_gate(0)etc. //more expressions... = e_gate(1) //i.e. get the effort of gate 1e_gate(0) = expresion9 //The functions from expression 1 //are loaded in gate 0 as an effort //function.//starting functions of gate 1expression 10 //first expression or functions of //f_gate(1)etc. //more expressions... = f_gate(0) //i.e. get the flow of gate 0f_gate(1) = expresion19 //The functions from expression 10 //are loaded ingate 1 as a flow //function.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Initialization functions > user_type
user_typeFunction user_type sets the apparatus in the normal calculation mode (default). Syntax user_type
Remarks This function is used to set a component in a normal calculation mode. GES treats this component as all othernormal components.
This function is useful if the functions pre_type or post_type are used before.
See also: Initialization functions, post_type , pre_type
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Manipulation functions > valstr
valstrFunction valstr returns the value of a workspace variable given in a string. Syntax valstr 'string';
Remarks This function is used to get the value of a workspace variable whit's given in the string.
The variable is generated in runtime if the variable not exist. Example aa = 10;
valstr ‘aa’;
valstr 'bb'; //the local variable bb is generated in runtime.
Returns the value of aa (10).
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > String functions > valtostr
valtostrFunction valtostr writes a variable value to a (formatted) string. Syntax valtostr (variable, "format");
Remarks Valtostr writes the variable Vs to a string.
The format string has the following form:% [flag] [width] [.prec] type
Each format specifier begins with the percent character %. After the % comes the following, in this order:- An optional sequence of flag characters [flag]- An optional width specifier [width]- An optional precision specifier [prec]- The conversion-type character [type]
Flag character:[flag] What it specifies- Left-justifies the result, pads on the right with blanks. If not given, it rightjustifies the result, pads on the
left with zeros or blanks.+ Signed conversion results always begin with a plus (+) or minus (-) sign.
Blank If value y is non negative, the output begins with a blank instead of a plus; negative values still beginwith a minus.
Width specifier:[width] How output width is affected
n At least n characters are printed. If the output value has less than n characters, the output is paddedwith blanks (right-padded if - flag given, left-padded otherwise).
0n At least n characters are printed. If the output value has less than n characters, it is filled on the leftwith zeros.
* If value y is not being formatted.
Precision specifier:[prec] How output precision is affected
none Precision set to default:default = 6 for e, E, f typesdefault = all significant digits for g, G types
.0 For e, E, f types, no decimal point is printed.
.n n characters or n decimal places are printed. If the output value has more than n characters, the outputmight be truncated or rounded. (Whether this happens depends on the type character.)
Type:[type] Format of output (input argument y is floating-point)f signed value of the form [-]dddd.dddd.e signed value of the form [-]d.dddd or e[+/-]ddd.
G signed value in either e or f , based on given value and precision.E Same as e, but with E for exponent.G Same as g, but with E for exponent if e format used
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > Tools > VDG
Voltage Design GuideThis paper describes a Voltage Design Guidelines (VDG) tool for electrical installations in ships under various conditions. Theprogram General Energy Systems (GES) simulates the electrical installation and the voltage design guidelines. The program isdeveloped by TNO for the Royal Netherlands Navy (RNLN). A voltage design module has been added to determine the correctvoltage of the electrical components in the installation. In this simulation environment, in steps is the economical best voltagelevel of the components determined.
Read the paper here.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > System functions > version
versionFunction #version gives the version number you are using times 100. So when you are using 2.14 this function will return
214. Syntax #version;
Remark If the model is saved with as a different version number. The #version number is changed when the model isparsed.
Example #IF (#version==110)
//use this code
#ELSE
//use than this code
#ENDIF
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > GES User Interface > Menu > View
View
Tree Show/hide list of components
RotateView the diagram from different perspectives. Use ctrl + home to return to the default view. Use
to rotate manually by click and drag in the diagram. The manual rotation button is alsoavaiable in the toolbar.
ZoomZoom the diagram by 25,50 100 or 200 %. Zooming can also be done by using ctrl + scroll or
using in the toolbar.Toolbars Display/hide toolbars shown in the toolbar.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES
Working with GESGetting started
Components
GES Functions
Libraries
Tools
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > write_parameters
write_parametersFunction write_parameters writes parameters from the parameter list to file. Syntax write_parameters'string';
Remarks This function writes parameters from the parameter list to file 'string'. This file can be read with read_parametersor from the Edit parameter values menu.
If the string contains the filename followed by a comma then the next character is used as the delimiter in the file.Default is a comma (,). For filenames with extension .csv the default is a semicolon (;) and for filenames withextension .par the default is a space.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD
Home > Working with GES > GES Functions > Input and output functions > write_parameters
write_workspaceFunction write_workspace writes the workspace of the component to a text file. With delimiter ; Syntax write_workspace 'string';
Remarks This function writes to local workspace of the component to text file 'string'. This file can be read withread_workspace.Format workspace text file
<varname1> ; dim m; dim n ; <CR> ; a11;a12;...; a1n <CR> ;a21; ;a2n <CR> ;am1; ;amn <CR><varname2> etc.
TNO Structural Dynamicswww.tno.nl/ges
Van Mourik Broekmanweg 6P.O. Box 49, 2600 AA Delft, The Netherlands
Send mail to Helpdesk with questions or comments.Copyright © 2013 TNO SD