SmartAnalyze#

class opstool.analysis.SmartAnalyze(analysis_type='Transient', **kargs)[source]#

The SmartAnalyze is a class to provide OpenSeesPy users a easier way to conduct analyses. Original Tcl version Author: Dr. Dong Hanlin (http://www.hanlindong.com/2019/opensees-converge/) Here’s the converted python version, with some modifications.

Parameters#

analysis_type: str, default=”Transient”

Assign the analysis type, “Transient” or “Static”.

Other Parameters that control convergence#

Examples#

Note

test() and algorithm() will run automatically in SmartAnalyze, but commands such as integrator() must be defined outside SmartAnalyze.

Example 1: Basic usage for Transient#

>>> import opstool as opst
>>> ops.constraints('Transformation')
>>> ops.numberer('Plain')
>>> ops.system('BandGeneral')
>>> ops.integrator('Newmark', 0.5, 0.25)
>>> analysis = opst.SmartAnalyze(analysis_type="Transient")
>>> npts, dt = 1000, 0.01
>>> segs = analysis.transient_split(npts)
>>> for seg in segs:
>>>     analysis.TransientAnalyze(dt)

Example 2: Basic usage for Static#

>>> import opstool as opst
>>> ops.constraints('Transformation')
>>> ops.numberer('Plain')
>>> ops.system('BandGeneral')
>>> protocol=[1, -1, 1, -1, 0]
>>> analysis = opst.SmartAnalyze(analysis_type="Static")
>>> segs = analysis.static_split(protocol, 0.01)
>>> print(segs)
>>> for seg in segs:
>>>     analysis.StaticAnalyze(1, 2, seg)  # node tag 1, dof 2

Example 3: change control parameters#

>>> analysis = opst.SmartAnalyze(analysis_type="Transient",
>>>                              algoTypes=[40, 30, 20],
>>>                              printPer=20,
>>>                              tryAlterAlgoTypes=True,
>>>                             )
StaticAnalyze(node, dof, seg)[source]#

Single step static analysis and applies to displacement control only.

Parameters#

nodeint

The node tag in the displacement control.

dofint

The dof in the displacement control.

segfloat

Each load step, i.e. each element returned by static_split.

Returns#

Return 0 if successful, otherwise returns a negative number.

TransientAnalyze(dt)[source]#

Single Step Transient Analysis.

Parameters#

dtfloat

Time Step.

Returns#

Return 0 if successful, otherwise returns a negative number.

static_split(targets, maxStep=None)[source]#

Returns a sequence of substeps for static analysis, for use in outer analysis loops. It is not necessary to use this method if you already have a load sequence.

Parameters#

targets: list

A list of target displacements, the first element must be positive.

maxStep: float, default=None

The maximum step length in the displacement control. If None, targets[1] - targets[0].

Returns#

segs: list

A sequence of substeps for static analysis.

transient_split(npts)[source]#

Step Segmentation for Transient Analysis. It is not necessary to use this method.

Parameters#

nptsint

Total steps for transient analysis.

Returns#

A list to loop.