Skip to content

Commit

Permalink
fix: sfem example typo errors (#3711)
Browse files Browse the repository at this point in the history
* fix: implemented changes

* chore: adding changelog file 3711.fixed.md [dependabot-skip]

---------

Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
moe-ad and pyansys-ci-bot authored Jan 28, 2025
1 parent ccc39fe commit c943198
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/changelog.d/3711.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: sfem example typo errors
4 changes: 2 additions & 2 deletions doc/source/examples/extended_examples/sfem/sfem.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ def young_modulus_realization(
# Plot of ensemble variance
fig, ax = plt.subplots()
fig.set_size_inches(15, 8)
ax.plot(ensemble_var_with_realization, label="Actual variance")
ax.axhline(y=1e8, color="r", linestyle="dashed", label="Computed variance")
ax.plot(ensemble_var_with_realization, label="Computed variance")
ax.axhline(y=1e8, color="r", linestyle="dashed", label="Actual variance")
plt.xlabel("No of realizations")
plt.ylabel(r"Ensemble varianc of $E$")
ax.grid(True)
Expand Down
6 changes: 3 additions & 3 deletions doc/source/examples/extended_examples/sfem/stochastic_fem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ distribution and for each of these samples solving the deterministic problem:

.. math:: \pmb{K}(\pmb{\xi}_{(i)})\pmb{U}(\pmb{\xi}_{(i)}) = \pmb{F}(\pmb{\xi}_{(i)})

The next step is to collect the :math:`N_{sim}` response vectors :math:`\pmb{U} := \pmb{U}(\pmb{\xi}_{(i)})` and perform a statistical
The next step is to collect the :math:`N_{sim}` response vectors :math:`\pmb{U_i} := \pmb{U}(\pmb{\xi}_{(i)})` and perform a statistical
postprocessing to extract useful information such as mean value, variance, histogram, and
empirical PDF.

Expand All @@ -217,7 +217,7 @@ The following plane stress problem shows a two-dimensional cantilever structure

A two-dimensional cantilever structure under a point load.

:math:`P` is a random variable following the Gaussian distribution :math:`\mathcal{N}(0,1)` (kN), and the modulus of elasticity is a
:math:`P` is a random variable following the Gaussian distribution :math:`\mathcal{N}(10,2)` (kN), and the modulus of elasticity is a
random field given by this expression:

.. math:: E(x) = 10^5(1+0.10f(x)) (kN/m^2)
Expand Down Expand Up @@ -364,7 +364,7 @@ This function implements the preceding steps:

.. literalinclude:: sfem.py
:language: python
:lines: 444-556
:lines: 414-556

You can pass the required arguments to the defined function to run the simulations:

Expand Down
Binary file modified doc/source/examples/extended_examples/sfem/variance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c943198

Please sign in to comment.