Ejemplo n.º 1
0
# Model
X0 = persalys.Input('X0', ot.Normal(1, 1))
X1 = persalys.Input('X1', ot.Normal(1, 1))
Y0 = persalys.Output('Y0')

model = persalys.SymbolicPhysicalModel('aModelPhys', [X0, X1], [Y0],
                                       ['sin(X0) + 8*X1'])
myStudy.add(model)

# limit state ##
limitState = persalys.LimitState('aLimitState', model, 'Y0', ot.Greater(), 20.)
myStudy.add(limitState)

# SORM ##
analysis = persalys.SORMAnalysis('mySORM', limitState)
myStudy.add(analysis)
print(analysis)

analysis.run()

print("result=", analysis.getResult().getSORMResult())

# SORM ##
X2 = persalys.Input('X2', 2)
model.addInput(X2)
model.setFormula('Y0', 'sin(X0) + 8*X1 + X2')

analysis2 = persalys.SORMAnalysis('mySORM2', limitState)
myStudy.add(analysis2)
print(analysis2)
Ejemplo n.º 2
0
# 3-b FORM IS ##
form_is = persalys.FORMImportanceSamplingAnalysis('FORM_IS', limitState)
form_is.setOptimizationAlgorithm(optimAlgo)
form_is.setMaximumCoefficientOfVariation(-1.)
form_is.setMaximumElapsedTime(1000)
form_is.setMaximumCalls(20)
form_is.setSeed(2)
myStudy.add(form_is)

# 3-c FORM ##
form = persalys.FORMAnalysis('FORM', limitState)
form.setOptimizationAlgorithm(optimAlgo)
myStudy.add(form)

# 3-d SORM ##
sorm = persalys.SORMAnalysis('SORM', limitState)
sorm.setOptimizationAlgorithm(optimAlgo)
myStudy.add(sorm)

# 4- sensitivity ##

# 4-a Sobol ##
sobol = persalys.SobolAnalysis('Sobol', model1)
sobol.setMaximumConfidenceIntervalLength(-1)
sobol.setMaximumElapsedTime(1000)
sobol.setMaximumCalls(20)
sobol.setReplicationSize(3)
sobol.setBlockSize(1)
sobol.setSeed(2)
sobol.setInterestVariables(['y0', 'y1'])
myStudy.add(sobol)