01.12.2012 Views

OrcaFlex Manual - Orcina

OrcaFlex Manual - Orcina

OrcaFlex Manual - Orcina

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

System Modelling: Data and Results, General Data<br />

216<br />

w<br />

� If Python 2 is selected then either version 2.6 or 2.7 will be used. If both of these versions are present on your<br />

system, then the most recent, i.e. 2.7 will be used.<br />

� If Python 3 is selected then one of version 3.0, 3.1 or 3.2 will be used. Again, if more than one of these versions is<br />

present on your system, then the most recent will be used.<br />

Initial Value<br />

When <strong>OrcaFlex</strong> calls the external function for the first time it passes this value to the function. The function can use<br />

this value as its starting value if it so chooses. Alternatively it can ignore this value and substitute a different value.<br />

Time Step<br />

Note: This value is used by <strong>OrcaFlex</strong> when drawing the model in Reset state.<br />

This specifies how frequently the external function is called to update the value of the variable data item. You can<br />

use either the inner time step, the outer time step or a user-specified time step. If you choose a user-specified time<br />

step then you input a target time step and the program uses the nearest whole multiple of the inner time step.<br />

Note: When using implicit integration, this data is ignored and the external function is called on each<br />

iteration of each time step.<br />

External Function Parameters<br />

The external function facility provides a general purpose method of passing parameters to external functions.<br />

For an example of why this is desirable consider an external function which implements a PID controller used to<br />

model the active control system for a heave compensating winch. A PID controller has a number of parameters and<br />

these could be hard coded into the external function. However, in <strong>OrcaFlex</strong> you may want to experiment by varying<br />

these parameters to see how they affect a simulation. If the parameters are hard coded then the external function<br />

DLL will have to be recompiled each time you experiment by changing the parameters.<br />

Instead <strong>OrcaFlex</strong> allows you to specify parameters for the external function as part of the <strong>OrcaFlex</strong> data. These<br />

parameters are passed to the external function. The parameters are specified as a free form multi-line text field. This<br />

means that the external function has to do some work to decode and interpret the text before it can access the<br />

parameters. However, this also means that there is a great deal of flexibility in the parameter passing mechanism.<br />

Whenever an <strong>OrcaFlex</strong> object (e.g. a Winch, a 6D Buoy, a Vessel, the Environment etc.) uses an external function then<br />

a page titled External Functions is available on that object's data form. The parameters are specified in the text<br />

field contained in this page.<br />

For native code external functions, the parameters are passed to the external function in the lpObjectParameters<br />

member of the TExternalFunctionInfo data structure. For Python external functions, the parameters are passed<br />

in the ObjectParameters attribute of the info object.<br />

For more details please refer to the <strong>OrcaFlex</strong> programming interface documentation. Also, the External Function<br />

Examples illustrate the procedure involved in passing parameters to external functions and are a useful source.<br />

Data which can be controlled by External Functions<br />

The following data items can be controlled by External Functions:<br />

� Vessel and 6D Buoy applied loads.<br />

� Wing orientation angles.<br />

� Winch tension and winch payout rate.<br />

� Current reference speed and reference direction.<br />

� Bend stiffness for Line Types.<br />

� Vessel primary motion.<br />

External Function Examples<br />

A selection of example external functions are supplied on the <strong>OrcaFlex</strong> installation disc. Alternatively these example<br />

functions can be downloaded from www.orcina.com/Support.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!