MATLAB interface: Results

Time Histories

To obtain a time history for a variable, call:

timehistory = myobject.TimeHistory(variableName, objectExtra, period)

variableName is the name of a variable from the list in the OrcaFlex results form for the selected object. Available time history result variable names for an object can be obtained from within MATLAB using the following function:

resultVars = myobject.vars(ofx.rtTimeHistory, objectExtra)

See ofxObject.vars for more information on this function.

The period parameter is a MATLAB structure representing the C API structure TPeriod. For the whole simulation, use ofx.Period(ofx.pnWholeSimulation) or for part of a simulation use ofx.Period(fromtime, totime), see MATLAB interface: ofx. If the period parameter is omitted, then the default period depends on the model state (ofxModel.state). If the model is in static state then the period will default to ofxPeriod(ofx.pnStaticState), otherwise for a completed simulation (state is ofx.msSimulationStopped) the period will be ofx.Period(ofx.pnWholeSimulation).

objectExtra is a MATLAB structure representing the C API structure TObjectExtra2. The MATLAB interface provides some helper functions for constructing this structure, see MATLAB interface: ofx. The objectExtra parameter is only required for certain OrcaFlex object types and results.

Time History Examples

Line end moment time history for EndA for the whole simulation:

model = ofxModel('MyFile.sim')

line = model('Line1')

EndMoment_TH = line.TimeHistory('End Moment', ofx.oeEndA)

Bend moment at a specified arc length for a specified period:

BendMoment_TH = line.TimeHistory('Bend Moment', ofx.Period(-1.5, 3.4), ofx.oeArcLength(34.5))

Range Graphs

Range graphs are obtained from line objects with the RangeGraph function. The call is of the form:

line = model('MyLine')

RangeGraphResults = line.RangeGraph(variableName, period, objectExtra, arclengthRange)

The parameters variableName, period and objectExtra are as described for time histories above. If period is not specified the default is used (see above), objectExtra is only required for certain OrcaFlex object types and results. arclengthRange is a MATLAB structure representing the C API TArclengthRange, this parameter is optional, the default is the entire line. The MATLAB interface provides three helper functions for creating an ArclengthRange structure, see MATLAB interface: ofx. The RangeGraph function returns a structure whose fields are the desired range graph arrays. For instance to get an array of the maximum values:

max_values = RangeGraphResults.Max

Range Graph examples

Range graph of curvature over for the whole simulation:

RangeGraphResults = line.RangeGraph('Curvature')

Bend moment range graph for a specified period:

RangeGraphResults = line.RangeGraph('Bend Moment', ofx.Period(5.0, 7.0))