forked from openturns/ottemplatepython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openturns#3 from sofianehaddad/sh/fixes
Some fixes
- Loading branch information
Showing
7 changed files
with
89 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,10 @@ | ||
Examples | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
basic.ipynb | ||
|
||
Example 1: Axial stressed beam | ||
------------------------------ | ||
|
||
This example is a simple beam, restrained at one side and stressed by a traction load F at the other side. | ||
|
||
1- Problem statement | ||
```````````````````` | ||
|
||
a- Inputs | ||
''''''''' | ||
|
||
- Stochastics variables: | ||
This section illustrates how to use the template. | ||
|
||
====== ======================== ================== | ||
Name Description Distribution | ||
====== ======================== ================== | ||
F Traction load Normal(75e3, 5e3) | ||
sigma Axial stress LogNormal(300, 30) | ||
====== ======================== ================== | ||
|
||
- Deterministic independent variables: | ||
|
||
======== ================================ ================= | ||
Variable Description Value | ||
======== ================================ ================= | ||
D diameter 20.0 | ||
======== ================================ ================= | ||
|
||
b- Output | ||
''''''''' | ||
|
||
Primary energy savings :math:`G` | ||
|
||
.. math:: | ||
G = \sigma_e -\frac{F}{\pi \frac{D^2}{4} } | ||
|
||
.. toctree:: | ||
|
||
../auto_example/plot_basic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
Example : Using ottemplatepython module | ||
--------------------------------------- | ||
""" | ||
# %% | ||
# This example aims to illustrate how to use the module. | ||
|
||
# %% | ||
# | Loading python modules | ||
|
||
# %% | ||
import openturns as ot | ||
from openturns.viewer import View | ||
import numpy as np | ||
import ottemplate | ||
from matplotlib import pylab as plt | ||
|
||
# %% | ||
# | Using the module to compute power | ||
print(ottemplate.MyClass(3).power(2)) | ||
|
||
# %% | ||
# | Compute power using arrays | ||
array = np.linspace(-5, 5, 101) | ||
values = ottemplate.MyClass(array).power(2.0) | ||
|
||
# %% | ||
# | Use of graph objects | ||
graph = ot.Graph('Square function', 'x1', 'x2', True, '') | ||
graph.add(ot.Cloud(array, values)) | ||
View(graph).show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters