Mètodes numèrics. numpy, scipy, sympy
Contingut
Introducció
(TBD)
numpy
(TBD)
scipy
Resolució numèrica d'una equació diferencial
exemple de molla en presència de fricció:
Resolució d'equacions diferencials
exemples d'equacions diferencials de primer ordre:
exemple d'equacions diferencials de segon ordre: Coupled spring-mass system
sympy
(TBD)
Instal·lació
If you wish to contribute to SymPy or like to get the latest updates as they come, install SymPy from git. To download the repository, execute the following from the command line:
$ git clone git://github.com/sympy/sympy.git
To update to the latest version, go into your repository and execute:
$ cd sympy $ git pull origin master
If you want to install SymPy, but still want to use the git version, you can run from your repository:
$ python setupegg.py develop
This will cause the installed version to always point to the version in the git directory.
After installation, it is best to verify that your freshly-installed SymPy works. To do this, start up Python and import the SymPy libraries:
$ python >>> from sympy import *
From here, execute some simple SymPy statements like the ones below:
>>> x = Symbol('x') >>> limit(sin(x)/x, x, 0) 1 >>> integrate(1/x, x) log(x)
Versions of SymPy prior to 1.0 included mpmath, but it now depends on it as an external dependency.
$ pip install mpmath.
If you use mpmath via sympy.mpmath in your code, you will need to change this to use just mpmath. If you depend on code that does this that you cannot easily change, you can work around it by doing:
import sys import mpmath sys.modules['sympy.mpmath'] = mpmath
creat per Joan Quintana Compte, novembre 2018