Function

In ASCMO-MOCA, you can work with models provided as a set of formulas, or you can import models created with Simulink, ASCET, ASCMO-STATIC or ASCMO-DYNAMIC and connect them to the ASCMO-MOCA project.

Specifying a function formed by a set of formulas is done in the Function Step.

Data channels, parameters, other function nodes and imported models can be used to define the expression of a function node. Several operators are available; see Mathematical Operators for Function Nodes.

You can export and import functions to and from text files that follow the formula syntax. A sample export file is given Closedhere.

trqOpt[-] = %MapOptTorque%(%Speed%,%Rel_Airmass%)

ignOpt[-] = %MapOptIgnition%(%Speed%,%Rel_Airmass%)

deltaSpark[-] = %ignOpt% - %Ignition%

etaSpark[-] = %CurveEtaDeltaSpark%(%deltaSpark%)

product[-] = %SubFunction%(%deltaSpark%, %trqOpt%, %CurveEtaDeltaSpark%)

dragTorque[-] = %MapDragTorque%(%Speed%,%Rel_Airmass%)

TorquePredict[-] = %product% - %dragTorque%

 

function SubFunction(InDeltaSpark : Data, IntrqOpt : Data, myCurve : Curve)

curveOut[-] = %myCurve%(%InDeltaSpark%)

functionOut[-] = %curveOut% .* %IntrqOpt%

See also

Function Step

Mathematical Operators for Function Nodes

Add a Function Node

Exporting and Importing Functions

Step 5: Build Up the Function (tutorial)