# Python quartic equation solver for exact values
A Python module for the exact solutions of a quartic equation: a x^4 + b x^3 + c x^2 + d x + e = 0
## Usage
### Calculate quartic solution
The solutions are four symexpress3 objects: x1Optimized, x2Optimized, x3Optimized, x4Optimized
```py
>>> import quarticequation
>>> objQuartic = quarticequation.QuarticEquation()
>>> objQuartic.a = "1"
>>> objQuartic.b = "2"
>>> objQuartic.c = "3"
>>> objQuartic.d = "4"
>>> objQuartic.e = "5"
>>> objQuartic.calcSolutions()
>>> print( f"x1: {objQuartic.x1Optimized}\nx2: {objQuartic.x2Optimized}\nx3: {objQuartic.x3Optimized}\nx3: {objQuartic.x4Optimized}\n" )
x1: (-1/2) + ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(1/2) * (-1/2) + (1/2) * ((-2) + ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(-1/2) * 4 + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) * (-1) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ))^^(1/2)
x2: (-1/2) + ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(1/2) * (-1/2) + ((-2) + ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(-1/2) * 4 + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) * (-1) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ))^^(1/2) * (-1/2)
x3: (-1/2) + (1/2) * ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(1/2) + (1/2) * ((-2) + (-4) * ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(-1/2) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) * (-1) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ))^^(1/2)
x4: (-1/2) + (1/2) * ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(1/2) + ((-2) + (-4) * ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(-1/2) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) * (-1) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ))^^(1/2) * (-1/2)```
```
### Numeric input values
The parameters may be real numbers or symexpress3 strings
```py
>>> import quarticequation
>>> objQuartic = quarticequation.QuarticEquation()
>>> objQuartic.a = 1.0
>>> objQuartic.b = -28
>>> objQuartic.c = "200 + 66"
>>> objQuartic.d = "-1028"
>>> objQuartic.e = "2730 / 2"
>>> objQuartic.calcSolutions()
>>> print( f"x1: {objQuartic.x1Optimized}\nx2: {objQuartic.x2Optimized}\nx3: {objQuartic.x3Optimized}\nx3: {objQuartic.x4Optimized}\n" )
x1: 5
x2: 3
x3: 13
x4: 7
```
### Calculate real values
```py
>>> import quarticequation
>>> objQuartic = quarticequation.QuarticEquation()
>>> objQuartic.a = 1
>>> objQuartic.b = 2
>>> objQuartic.c = 3
>>> objQuartic.d = 4
>>> objQuartic.e = 5
>>> objQuartic.calcSolutions()
>>> print( f"x1: {objQuartic.x1Value}\nx2: {objQuartic.x2Value}\nx3: {objQuartic.x3Value}\nx4: {objQuartic.x4Value}\n" )
x1: (-1.287815479557648+0.8578967583284903j)
x2: (-1.287815479557648-0.8578967583284903j)
x3: (0.2878154795576482+1.4160930801719078j)
x4: (0.28781547955764797-1.4160930801719078j)
```
### Command line
python -m quarticequation
- *Help*: python -m quarticequation -h
- *Quartic solution*: python -m quarticequation 1 2 3 4 5
### Graphical user interface
https://github.com/SWVandenEnden/websym3
Raw data
{
"_id": null,
"home_page": null,
"name": "quarticequation",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Gien van den Enden <swvandenenden@gmail.com>",
"keywords": "math, quartic equation, symbolic",
"author": "Gien van den Enden",
"author_email": "swvandenenden@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/6d/cd/0824ec98fb8eea911617c75d8dfd01e657535b70e7c2e9a24c3646276033/quarticequation-0.0.2.tar.gz",
"platform": null,
"description": "# Python quartic equation solver for exact values\n\nA Python module for the exact solutions of a quartic equation: a x^4 + b x^3 + c x^2 + d x + e = 0\n\n## Usage\n\n### Calculate quartic solution\nThe solutions are four symexpress3 objects: x1Optimized, x2Optimized, x3Optimized, x4Optimized\n```py\n>>> import quarticequation\n>>> objQuartic = quarticequation.QuarticEquation()\n>>> objQuartic.a = \"1\"\n>>> objQuartic.b = \"2\"\n>>> objQuartic.c = \"3\"\n>>> objQuartic.d = \"4\"\n>>> objQuartic.e = \"5\"\n>>> objQuartic.calcSolutions()\n>>> print( f\"x1: {objQuartic.x1Optimized}\\nx2: {objQuartic.x2Optimized}\\nx3: {objQuartic.x3Optimized}\\nx3: {objQuartic.x4Optimized}\\n\" )\nx1: (-1/2) + ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(1/2) * (-1/2) + (1/2) * ((-2) + ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(-1/2) * 4 + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) * (-1) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ))^^(1/2)\nx2: (-1/2) + ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(1/2) * (-1/2) + ((-2) + ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(-1/2) * 4 + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) * (-1) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ))^^(1/2) * (-1/2)\nx3: (-1/2) + (1/2) * ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(1/2) + (1/2) * ((-2) + (-4) * ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(-1/2) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) * (-1) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ))^^(1/2)\nx4: (-1/2) + (1/2) * ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(1/2) + ((-2) + (-4) * ((-1) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ) * (-1))^^(-1/2) + cos( (1/3) * atan( (1/2) ) ) * 15^^(1/2) * (-1) + 5^^(1/2) * sin( (1/3) * atan( (1/2) ) ))^^(1/2) * (-1/2)```\n```\n\n### Numeric input values\nThe parameters may be real numbers or symexpress3 strings\n```py\n>>> import quarticequation\n>>> objQuartic = quarticequation.QuarticEquation()\n>>> objQuartic.a = 1.0\n>>> objQuartic.b = -28\n>>> objQuartic.c = \"200 + 66\"\n>>> objQuartic.d = \"-1028\"\n>>> objQuartic.e = \"2730 / 2\"\n>>> objQuartic.calcSolutions()\n>>> print( f\"x1: {objQuartic.x1Optimized}\\nx2: {objQuartic.x2Optimized}\\nx3: {objQuartic.x3Optimized}\\nx3: {objQuartic.x4Optimized}\\n\" )\nx1: 5\nx2: 3\nx3: 13\nx4: 7\n```\n\n### Calculate real values\n```py\n>>> import quarticequation\n>>> objQuartic = quarticequation.QuarticEquation()\n>>> objQuartic.a = 1\n>>> objQuartic.b = 2\n>>> objQuartic.c = 3\n>>> objQuartic.d = 4\n>>> objQuartic.e = 5\n>>> objQuartic.calcSolutions()\n>>> print( f\"x1: {objQuartic.x1Value}\\nx2: {objQuartic.x2Value}\\nx3: {objQuartic.x3Value}\\nx4: {objQuartic.x4Value}\\n\" )\nx1: (-1.287815479557648+0.8578967583284903j)\nx2: (-1.287815479557648-0.8578967583284903j)\nx3: (0.2878154795576482+1.4160930801719078j)\nx4: (0.28781547955764797-1.4160930801719078j)\n```\n\n\n### Command line\npython -m quarticequation\n\n- *Help*: python -m quarticequation -h\n- *Quartic solution*: python -m quarticequation 1 2 3 4 5\n\n### Graphical user interface\nhttps://github.com/SWVandenEnden/websym3\n",
"bugtrack_url": null,
"license": "GNU General Public License v3 or later (GPLv3+)",
"summary": "A Python module for the exact solutions of a quartic equation",
"version": "0.0.2",
"project_urls": {
"Source Code": "https://github.com/SWVandenEnden/quarticequation"
},
"split_keywords": [
"math",
" quartic equation",
" symbolic"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "be6255bd867b4db103c25901300bda524477982c083afe9f2d839f79e270f05f",
"md5": "5c3a0566280f7f3c740a5af9ec5fc743",
"sha256": "b61d6dd5d2d76318b1a6856857ec539e0c0a862d7038cd02c3e48fe7fc100bcd"
},
"downloads": -1,
"filename": "quarticequation-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5c3a0566280f7f3c740a5af9ec5fc743",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 21288,
"upload_time": "2024-11-05T16:57:02",
"upload_time_iso_8601": "2024-11-05T16:57:02.548081Z",
"url": "https://files.pythonhosted.org/packages/be/62/55bd867b4db103c25901300bda524477982c083afe9f2d839f79e270f05f/quarticequation-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6dcd0824ec98fb8eea911617c75d8dfd01e657535b70e7c2e9a24c3646276033",
"md5": "76aef670b7dc9b2ec10f0533ee3cd863",
"sha256": "e47daa43bba4e0e0da9b6cf77896912fd620f140366e2cf651b34c8d8f77f47b"
},
"downloads": -1,
"filename": "quarticequation-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "76aef670b7dc9b2ec10f0533ee3cd863",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 27786,
"upload_time": "2024-11-05T16:57:03",
"upload_time_iso_8601": "2024-11-05T16:57:03.675925Z",
"url": "https://files.pythonhosted.org/packages/6d/cd/0824ec98fb8eea911617c75d8dfd01e657535b70e7c2e9a24c3646276033/quarticequation-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-05 16:57:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SWVandenEnden",
"github_project": "quarticequation",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "quarticequation"
}