Qsigma=558. Q = Gumbel(1./Qsigma, Qmu) Q = TruncatedDistribution(Q, 0, inf) K_s = Normal(30.0, 7.5) K_s = TruncatedDistribution(K_s, 0, inf) Z_v = Uniform(49.0, 51.0) Z_m = Uniform(54.0, 56.0) Q.setDescription(["Q (m3/s)"]) K_s.setDescription(["Ks (m^(1/3)/s)"]) Z_v.setDescription(["Zv (m)"]) Z_m.setDescription(["Zm (m)"]) View(Q.drawPDF()).show() View(K_s.drawPDF()).show() View(Z_v.drawPDF()).show() View(Z_m.drawPDF()).show() inputRandomVector = ComposedDistribution([Q, K_s, Z_v, Z_m]) outputRandomVector = RandomVector(f, RandomVector(inputRandomVector)) eventF = Event(outputRandomVector, GreaterOrEqual(), 0) algoProb = MonteCarlo(eventF) algoProb.setMaximumCoefficientOfVariation(0.05) algoProb.setMaximumOuterSampling(100000) algoProb.run() # Results resultAlgo = algoProb.getResult() Neval = f.getEvaluationCallsNumber() Pf = resultAlgo.getProbabilityEstimate()
Q = Gumbel(1./558., 1013.) Q = TruncatedDistribution(Q, 0, inf) Ks = Normal(30.0, 7.5) Ks = TruncatedDistribution(Ks, 0, inf) Zv = Uniform(49.0, 51.0) Zm = Uniform(54.0, 56.0) # 3. View the PDF Q.setDescription(["Q (m3/s)"]) Ks.setDescription(["Ks (m^(1/3)/s)"]) Zv.setDescription(["Zv (m)"]) Zm.setDescription(["Zm (m)"]) View(Q.drawPDF()).show() View(Ks.drawPDF()).show() View(Zv.drawPDF()).show() View(Zm.drawPDF()).show() # 4. Create the joint distribution function, # the output and the event. inputvector = ComposedDistribution([Q, Ks, Zv, Zm]) outputvector = RandomVector(f, RandomVector(inputvector)) eventF = Event(outputvector, GreaterOrEqual(), 0) # 4.bis Draw pairs sample = inputvector.getSample(500) myPairs = Pairs(sample, "N=500", sample.getDescription(), "red", "bullet") View(myPairs).show() # 5. Create the Monte-Carlo algorithm algoProb = MonteCarlo(eventF)