Skip to content

Commit

Permalink
Fix maths
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Oct 8, 2024
1 parent 09c197b commit 5b824c4
Show file tree
Hide file tree
Showing 44 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# In this example, we check that the reference probabilities in the reliability problems
# are consistent with confidence bounds from Monte-Carlo simulations.
# These 95% confidence bounds are stored in 'reliability_compute_reference_proba.csv'
# and required approximately than :math`10^9` function evaluations for each problem.
# and required approximately than :math:`10^9` function evaluations for each problem.
#
# We consider two different metrics:
#
Expand Down
2 changes: 0 additions & 2 deletions doc/examples/reliability/README.txt

This file was deleted.

2 changes: 0 additions & 2 deletions doc/examples/sensitivity/README.txt

This file was deleted.

12 changes: 9 additions & 3 deletions otbenchmark/ReliabilityLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@


def ComputeLogRelativeError(exact, computed, basis=10.0):
"""
r"""
Compute the log-relative error between exact and computed.
The log-relative error (LRE) is defined by:
.. math::
LRE = -logB(relativeError)
where relativeError is the relative error:
relativeError = abs(exact - computed) / abs(exact)
.. math::
relativeError = \frac{|exact - computed|}{|exact|}
and logB is the base-b logarithm:
logB(x) = log(x) / log(basis)
.. math::
logB(x) = \frac{log(x)}{log(basis)}
where log is the natural logarithm.
This assumes that exact is different from zero.
Expand Down
6 changes: 4 additions & 2 deletions otbenchmark/_FloodingSensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ class FloodingSensitivity(SensitivityBenchmarkProblem):
"""Class to define a Flooding sensitivity benchmark problem."""

def __init__(self):
"""
r"""
Create a Flooding sensitivity problem.
The function is defined by the equation:
g(x) = (Q/(Ks*B*sqrt((Zm-Zv)/L)))^(3.0/5.0)+Zv-Zb-Hd
.. math::
g(x) = (\frac{Q}{K_s B \sqrt{\frac{Z_m-Z_v}{L}}})^{\frac{3}{5}}+Z_v-Z_b-H_d
with:
Expand Down
20 changes: 8 additions & 12 deletions otbenchmark/_FourBranchSerialSystemReliability.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@ def __init__(self):
References
----------
Waarts, P.-H. (2000). Structural reliability using finite element
methods: an appraisal of DARS: Directional Adaptive Response Surface
Sampling. Ph. D. thesis, Technical University of Delft, The
Netherlands. Pages 58, 69, 160.
Thèse Vincent Dubourg 2011, Méta-modèles adaptatifs pour l’analyse
de fiabilité et l’optimisation sous contrainte fiabiliste,
section "A two-dimensional four-branch serial system", page 182
Parameters
----------
None.
- Waarts, P.-H. (2000). Structural reliability using finite element
methods: an appraisal of DARS: Directional Adaptive Response Surface
Sampling. Ph. D. thesis, Technical University of Delft, The
Netherlands. Pages 58, 69, 160.
- Thèse Vincent Dubourg 2011, Méta-modèles adaptatifs pour l’analyse
de fiabilité et l’optimisation sous contrainte fiabiliste,
section "A two-dimensional four-branch serial system", page 182
Examples
--------
Expand Down
8 changes: 4 additions & 4 deletions otbenchmark/_NLOscillatorSensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class NLOscillatorSensitivity(SensitivityBenchmarkProblem):
"""Class to define a Oscillator sensitivity benchmark problem."""

def __init__(self):
"""
r"""
Create a nonlinear oscillator sensitivity problem.
The function is defined by the equation:
.. math::
g(x) = fs - 3*ks*np.sqrt(np.pi*S0/(4.*xis*omegas**3)*
xi_a*xis/(xip*xis*(4.*xi_a**2+theta**2)+gamma*xi_a**2)*
(xip*omegap**3+xis*omegas**3)*omegap/(4.*xi_a*omegaa**4))
g(x) = fs - 3*ks*\sqrt{\pi*S0/(4.*xis*omegas^3)*
xi_a*xis/(xip*xis*(4.*xi_a^2+theta^2)+gamma*xi_a^2)*
(xip*omegap^3+xis*omegas^3)*omegap/(4.*xi_a*omegaa^4)}
where
* omegap = np.sqrt(kp/mp)
Expand Down

0 comments on commit 5b824c4

Please sign in to comment.