示例#1
0
        'param1': { 'min': 0.0, 'max': 10.0, 'argPos': 1 },
    },
)

m = BackwardMappingModel(
    _id= 'flowRate',
    surrogateFunction= f,
    exactTask= FlowRateExactSim(),
    substituteModels= [ idealGas.m ],
    initialisationStrategy= Strategy.InitialPoints(
        initialPoints=
        {
            'D': [0.01, 0.01, 0.01, 0.01],
            'T0': [300, 300, 300, 300],
            'p0': [2.8e5, 3.2e5, 2.8e5, 3.2e5],
            'p1Byp0': [0.03, 0.03, 0.04, 0.04],
        },
    ),
    outOfBoundsStrategy= Strategy.ExtendSpaceStochasticSampling(
        nNewPoints= 4
    ),
    parameterFittingStrategy= Strategy.NonLinFitWithErrorContol(
        testDataPercentage= 0.2,
        maxError= 0.05,
        improveErrorStrategy= Strategy.StochasticSampling(
            nNewPoints= 2
        ),
        maxIterations= 5 # Currently not used
    ),
)
示例#2
0
## Surrogate model for foam conductivity.
#
# Backward mapping model is used. Gas and polymer conductivity are taken
# from substitute models.
m_foamConductivity = BackwardMappingModel(
    _id='foamConductivity',
    surrogateFunction=f_foamConductivity,
    exactTask=FoamConductivityExactTask(),
    substituteModels=[
        gasMixtureConductivity.m_gasMixtureConductivity,\
        polymerConductivity.m_polymer_thermal_conductivity\
    ],
    initialisationStrategy=Strategy.InitialPoints(
        initialPoints=foaming_ini,
    ),
    outOfBoundsStrategy=Strategy.ExtendSpaceStochasticSampling(
        nNewPoints=4
    ),
    parameterFittingStrategy=Strategy.NonLinFitWithErrorContol(
        testDataPercentage=0.2,
        maxError=0.02,
        improveErrorStrategy=Strategy.StochasticSampling(
            nNewPoints=2
        ),
        maxIterations=5  # Currently not used
    ),
)

## Foam conductivity simulation.
#
# Runs the detailed model and saves the results.
示例#3
0
   },
)

m = BackwardMappingModel(
    _id= 'Rheology',    
    surrogateFunction= f,
    exactTask= RheologyExactTask(),
    substituteModels= [ polymerViscosity.m_polymerViscosity, SurfaceTension.m],
#    substituteModels= [ ],
    initialisationStrategy= Strategy.InitialPoints(
        initialPoints=
        {
            'T': [300.0, 310.0], # 310 is the maximum that is supported by Surface Tension Model
            'shear': [0.01, 0.1],
            'X': [0.1, 0.3],
        },
    ),
    outOfBoundsStrategy= Strategy.ExtendSpaceStochasticSampling(
        nNewPoints= 4
    ),
    parameterFittingStrategy= Strategy.NonLinFitWithErrorContol(
        testDataPercentage= 0.2,
        maxError= 0.5,
        improveErrorStrategy= Strategy.StochasticSampling(
            nNewPoints= 2
        ),
        maxIterations= 5 # Currently not used
    ),
)

示例#4
0
            'max': 2,
            'argPos': 2
        },
    },
)

# --------------------------------------------------------------------------- #

m = BackwardMappingModel(
    _id='Rheology',
    surrogateFunction=f_dummy,
    exactTask=RheologyExactTask_dummy(),
    #    surrogateFunction= f_tFEM,
    #    exactTask= RheologyExactTask_tFEM(),
    substituteModels=[polymerViscosity.m_polymerViscosity, SurfaceTension.m],
    initialisationStrategy=Strategy.InitialPoints(initialPoints={
        'T': [270.0, 330.0],
        'shear': [0, 10000],
        'X': [0, 0.3],
        'm0': [2.5e10, 1.1e10],
        'm1': [0.1, 0.1],
    }, ),
    outOfBoundsStrategy=Strategy.ExtendSpaceStochasticSampling(nNewPoints=4),
    parameterFittingStrategy=Strategy.NonLinFitWithErrorContol(
        testDataPercentage=0.2,
        maxError=0.5,
        improveErrorStrategy=Strategy.StochasticSampling(nNewPoints=2),
        maxIterations=5  # Currently not used
    ),
)
示例#5
0
            'max': 1E10,
            'argPos': 1
        },
        'param2': {
            'min': -1E10,
            'max': 1E10,
            'argPos': 2
        },
    },
    species={
        'A': blowing_agents,
        'B': monomers
    })

m = BackwardMappingModel(
    _id='SurfaceTension[A=AIR,B=THF]',
    surrogateFunction=f,
    exactTask=SurfaceTensionExactSim(),
    substituteModels=[],
    initialisationStrategy=Strategy.InitialPoints(initialPoints={
        'T': [270.0, 290.0, 300.0],
    }, ),
    outOfBoundsStrategy=Strategy.ExtendSpaceStochasticSampling(nNewPoints=4),
    parameterFittingStrategy=Strategy.NonLinFitWithErrorContol(
        testDataPercentage=0.2,
        maxError=30.0,
        improveErrorStrategy=Strategy.StochasticSampling(nNewPoints=2),
        maxIterations=5  # Currently not used
    ),
)
示例#6
0
               parameters=parameters4,
               indices=indices)

outOfBoundsStrategy = Strategy.ExtendSpaceStochasticSampling(nNewPoints=4)
parameterFittingStrategy = Strategy.NonLinFitWithErrorContol(
    testDataPercentage=0.2,
    maxError=0.1,
    improveErrorStrategy=Strategy.StochasticSampling(nNewPoints=2),
    maxIterations=5  # Currently not used
)
m_solubilityCO2PU = BackwardMappingModel(
    _id='Solubility[A=CO2,B=2]',
    surrogateFunction=f2,
    exactTask=SolubilityExactSim(),
    substituteModels=[],
    initialisationStrategy=Strategy.InitialPoints(initialPoints={
        'T': [270, 320, 370, 420],
        'xl1': [1.1e-3, 1.0e-3, 1.0e-3, 1.0e-4],
        'xl2': [0.9989, 0.999, 0.999, 0.9999],
    }, ),
    outOfBoundsStrategy=outOfBoundsStrategy,
    parameterFittingStrategy=parameterFittingStrategy)
m_solubilityAirPU = BackwardMappingModel(
    _id='Solubility[A=Air,B=2]',
    surrogateFunction=f2,
    exactTask=SolubilityExactSim(),
    substituteModels=[],
    initialisationStrategy=Strategy.InitialPoints(initialPoints={
        'T': [270, 320, 370, 420],
        'xl1': [1.1e-3, 1.0e-3, 1.0e-3, 1.0e-4],
        'xl2': [0.9989, 0.999, 0.999, 0.9999],
    }, ),
示例#7
0
m_backward = BackwardMappingModel(
    _id='FoamElasticModulus_TEST',
    surrogateFunction=f_backward,
    exactTask=MechanicalPropertiesExactSim(),
    substituteModels=[],
    initialisationStrategy=Strategy.InitialData(
        initialData={
            'rho': [
                30.2, 60, 120, 240, 30.2, 60, 120, 240, 30.2, 30.2, 30.2, 30.2,
                30.2, 30.2, 30.2
            ],
            'strut_content': [
                0.4, 0.4, 0.4, 0.4, 0.8, 0.8, 0.8, 0.8, 0.85, 0.85, 0.85, 0.85,
                0.85, 0.85, 0.85
            ],
            'Mu': [
                0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39,
                0.39, 0.39, 0.39, 0.39, 0.39
            ],
            'Sigma': [
                0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.01, 0.05,
                0.1, 0.15, 0.2, 0.25, 0.30
            ],
            'E': [
                8.16, 22.85, 52.89, 124.73, 6.53, 13.06, 30.36, 65.63, 4.97,
                5.48, 5.42, 4.52, 4.61, 4.42, 4.79
            ],
        }),
    outOfBoundsStrategy=Strategy.ExtendSpaceStochasticSampling(nNewPoints=4),
    parameterFittingStrategy=Strategy.NonLinFitWithErrorContol(
        testDataPercentage=0.2,
        maxError=9e99,
        improveErrorStrategy=Strategy.StochasticSampling(nNewPoints=2),
        maxIterations=5  # Currently not used
    ),
)
示例#8
0
        return {
            key: [
                sr[key]['min'] +
                (sr[key]['min'] - sr[key]['min']) * points[j][i]
                for j in xrange(nPoints)
            ]
            for (i, key) in enumerate(sr)
        }


m = BackwardMappingModel(
    _id='flowRate',
    surrogateFunction=f,
    exactTask=FlowRateExactSim(),
    substituteModels=[],
    initialisationStrategy=Strategy.InitialPoints(initialPoints={
        'D': [0.01, 0.01, 0.01, 0.01],
        'rho0': [3.4, 3.5, 3.4, 3.5],
        'p0': [2.8e5, 3.2e5, 2.8e5, 3.2e5],
        'p1Byp0': [0.03, 0.03, 0.04, 0.04],
    }, ),
    outOfBoundsStrategy=Strategy.ExtendSpaceStochasticSampling(nNewPoints=4),
    parameterFittingStrategy=Strategy.Test(
        testDataPercentage=0.2,
        maxError=0.5,
        improveErrorStrategy=TemporaryClass(nNewPoints=2,
                                            constraints="p0 / p1 > 0"),
        maxIterations=5  # Currently not used
    ),
)
示例#9
0
m2 = BackwardMappingModel(
    _id= 'idealGasBackward',
    exactTask= Strategy.InitialDataPoints(),
    surrogateFunction= f1,
    substituteModels= [ ],
    parameters= [ 287.0 ],
    inputs={
        'p0': { 'min': 0, 'max': 9e99 },
        'T0': { 'min': 0, 'max': 9e99 },
    },
    outputs={
        'rho0': {'min': 0, 'max': 9e99 },
    },
    initialisationStrategy= Strategy.InitialData(
        initialData={
        'p0' : [1,2,3,4,5],
        'T0' : [296,297,298,299,300],
        'rho0' : [0.000011771353234, 0.00002346343809758, 0.00003507705259219, 0.00004661298404, 0.0000580720092915],
        },
    ),
    outOfBoundsStrategy= Strategy.ExtendSpaceStochasticSampling(
        nNewPoints= 4
    ),
    parameterFittingStrategy= Strategy.NonLinFitWithErrorContol(
        testDataPercentage= 0.1,
        maxError= 0.05,
        improveErrorStrategy= Strategy.StochasticSampling(
            nNewPoints= 2
        ),
        maxIterations= 5 # Currently not used
    ),
)