コード例 #1
0
]
# output uncertainty
uy1 = [1] * 29

#%% Setting the observed data set

# inputs
Estime.setDados(0, (time, uxtime), (temperature, uxtemperature))
# output
Estime.setDados(1, (y, uy1))

# Defining the previous data set to be used to parameter estimation
# dataType: Defines the purpose of the informed data set: estimacao, predicao.
# glx: Degrees of freedom of quantity x;
# gly: Degrees of freedom of quantity y;
Estime.setConjunto(dataType='estimacao', glx=[], gly=[])

#%% Optimization - estimating the parameters
# initial_estimative: List with the initial estimates for the parameters;
# lower_bound: List with the lower bounds for the parameters;
# upper_bound: List with the upper bounds for the parameters;
# algorithm: Informs the optimization algorithm that will be used. Each algorithm has its own keywords;
# optimizationReport: Informs whether the optimization report should be created (True or False);
# parametersReport: Informs whether the parameters report should be created (True or False).
Estime.optimize(initial_estimative=[0.005, 20000.000],
                algorithm='ipopt',
                lower_bound=[0.006, 15000],
                upper_bound=[100, 30000],
                optimizationReport=True,
                parametersReport=False)
コード例 #2
0
ファイル: Example_2_the_basics.py プロジェクト: ddss/MT_PEU
    0.696, 0.582, 0.795, 0.800, 0.790, 0.883, 0.712, 0.576, 0.715, 0.673,
    0.802, 0.802, 0.804, 0.794, 0.804, 0.799, 0.764, 0.688, 0.717, 0.802,
    0.695, 0.808, 0.655, 0.309, 0.689, 0.437, 0.425, 0.638, .659, 0.449
]
# output uncertainty
uy = [1] * 41

#%% Setting the observed data set

# inputs
Estime.setDados(0, (time, uxtime), (temperature, uxtemperature))
# outputs
Estime.setDados(1, (y, uy))

# Defining the previous data set to be used to parameter estimation
Estime.setConjunto()

#%% Optimization - estimating the parameters
# initial_estimative: List with the initial estimates for the parameters;
# algorithm: Informs the optimization algorithm that will be used. Each algorithm has its own keywords;
# optimizationReport: Informs whether the optimization report should be created (True or False);
Estime.optimize(initial_estimative=[18, 20000.000],
                optimizationReport=False,
                algorithm='ipopt')

#%% Evaluating the parameters uncertainty and coverage region
# uncertaintyMethod: method for calculating the covariance matrix of the parameters;
# objectiveFunctionMapping: Deals with mapping the objective function (True or False);
Estime.parametersUncertainty(uncertaintyMethod='2InvHessiana',
                             objectiveFunctionMapping=True)
コード例 #3
0
    631.0, 631.0, 639.0, 639.0, 639.0, 639.0, 639.0, 639.0, 639.0, 639.0, 639.0
]

uy = [1] * 41
uxtempo = [1] * 41
uxtemperatura = [1] * 41

#Execução do MT_PEU
Estime = EstimacaoNaoLinear(Modelo,
                            simbolos_x=['t', 'T'],
                            simbolos_y=['y'],
                            simbolos_param=['ko', 'E'],
                            Folder='Exemplo1')
Estime.setDados(0, (tempo, uxtempo), (temperatura, uxtemperatura))
Estime.setDados(1, (y, uy))
Estime.setConjunto(tipo='estimacao')
Estime.optimize(initial_estimative=[0.5, 25000], algoritmo='ipopt')
Estime.incertezaParametros(metodoIncerteza='Geral' '')
Estime.predicao()

# Valores originais
hessian = array([[5.46625676e+00, -7.50116238e-03],
                 [-7.50116238e-03, 1.02960714e-05]])
sensibilidade = array([[-1.06335451e-01, 1.52826132e-04],
                       [-5.59353653e-02, 8.03907392e-05],
                       [-1.28132438e-01, 1.80542088e-04],
                       [-2.26100338e-01, 3.18581523e-04],
                       [-2.26100338e-01, 3.18581523e-04],
                       [-1.28132438e-01, 1.80542088e-04],
                       [-2.07847997e-01, 2.89084593e-04],
                       [-1.16257751e-01, 1.61696650e-04],
コード例 #4
0
]
# Output data uncertainty
uP = [
    0.08, 0.09, 0.09, 0.11, 0.17, 0.21, 0.25, 0.35, 0.40, 0.47, 0.48, 0.58,
    0.70, 0.89, 1.05, 1.28, 1.61, 2.00, 2.37, 2.90, 3.53, 4.32, 5.23
]

#%% Setting the observed data set
# inputs
Estimation.setDados(0, (T, uxT))
# outputs
Estimation.setDados(1, (P, uP))

# Defining the previous data set to be used to parameter estimation.
# dataType: Defines the purpose of the informed data set: estimacao, predicao.
Estimation.setConjunto(dataType='estimacao')

#%% Optimization - estimating the parameters,
# initial_estimative: List with the initial estimates for the parameters;
# algorithm: Informs the optimization algorithm that will be used. Each algorithm has its own keywords;
# optimizationReport: Informs whether the optimization report should be created (True or False);
# parametersReport: Informs whether the parameters report should be created (True or False).
Estimation.optimize(initial_estimative=[1, 1.5, 0.009],
                    algorithm='bonmin',
                    optimizationReport=True,
                    parametersReport=False)

#%% Evaluating the parameters uncertainty and coverage region
# uncertaintyMethod: method for calculating the covariance matrix of the parameters: 2InvHessian, Geral, SensibilidadeModelo
# Geral obtains the parameters uncertainty matrix without approximations (most accurate), while 2InvHessian and SensibilidadeModelo involves
# some approximations.
コード例 #5
0
uP = [
    0.08, 0.09, 0.09, 0.11, 0.17, 0.21, 0.25, 0.35, 0.40, 0.47, 0.48, 0.58,
    0.70, 0.89, 1.05, 1.28, 1.61, 2.00, 2.37, 2.90, 3.53, 4.32, 5.23
]

#%% Setting the observed data set
# inputs
Estimation.setDados(0, (T, uT))
# outputs
Estimation.setDados(1, (P, uP))

# Defining the previous data set to be used to parameter estimation
# dataType: Defines the purpose of the informed data set: estimacao, predicao.
# glx: Degrees of freedom of quantity x;
# gly: Degrees of freedom of quantity y;
Estimation.setConjunto(dataType='estimacao', glx=[], gly=[])

#%% Optimization - estimating the parameters
# initial_estimative: List with the initial estimates for the parameters;
# lower_bound: List with the lower bounds for the parameters;
# algorithm: Informs the optimization algorithm that will be used. Each algorithm has its own keywords;
# optimizationReport: Informs whether the optimization report should be created (True or False);
# parametersReport: Informs whether the parameters report should be created (True or False).
Estimation.optimize(initial_estimative=[200, -80680.1],
                    algorithm='ipopt',
                    optimizationReport=True,
                    parametersReport=False)

#%% Evaluating the parameters uncertainty and coverage region
# uncertaintyMethod: method for calculating the covariance matrix of the parameters;
# objectiveFunctionMapping: Deals with mapping the objective function (True or False);