Giter Site home page Giter Site logo

e-dub / pyungewiss Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 627 KB

Python librarY for UNcertainty analysis in liGhtwEight desiGn with IntervalS and fuzzy numberS

Home Page: https://github.com/e-dub/pyUngewiss

License: MIT License

Python 100.00%
uncertainty uncertainties uncertainty-quantification interval interval-arithmetic intervals fuzzy possibilistic lightweight-engineering-design python python3 fuzzy-numbers bounded-uncertainty

pyungewiss's Introduction

DOI PyPi Version PyPI pyversions GitHub stars PyPi downloads Code style: blue

pyUngewiss

Python librarY for Uncertainty aNalysis in liGhtwEight desiGn with IntervalS and fuzzy numberS

Python-Bibliothek zur Unsicherheitsanalyse im Leichtbau mit Intervallen und unscharfen Zahlen

Libreria Python per l'analisi dell'incertezza nella costruzione leggera con intervalli e numeri sfocati

Installation

Prerequisites

Python 3 and you can install the necessary libraries via PIP:

pip install scipy
pip install numpy
pip install matplotlib
pip install pygmo
pip install cma

Further, for the use of gradient-based optimizers, you will need the package pyOpt.

svn checkout http://svn.pyopt.org/trunk pyopt
cd pyopt
python -m pip install -U .

For details see www.pyopt.org

Note to PyGMO: the PIP installation is currently not working. Therefore PaGMO and then PyGMO must be compiled to use the algorithms in that package.

Install

python -m pip install -U .

PIP

You can also install pyUngewiss via PIP

pip install pyUngewiss

Getting started

See iPython notebooks and Python files under examples.

Set up uncertain function with uncertain parameters and further parameters as input:

def Eigenfrequency1DoF(p, x):
    m = p[0]
    k = p[1]
    omega0 = np.sqrt(k/m)
    f0 = omega0/2/np.pi
    return(f0)

Then define the uncertain parameters -- here as intervals -- and combine in one list:

m = pu.UncertainNumber([2., 2.5])
k = pu.UncertainNumber([40000, 60000])
pUnc = [m, k]

Initialize the uncertain problem and set parameter options:

Prob = pu.UncertainAnalysis(Eigenfrequence1DoF, pUnc)
Prob.deltax = 1e-3
Prob.epsStop = 1e-3

Calculate:

Prob.calculate()

Print and plot results:

m.printValue()
k.printValue()
plt, _ = pu.plotIntervals([m.Value, k.Value],
                 labels=["mass $m$ [kg]", "stiffness $k$ [N/mm]"])
plt.show()

Author

E. J. Wehrle

pyungewiss's People

Contributors

e-dub avatar ewehrle avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.