SymDR
========
SymDR - is the library made to automate the process of finding dispersion relations.
It was created in The Great Mathematical Workshop 2024 by the command of young ambitious scientists.
Features
===========
Finding dispersion relation in:
- Equations
- System of equations
- Discrete equation
- Systems of discrete equations
Quickstart
=============
For the best experience we are highly recommend to use [Jupyter Notebook](https://jupyter.org/) or [Google Collab](https://colab.research.google.com).
SymDR supports [Python](http://python.org/) >=3.7 and only depend on [Sympy](https://www.sympy.org).
Install the python package using pip
```
pip install symdr
```
Example
==========
- If you are new in symbolic mathematics in python read SymPy [introduction](https://docs.sympy.org/latest/tutorials/intro-tutorial/index.html) first.
- For the end to end example of equation analysis see [notebook](https://github.com/symdr/symdr/blob/master/example.ipynb)
>!!!!!!! IMPORTANT !!!!!!!!
>Variables `x`, `t`, `w`, `k` cannot be redefined. They are used for the algorithm. When working with discrete cases, the variables `h`, `tau`, `a` and `n` are also added to this list
SymDR have own objects for grid functions. To pretty printing this functions you need to write:
```
init_printing(latex_printer=discrete_latex_printer)
```
Creating the grid function is the same to standart function:
```
u = DiscreteGrid('u')
```
Let see discrete analog of Korteweg–De Vries equation:
$$u_{t}=6uu_{x}-u_{xxx}$$
For the third order derivative we going to use next scheme:
$$f^{(3)}(x)=\frac{f(x+2h)-2f(x+h)+2f(x-h)-f(x-2h)}{2h^3}$$
And we can write our equation
```
equation = u.diff(t) + (u.at_x(a+2) - 2 * u.at_x(a+1) + 2 * u.at_x(a-1) - u.at_x(a-2)) / (2 * h ** 3)
```
>The class allows us to denote a derivative at (a, n) with "diff" method exactly the same way as SymPy functions do.
>Shift at point is done by any of three methods:
>- at_x - shift in space (i.e. ```u.at_x(a+2)``` means $u_{a+2}^n$)
>- at_t - shift in time (i.e. ```u.at_t(n-2)``` means $u_a^{n-2}$)
>- at - shift in both axes at once (i.e. ```u.at(a+2, n-1)``` means $u_{a+2}^{n-1}$)
>Technical note: instead of moving function into a subtree of "Derivative" object, as it is with SymPy functions, differentiation of "DiscreteGrid" object simply returns an object of the same class, but with different arguments.
Finally let's find disperssion relation:
```
d_equation_dr(equation)
```
Also you can rewrite it with Euler formula :
```
d_equation_dr(equation, trig_rewrite=True)
```
And full code:
```
from sympy import *
from symdr import *
u = DiscreteGrid('u')
equation = u.diff(t) + (u.at_x(a+2) - 2 * u.at_x(a+1) + 2 * u.at_x(a-1) - u.at_x(a-2)) / (2 * h ** 3)
d_equation_dr(equation)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "symdr",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "PDE, Continuum mechanics, computer algebra, python",
"author": "A.Dzhanbekova, S.Kotov, M.Malyutin, M.Samoilov, V.Utupyina, M.Arendarenko, T.Savvateeva",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/bc/98/fdc51f4000170b2bc9d22ce89fcf1bb75f5f92aa4d8077d894e1aa2250fa/symdr-1.0.2.tar.gz",
"platform": null,
"description": "SymDR\n========\nSymDR - is the library made to automate the process of finding dispersion relations.\n\nIt was created in The Great Mathematical Workshop 2024 by the command of young ambitious scientists.\n\nFeatures\n===========\nFinding dispersion relation in:\n- Equations\n\n- System of equations\n\n- Discrete equation\n\n- Systems of discrete equations\n\n\n\nQuickstart\n=============\nFor the best experience we are highly recommend to use [Jupyter Notebook](https://jupyter.org/) or [Google Collab](https://colab.research.google.com).\n\nSymDR supports [Python](http://python.org/) >=3.7 and only depend on [Sympy](https://www.sympy.org).\nInstall the python package using pip\n```\npip install symdr\n```\n\nExample\n==========\n- If you are new in symbolic mathematics in python read SymPy [introduction](https://docs.sympy.org/latest/tutorials/intro-tutorial/index.html) first.\n- For the end to end example of equation analysis see [notebook](https://github.com/symdr/symdr/blob/master/example.ipynb)\n\n>!!!!!!! IMPORTANT !!!!!!!!\n>Variables `x`, `t`, `w`, `k` cannot be redefined. They are used for the algorithm. When working with discrete cases, the variables `h`, `tau`, `a` and `n` are also added to this list\n\n\nSymDR have own objects for grid functions. To pretty printing this functions you need to write:\n\n```\ninit_printing(latex_printer=discrete_latex_printer)\n```\nCreating the grid function is the same to standart function:\n\n```\nu = DiscreteGrid('u')\n```\n\nLet see discrete analog of Korteweg\u2013De Vries equation:\n\n$$u_{t}=6uu_{x}-u_{xxx}$$\n\n\nFor the third order derivative we going to use next scheme:\n\n$$f^{(3)}(x)=\\frac{f(x+2h)-2f(x+h)+2f(x-h)-f(x-2h)}{2h^3}$$\n\nAnd we can write our equation\n```\nequation = u.diff(t) + (u.at_x(a+2) - 2 * u.at_x(a+1) + 2 * u.at_x(a-1) - u.at_x(a-2)) / (2 * h ** 3)\n```\n>The class allows us to denote a derivative at (a, n) with \"diff\" method exactly the same way as SymPy functions do.\n>Shift at point is done by any of three methods:\n>- at_x - shift in space (i.e. ```u.at_x(a+2)``` means $u_{a+2}^n$)\n>- at_t - shift in time (i.e. ```u.at_t(n-2)``` means $u_a^{n-2}$)\n>- at - shift in both axes at once (i.e. ```u.at(a+2, n-1)``` means $u_{a+2}^{n-1}$)\n\n>Technical note: instead of moving function into a subtree of \"Derivative\" object, as it is with SymPy functions, differentiation of \"DiscreteGrid\" object simply returns an object of the same class, but with different arguments.\n\nFinally let's find disperssion relation:\n\n```\nd_equation_dr(equation)\n```\nAlso you can rewrite it with Euler formula :\n\n```\nd_equation_dr(equation, trig_rewrite=True)\n```\n\nAnd full code:\n\n```\nfrom sympy import *\nfrom symdr import *\n\nu = DiscreteGrid('u')\nequation = u.diff(t) + (u.at_x(a+2) - 2 * u.at_x(a+1) + 2 * u.at_x(a-1) - u.at_x(a-2)) / (2 * h ** 3)\n\nd_equation_dr(equation)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Find dispersion relation in PDE, systems of PDE, and discrete analogs",
"version": "1.0.2",
"project_urls": {
"github": "https://github.com/symdr/symdr"
},
"split_keywords": [
"pde",
" continuum mechanics",
" computer algebra",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f10bde560a64e169d209f502d05f12c315c205675b0b43bd2b0c1a0d8828e8fd",
"md5": "cac6810a3fe089693cb2ac52df22d6f8",
"sha256": "0f5cbf461894ed5f466f5f2e99661ee19aa68389513d01c99e897c76a09b2fc6"
},
"downloads": -1,
"filename": "symdr-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cac6810a3fe089693cb2ac52df22d6f8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 8716,
"upload_time": "2024-09-28T19:07:00",
"upload_time_iso_8601": "2024-09-28T19:07:00.828464Z",
"url": "https://files.pythonhosted.org/packages/f1/0b/de560a64e169d209f502d05f12c315c205675b0b43bd2b0c1a0d8828e8fd/symdr-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bc98fdc51f4000170b2bc9d22ce89fcf1bb75f5f92aa4d8077d894e1aa2250fa",
"md5": "37f00f107d1bcd558e9df0c98bed7002",
"sha256": "204245afa541bb75d8c8764fa04efedb991ae3af2533a22d9bb09a23d846a06e"
},
"downloads": -1,
"filename": "symdr-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "37f00f107d1bcd558e9df0c98bed7002",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 8335,
"upload_time": "2024-09-28T19:07:02",
"upload_time_iso_8601": "2024-09-28T19:07:02.688465Z",
"url": "https://files.pythonhosted.org/packages/bc/98/fdc51f4000170b2bc9d22ce89fcf1bb75f5f92aa4d8077d894e1aa2250fa/symdr-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-28 19:07:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "symdr",
"github_project": "symdr",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "symdr"
}