devsim 2.10.0__cp39-abi3-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- devsim/__init__.py +17 -0
- devsim/devsim_py3.pyd +0 -0
- devsim/python_packages/Klaassen.py +336 -0
- devsim/python_packages/__init__.py +0 -0
- devsim/python_packages/fermi_physics.py +31 -0
- devsim/python_packages/model_create.py +262 -0
- devsim/python_packages/mos_physics.py +170 -0
- devsim/python_packages/pythonmesh.py +131 -0
- devsim/python_packages/ramp.py +101 -0
- devsim/python_packages/simple_dd.py +75 -0
- devsim/python_packages/simple_physics.py +463 -0
- devsim/umfpack/umfpack_lgpl.dll +0 -0
- devsim/umfpack/umfpack_loader.py +517 -0
- devsim/umfpack/umfshim.py +116 -0
- devsim-2.10.0.data/data/devsim_data/BUILD.md +94 -0
- devsim-2.10.0.data/data/devsim_data/CHANGES.md +773 -0
- devsim-2.10.0.data/data/devsim_data/CITATION.md +23 -0
- devsim-2.10.0.data/data/devsim_data/CODE_OF_CONDUCT.md +74 -0
- devsim-2.10.0.data/data/devsim_data/CONTRIBUTING.md +43 -0
- devsim-2.10.0.data/data/devsim_data/HOWTO.md +27 -0
- devsim-2.10.0.data/data/devsim_data/INSTALL.md +65 -0
- devsim-2.10.0.data/data/devsim_data/README.md +97 -0
- devsim-2.10.0.data/data/devsim_data/TEST.md +13 -0
- devsim-2.10.0.data/data/devsim_data/doc/devsim.pdf +0 -0
- devsim-2.10.0.data/data/devsim_data/doc/symdiff.pdf +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0_3d.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7_3d.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_2d.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_3d.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_common.py +399 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.geo +62 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.msh +65606 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.geo +183 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.msh +25808 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap.lay +1587 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap1d.py +155 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap2d.py +200 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/3dblock.geo +48 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d.py +94 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d_custom.py +159 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_2d.py +68 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_common.py +253 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_current.lay +3271 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_density.lay +3271 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_potential.lay +3272 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.msh +1477 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.py +55 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.msh +8557 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.py +74 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_equil.py +43 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_float128.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux2d.py +43 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux3d.py +54 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux_common.py +503 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/pythonmesh3d.py +61 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/ssac_diode.py +57 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/tran_diode.py +63 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.geo +160 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.msh +8599 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.py +96 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_create.py +174 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_kla.py +162 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/logElectrons.lay +1327 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/pythonmesh2d.py +100 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/test.lay +3385 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/times.txt +34 -0
- devsim-2.10.0.data/data/devsim_data/examples/plotting/visualization.ipynb +160 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/arrhenius.py +24 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/deftest.py +48 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/modellist1.py +9 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/models1.py +41 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/ordered.py +9 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/parsetest.py +107 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/remove1.py +8 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/subexpression1.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/table.py +7 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/undefined1.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/utf8.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.geo +34 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.lay +1469 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.msh +13596 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.py +177 -0
- devsim-2.10.0.data/data/devsim_data/setup.cfg +23 -0
- devsim-2.10.0.data/data/devsim_data/setup.py +58 -0
- devsim-2.10.0.data/data/devsim_data/testing/3dtetmesh.msh +281 -0
- devsim-2.10.0.data/data/devsim_data/testing/CMakeLists.txt +175 -0
- devsim-2.10.0.data/data/devsim_data/testing/Fermi1.py +59 -0
- devsim-2.10.0.data/data/devsim_data/testing/Fermi1_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/GaussFermi.py +38 -0
- devsim-2.10.0.data/data/devsim_data/testing/GaussFermi_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/cap2.py +439 -0
- devsim-2.10.0.data/data/devsim_data/testing/cap_mesh.py +33 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ1.py +79 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ2.py +79 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ3.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ4.py +105 -0
- devsim-2.10.0.data/data/devsim_data/testing/dio2_element_2d.py +136 -0
- devsim-2.10.0.data/data/devsim_data/testing/dio2_element_physics.py +302 -0
- devsim-2.10.0.data/data/devsim_data/testing/equation1.py +68 -0
- devsim-2.10.0.data/data/devsim_data/testing/erf1.py +52 -0
- devsim-2.10.0.data/data/devsim_data/testing/erf2.py +34 -0
- devsim-2.10.0.data/data/devsim_data/testing/fpetest1.py +21 -0
- devsim-2.10.0.data/data/devsim_data/testing/fpetest2.py +25 -0
- devsim-2.10.0.data/data/devsim_data/testing/gmsh_mos3d.geo +272 -0
- devsim-2.10.0.data/data/devsim_data/testing/info.py +11 -0
- devsim-2.10.0.data/data/devsim_data/testing/kahan.py +24 -0
- devsim-2.10.0.data/data/devsim_data/testing/kahan_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/laux1.py +232 -0
- devsim-2.10.0.data/data/devsim_data/testing/mctest.mc +30 -0
- devsim-2.10.0.data/data/devsim_data/testing/mctest_user.mc +33 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh1.msh +52 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh1.py +121 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2.msh +70 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2.py +210 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2d.py +105 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh3.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh4.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d.py +111 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_create.py +207 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart.py +69 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart2.py +24 -0
- devsim-2.10.0.data/data/devsim_data/testing/noise_res.py +51 -0
- devsim-2.10.0.data/data/devsim_data/testing/noise_res_2d.py +101 -0
- devsim-2.10.0.data/data/devsim_data/testing/ptest1.py +53 -0
- devsim-2.10.0.data/data/devsim_data/testing/ptest2.py +110 -0
- devsim-2.10.0.data/data/devsim_data/testing/pythonmesh1d.py +202 -0
- devsim-2.10.0.data/data/devsim_data/testing/res1.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/res2.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/res3.py +59 -0
- devsim-2.10.0.data/data/devsim_data/testing/rundifftest.py +62 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap.py +145 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_edge.py +199 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_element.py +214 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_edge.py +148 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_element.py +167 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_circ.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_res.py +30 -0
- devsim-2.10.0.data/data/devsim_data/testing/symdiff1.py +54 -0
- devsim-2.10.0.data/data/devsim_data/testing/test_common.py +435 -0
- devsim-2.10.0.data/data/devsim_data/testing/testfunc.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/testfunc_extended.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ.py +67 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ2.py +67 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ3.py +125 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_rc.py +157 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh1.msh +47 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh1.py +114 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh2.py +114 -0
- devsim-2.10.0.data/data/devsim_data/testing/utf8_2.py +126 -0
- devsim-2.10.0.dist-info/METADATA +121 -0
- devsim-2.10.0.dist-info/RECORD +157 -0
- devsim-2.10.0.dist-info/WHEEL +5 -0
- devsim-2.10.0.dist-info/licenses/LICENSE +202 -0
- devsim-2.10.0.dist-info/licenses/NOTICE +241 -0
- devsim-2.10.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
jsanchez-laptop
|
|
2
|
+
2010-01-18
|
|
3
|
+
641.932u 54.995s 11:03.33 105.0% 0+0k 0+50856io 0pf+0w
|
|
4
|
+
2010-01-19
|
|
5
|
+
641.796u 34.214s 10:45.59 104.7% 0+0k 0+48464io 0pf+0w
|
|
6
|
+
2010-01-21
|
|
7
|
+
635.427u 45.358s 10:46.31 105.3% 0+0k 64+50832io 0pf+0w
|
|
8
|
+
2010-01-23
|
|
9
|
+
2 threads
|
|
10
|
+
535.645u 39.058s 9:06.13 105.2% 0+0k 888+50616io 0pf+0w
|
|
11
|
+
1 thread
|
|
12
|
+
486.262u 7.476s 8:13.87 99.9% 0+0k 0+50576io 0pf+0w
|
|
13
|
+
|
|
14
|
+
2 threads (not waking up main thread till done.)
|
|
15
|
+
537.221u 33.854s 8:54.40 106.8% 0+0k 880+50648io 0pf+0w
|
|
16
|
+
|
|
17
|
+
2 threads (minimum task size 1024)
|
|
18
|
+
523.712u 21.493s 8:35.47 105.7% 0+0k 0+50624io 0pf+0w
|
|
19
|
+
|
|
20
|
+
# Wed Feb 3 22:13:38 CST 2010
|
|
21
|
+
# previous timing improvements due to matrix compression and thread wake up strategy
|
|
22
|
+
enable pow(double, int)
|
|
23
|
+
1 thread
|
|
24
|
+
475.505u 9.220s 8:05.24 99.8% 0+0k 872+50568io 0pf+0w
|
|
25
|
+
2 thread
|
|
26
|
+
506.747u 22.417s 8:27.87 104.1% 0+0k 0+50504io 0pf+0w
|
|
27
|
+
|
|
28
|
+
# reuse symbolic
|
|
29
|
+
1 thread
|
|
30
|
+
458.088u 8.936s 7:47.92 99.8% 0+0k 872+50536io 0pf+0w
|
|
31
|
+
456.644u 8.988s 7:46.02 99.9% 0+0k 0+50536io 0pf+0w
|
|
32
|
+
2 thread
|
|
33
|
+
488.554u 21.917s 8:08.50 104.4% 0+0k 0+50576io 0pf+0w
|
|
34
|
+
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"metadata": {},
|
|
6
|
+
"source": [
|
|
7
|
+
"# Visualizing DEVSIM results in a Jupyter Notebook\n",
|
|
8
|
+
"\n",
|
|
9
|
+
"Excellent standalone software exist to visualize meshes on results such as [VisIt](https://visit-dav.github.io/visit-website/index.html) and [Paraview](https://www.paraview.org/). \n",
|
|
10
|
+
"\n",
|
|
11
|
+
"However, it is sometimes useful to interweave code and visualization, for instance when debugging.\n",
|
|
12
|
+
"\n",
|
|
13
|
+
"There are many ways to do this. Here, we use [PyVista](https://docs.pyvista.org/) with the [panel](https://panel.holoviz.org/) backend.\n",
|
|
14
|
+
"\n",
|
|
15
|
+
"### Installing PyVista\n",
|
|
16
|
+
"\n",
|
|
17
|
+
"You will need to install the requisite packages:"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"cell_type": "code",
|
|
22
|
+
"execution_count": null,
|
|
23
|
+
"metadata": {},
|
|
24
|
+
"outputs": [],
|
|
25
|
+
"source": [
|
|
26
|
+
"install_pyvista = True # True to install\n",
|
|
27
|
+
"package_manager = 'conda' # or 'pip'\n",
|
|
28
|
+
"\n",
|
|
29
|
+
"if install_pyvista:\n",
|
|
30
|
+
" if package_manager=='conda':\n",
|
|
31
|
+
" %conda install --yes -c conda-forge pyvista\n",
|
|
32
|
+
" %conda install --yes -c conda-forge panel\n",
|
|
33
|
+
" %conda install -c conda-forge wurlitzer \n",
|
|
34
|
+
" elif package_manager=='pip':\n",
|
|
35
|
+
" %pip install pyvista\n",
|
|
36
|
+
" %pip install panel\n",
|
|
37
|
+
" %pip install wurlitzer"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"cell_type": "markdown",
|
|
42
|
+
"metadata": {},
|
|
43
|
+
"source": [
|
|
44
|
+
"### Generating mesh data\n",
|
|
45
|
+
"\n",
|
|
46
|
+
"A DEVSIM simulation's mesh data can be saved to a `.dat` file with the [devsim.write_devices](https://devsim.net/CommandReference.html#devsim.write_devices) function with the `type='tecplot'` argument. \n",
|
|
47
|
+
"\n",
|
|
48
|
+
"In this examples directory, the `gmsh_diode2d.py` and `gmsh_diode3d.py` scripts can perform this and generate, respectively, `gmsh_diode2d.dat` and `gmsh_diode3d_dd.dat`."
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"cell_type": "code",
|
|
53
|
+
"execution_count": null,
|
|
54
|
+
"metadata": {},
|
|
55
|
+
"outputs": [],
|
|
56
|
+
"source": [
|
|
57
|
+
"run = True # True to run the scripts\n",
|
|
58
|
+
"\n",
|
|
59
|
+
"if run:\n",
|
|
60
|
+
" !python ../gmsh_diode2d.py\n",
|
|
61
|
+
" !python ../gmsh_diode3d.py"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"cell_type": "markdown",
|
|
66
|
+
"metadata": {},
|
|
67
|
+
"source": [
|
|
68
|
+
"### 2D Visualization\n",
|
|
69
|
+
"\n",
|
|
70
|
+
"We can load the `.dat` data and visualize it in the notebook. Specifically, we will load the `xy` plane, and display the \"Electrons\" field:"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"cell_type": "code",
|
|
75
|
+
"execution_count": null,
|
|
76
|
+
"metadata": {},
|
|
77
|
+
"outputs": [],
|
|
78
|
+
"source": [
|
|
79
|
+
"import pyvista as pv\n",
|
|
80
|
+
"from wurlitzer import pipes # To suppress some vtk output"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"cell_type": "code",
|
|
85
|
+
"execution_count": null,
|
|
86
|
+
"metadata": {},
|
|
87
|
+
"outputs": [],
|
|
88
|
+
"source": [
|
|
89
|
+
"with pipes() as (out, err):\n",
|
|
90
|
+
" reader = pv.get_reader('../gmsh_diode2d.dat')\n",
|
|
91
|
+
" mesh = reader.read()\n",
|
|
92
|
+
" plotter = pv.Plotter(notebook=True)\n",
|
|
93
|
+
" _ = plotter.add_mesh(mesh, scalars='Electrons', log_scale=True, cmap='RdBu')\n",
|
|
94
|
+
" _ = plotter.show_grid()\n",
|
|
95
|
+
" _ = plotter.camera_position = \"xy\"\n",
|
|
96
|
+
" _ = plotter.show(jupyter_backend='panel')"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"cell_type": "markdown",
|
|
101
|
+
"metadata": {},
|
|
102
|
+
"source": [
|
|
103
|
+
"### 3D Visualization\n",
|
|
104
|
+
"\n",
|
|
105
|
+
"In 3D, we choose the `panel` backend for interactive visualization:"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"cell_type": "code",
|
|
110
|
+
"execution_count": null,
|
|
111
|
+
"metadata": {},
|
|
112
|
+
"outputs": [],
|
|
113
|
+
"source": [
|
|
114
|
+
"with pipes() as (out, err):\n",
|
|
115
|
+
" reader = pv.get_reader('../gmsh_diode3d_dd.dat')\n",
|
|
116
|
+
" mesh = reader.read()\n",
|
|
117
|
+
" plotter = pv.Plotter(notebook=True)\n",
|
|
118
|
+
" _ = plotter.add_mesh(mesh, scalars='Electrons', log_scale=True, cmap='RdBu')\n",
|
|
119
|
+
" _ = plotter.show_grid()\n",
|
|
120
|
+
" _ = plotter.show(jupyter_backend='panel')"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"cell_type": "markdown",
|
|
125
|
+
"metadata": {},
|
|
126
|
+
"source": [
|
|
127
|
+
"### Going further\n",
|
|
128
|
+
"\n",
|
|
129
|
+
"There are many more plotting options and examples in the [pyvista examples](https://docs.pyvista.org/examples/index.html)."
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"metadata": {
|
|
134
|
+
"kernelspec": {
|
|
135
|
+
"display_name": "Python 3.10.5 ('devsimscratch': conda)",
|
|
136
|
+
"language": "python",
|
|
137
|
+
"name": "python3"
|
|
138
|
+
},
|
|
139
|
+
"language_info": {
|
|
140
|
+
"codemirror_mode": {
|
|
141
|
+
"name": "ipython",
|
|
142
|
+
"version": 3
|
|
143
|
+
},
|
|
144
|
+
"file_extension": ".py",
|
|
145
|
+
"mimetype": "text/x-python",
|
|
146
|
+
"name": "python",
|
|
147
|
+
"nbconvert_exporter": "python",
|
|
148
|
+
"pygments_lexer": "ipython3",
|
|
149
|
+
"version": "3.10.5"
|
|
150
|
+
},
|
|
151
|
+
"orig_nbformat": 4,
|
|
152
|
+
"vscode": {
|
|
153
|
+
"interpreter": {
|
|
154
|
+
"hash": "64c133f3a1967b296905f90b4858707aa8b6457960082c15c2ca47266618a04c"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"nbformat": 4,
|
|
159
|
+
"nbformat_minor": 2
|
|
160
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from symdiff import *
|
|
2
|
+
# Any copyright is dedicated to the Public Domain.
|
|
3
|
+
# http://creativecommons.org/publicdomain/zero/1.0/
|
|
4
|
+
|
|
5
|
+
symdiff('define_model(arrhenius, simplify(Cf * pow(T, Etar) * exp(-Ea/T)))')
|
|
6
|
+
symdiff('define_model(KC1 , simplify(A3 * R * T * exp((A1 * (-pow(T,(-1)) + pow(A2,(-1))) * pow(R,(-1))))))')
|
|
7
|
+
symdiff('define_model(kb_model , simplify(arrhenius / KC1))')
|
|
8
|
+
symdiff('declare_model(fprod)')
|
|
9
|
+
|
|
10
|
+
symdiff('define_model(rprod , simplify(H * CN * AR))')
|
|
11
|
+
symdiff('define_model(omega_dot_H , simplify((vr_H - vf_H) * (arrhenius * fprod - kb_model * rprod)))')
|
|
12
|
+
symdiff('diff(omega_dot_H, T)')
|
|
13
|
+
symdiff('diff(omega_dot_H, H)')
|
|
14
|
+
symdiff('diff(omega_dot_H, HCN)')
|
|
15
|
+
symdiff('diff(omega_dot_H, AR)')
|
|
16
|
+
symdiff('diff(omega_dot_H, CN)')
|
|
17
|
+
|
|
18
|
+
subexpression()
|
|
19
|
+
remove_zeros()
|
|
20
|
+
mylist = ordered_list('omega_dot_H', 'omega_dot_H__T', 'omega_dot_H__H', 'omega_dot_H__HCN', 'omega_dot_H__AR', 'omega_dot_H__CN')
|
|
21
|
+
for i in mylist:
|
|
22
|
+
mv = symdiff("model_value(%s);" % i)
|
|
23
|
+
print("%s, %s" % (i, mv))
|
|
24
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from symdiff import *
|
|
2
|
+
# Any copyright is dedicated to the Public Domain.
|
|
3
|
+
# http://creativecommons.org/publicdomain/zero/1.0/
|
|
4
|
+
|
|
5
|
+
commands = [
|
|
6
|
+
"define(f(x,y),y^2, 2*y*x+3*y^2)",
|
|
7
|
+
"simplify(diff(f(x,y),x))",
|
|
8
|
+
"simplify(diff(f(x,y),y))",
|
|
9
|
+
"simplify(diff(f(y,x),y))",
|
|
10
|
+
"simplify(diff(f(y,x),x))",
|
|
11
|
+
|
|
12
|
+
"declare(cos(x))",
|
|
13
|
+
"define(sin(x),cos(x))",
|
|
14
|
+
"define(cos(x),-sin(x))",
|
|
15
|
+
"simplify(diff(sin(x),x))",
|
|
16
|
+
"simplify(diff(sin(y),x))",
|
|
17
|
+
"simplify(diff(sin(x^2),x))",
|
|
18
|
+
"simplify(diff(sin(y^2),y))",
|
|
19
|
+
|
|
20
|
+
"clear",
|
|
21
|
+
"define(f(x,y),diff(x*y^2+y^3,x),diff(x*y^2+y^3,y))",
|
|
22
|
+
"simplify(diff(f(x,y),x))",
|
|
23
|
+
"simplify(diff(f(x,y),y))",
|
|
24
|
+
"simplify(diff(f(y,x),y))",
|
|
25
|
+
"simplify(diff(f(y,x),x))",
|
|
26
|
+
|
|
27
|
+
"clear",
|
|
28
|
+
"declare(g(x,y,z))",
|
|
29
|
+
"define(f(x,y,z),g(y,z,x),1,0)",
|
|
30
|
+
"diff(f(x,y,z),x)",
|
|
31
|
+
"diff(f(a,b,c),x)",
|
|
32
|
+
"diff(f(a,b,c),a)",
|
|
33
|
+
"diff(f(a,b,c),b)",
|
|
34
|
+
"diff(f(a,b,c),c)",
|
|
35
|
+
|
|
36
|
+
"clear",
|
|
37
|
+
"a+b",
|
|
38
|
+
"$_*$_",
|
|
39
|
+
"expand($_)",
|
|
40
|
+
"simplify($_)",
|
|
41
|
+
"$a = $_ +1",
|
|
42
|
+
"$b = $_ - $a",
|
|
43
|
+
"$c = simplify($_)",
|
|
44
|
+
"$c = simplify(expand($_))",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
for i in commands:
|
|
48
|
+
print(symdiff(i))
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from symdiff import *
|
|
2
|
+
# Any copyright is dedicated to the Public Domain.
|
|
3
|
+
# http://creativecommons.org/publicdomain/zero/1.0/
|
|
4
|
+
|
|
5
|
+
print(symdiff('declare_model(x)'))
|
|
6
|
+
print(symdiff('define_model(y, a*x)'))
|
|
7
|
+
print(symdiff('diff(y, x)'))
|
|
8
|
+
print(symdiff('clear_model(x)'))
|
|
9
|
+
print(ordered_list('y'))
|
|
10
|
+
print(symdiff('declare_model(x)'))
|
|
11
|
+
print(ordered_list('y'))
|
|
12
|
+
print(symdiff('define_model(x,y)'))
|
|
13
|
+
# catch cycles
|
|
14
|
+
try:
|
|
15
|
+
print(ordered_list('y'))
|
|
16
|
+
except SymdiffError as x:
|
|
17
|
+
print(x)
|
|
18
|
+
|
|
19
|
+
for i in model_list():
|
|
20
|
+
print(i + ' ' + symdiff('model_value(%s)' % i))
|
|
21
|
+
symdiff('clear_model(%s)' % i)
|
|
22
|
+
|
|
23
|
+
print("")
|
|
24
|
+
print(symdiff('declare_model(x)'))
|
|
25
|
+
print(symdiff('define_model(y,x^2)'))
|
|
26
|
+
print(symdiff('diff(y,x)'))
|
|
27
|
+
print(symdiff('clear_model(y)'))
|
|
28
|
+
print(symdiff('model_value(y__x)'))
|
|
29
|
+
print(symdiff('diff(model_value(y__x),z)'))
|
|
30
|
+
|
|
31
|
+
for i in model_list():
|
|
32
|
+
print(i + ' ' + symdiff('model_value(%s)' % i))
|
|
33
|
+
|
|
34
|
+
print("")
|
|
35
|
+
symdiff('clear_model(x)')
|
|
36
|
+
symdiff('clear_model(x__z)')
|
|
37
|
+
|
|
38
|
+
for i in model_list():
|
|
39
|
+
print(i + ' ' + symdiff('model_value(%s)' % i))
|
|
40
|
+
symdiff('clear_model(%s)' % i)
|
|
41
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from symdiff import *
|
|
2
|
+
# Any copyright is dedicated to the Public Domain.
|
|
3
|
+
# http://creativecommons.org/publicdomain/zero/1.0/
|
|
4
|
+
|
|
5
|
+
symdiff('define_model(b, a)')
|
|
6
|
+
symdiff('define_model(d, b * c)')
|
|
7
|
+
mylist = ordered_list('d');
|
|
8
|
+
for i in mylist:
|
|
9
|
+
print(('%s' % i))
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
from symdiff import *
|
|
2
|
+
# Any copyright is dedicated to the Public Domain.
|
|
3
|
+
# http://creativecommons.org/publicdomain/zero/1.0/
|
|
4
|
+
|
|
5
|
+
def maptest(arg):
|
|
6
|
+
print("")
|
|
7
|
+
print(arg);
|
|
8
|
+
try:
|
|
9
|
+
out = symdiff(arg)
|
|
10
|
+
except SymdiffError as x:
|
|
11
|
+
out = x
|
|
12
|
+
print(out)
|
|
13
|
+
|
|
14
|
+
maptest("a*x")
|
|
15
|
+
maptest("simplify(a*a)")
|
|
16
|
+
maptest("simplify(pow(x, 0.0))")
|
|
17
|
+
maptest("simplify(pow(x, 1.0))")
|
|
18
|
+
maptest("simplify(pow(1.0, x))")
|
|
19
|
+
maptest("simplify(exp(1.0))")
|
|
20
|
+
maptest("simplify(exp(0.0))")
|
|
21
|
+
maptest("simplify(exp(log(x)))")
|
|
22
|
+
maptest("simplify(log(exp(x)))")
|
|
23
|
+
maptest("simplify(log(1.0))")
|
|
24
|
+
|
|
25
|
+
maptest("(exp(pow(c,pow(x,pow(c,x)))))")
|
|
26
|
+
maptest("diff((exp(pow(c,pow(x,pow(c,x))))),x)")
|
|
27
|
+
maptest("simplify(diff((exp(pow(c,pow(x,pow(c,x))))),x))")
|
|
28
|
+
maptest("simplify((((((((1 * pow(x,(-1))) * pow(c,x)) + ((log(c) * pow(c,x)) * log(x))) * pow(x,pow(c,x))) * log(c)) * pow(c,pow(x,pow(c,x)))) * exp(pow(c,pow(x,pow(c,x))))))")
|
|
29
|
+
|
|
30
|
+
maptest("simplify(a*5*pow(a,-1))")
|
|
31
|
+
|
|
32
|
+
maptest("c*c*c*c")
|
|
33
|
+
maptest("simplify(c*c*c*c)")
|
|
34
|
+
maptest("diff(c*c*x*x,x)")
|
|
35
|
+
|
|
36
|
+
maptest("simplify(log(pow(x,y)))")
|
|
37
|
+
|
|
38
|
+
maptest("simplify(a*a+a*a*a)")
|
|
39
|
+
maptest("simplify(a*a+a*a)")
|
|
40
|
+
maptest("simplify(a+a+a*a)")
|
|
41
|
+
maptest("simplify(a+a+a+a*a)")
|
|
42
|
+
|
|
43
|
+
maptest("simplify(y*pow(x,(-1)) * pow(x,y))");
|
|
44
|
+
maptest("simplify(pow(x,(-1)) * pow(x,y)*y)");
|
|
45
|
+
maptest("simplify(pow(x,(-1)) * pow(x,y)*x)");
|
|
46
|
+
|
|
47
|
+
maptest("unscaledval(2*x)")
|
|
48
|
+
maptest("scale(2*x)")
|
|
49
|
+
|
|
50
|
+
maptest("a - a")
|
|
51
|
+
maptest("a + -a")
|
|
52
|
+
maptest("a - b")
|
|
53
|
+
|
|
54
|
+
maptest("simplify(a - a)")
|
|
55
|
+
maptest("simplify(a + -a)")
|
|
56
|
+
maptest("simplify(a - b)")
|
|
57
|
+
|
|
58
|
+
maptest("-simplify(a - b)")
|
|
59
|
+
maptest("simplify(-simplify(a - b))")
|
|
60
|
+
|
|
61
|
+
maptest("(-1*3*4*-3*x)");
|
|
62
|
+
maptest("simplify(-1*3*4*-3*x)");
|
|
63
|
+
|
|
64
|
+
maptest("-a");
|
|
65
|
+
maptest("a++-+a")
|
|
66
|
+
maptest("a+*+a");
|
|
67
|
+
maptest("diff(-1*3*4*(-3)*x,x)");
|
|
68
|
+
maptest("diff(simplify(-1*3*4*(-3)*x),x)");
|
|
69
|
+
maptest("diff((-1*3*4*(-3)*x),x)");
|
|
70
|
+
|
|
71
|
+
maptest("(a *(-a))");
|
|
72
|
+
maptest("(a * -a)");
|
|
73
|
+
maptest("(a * (+a))");
|
|
74
|
+
maptest("(a * +a)");
|
|
75
|
+
|
|
76
|
+
maptest("expand((a)*(c+d))")
|
|
77
|
+
maptest("expand((a + b)*(c+d))")
|
|
78
|
+
maptest("expand((a+b)*(c+d)*(e+f+g))")
|
|
79
|
+
maptest("expand((a-1)*(b+1))")
|
|
80
|
+
maptest("expand((a-1)*(a+1))")
|
|
81
|
+
|
|
82
|
+
maptest("simplify((a-1)*(a+1)/(a+1))")
|
|
83
|
+
maptest("simplify((a-1)*(a+1)^2/(a+1))")
|
|
84
|
+
maptest("simplify((a-1)*(a+1)^2/(a+1)^3)")
|
|
85
|
+
|
|
86
|
+
maptest("expand((a-b)^-2)")
|
|
87
|
+
maptest("expand((a-b)^+2)")
|
|
88
|
+
maptest("expand(((a-b)^2)/((a-b)^2))")
|
|
89
|
+
maptest("expand((a-b)^2/(a-b)^2)")
|
|
90
|
+
maptest("simplify(expand((a-b)^2/(a-b)^2))")
|
|
91
|
+
maptest("simplify((a-b)^2/expand((a-b)^2))")
|
|
92
|
+
|
|
93
|
+
maptest("unscaledval(-1*10)")
|
|
94
|
+
maptest("scale(-1*10)")
|
|
95
|
+
maptest("unsignedval(-1*10)")
|
|
96
|
+
maptest("sign(-1*10)")
|
|
97
|
+
maptest("(a-3)")
|
|
98
|
+
maptest("simplify(a-3)")
|
|
99
|
+
maptest("2-10")
|
|
100
|
+
maptest("unscaledval(-10)")
|
|
101
|
+
maptest("scale(-10)")
|
|
102
|
+
maptest("sign(-10)")
|
|
103
|
+
maptest("unsignedval(-10)")
|
|
104
|
+
maptest("simplify(-8*a*x^2 -3*b*c^2)")
|
|
105
|
+
|
|
106
|
+
maptest("simplify(x,y)")
|
|
107
|
+
maptest("subst(y)")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from symdiff import *
|
|
2
|
+
# Any copyright is dedicated to the Public Domain.
|
|
3
|
+
# http://creativecommons.org/publicdomain/zero/1.0/
|
|
4
|
+
|
|
5
|
+
symdiff('define_model(x, y * z)')
|
|
6
|
+
symdiff('define_model(z, y * z)')
|
|
7
|
+
subexpression()
|
|
8
|
+
l = model_list()
|
|
9
|
+
for i in l:
|
|
10
|
+
print(("%s, %s" % (i, symdiff('model_value(%s)' % i))))
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from symdiff import *
|
|
2
|
+
# Any copyright is dedicated to the Public Domain.
|
|
3
|
+
# http://creativecommons.org/publicdomain/zero/1.0/
|
|
4
|
+
|
|
5
|
+
symdiff('declare_model(y)')
|
|
6
|
+
symdiff('define_model(x, 3 * y + z)')
|
|
7
|
+
symdiff('diff(x, z)')
|
|
8
|
+
print(('%s' % symdiff('model_value(x)')))
|
|
9
|
+
print(('%s' % symdiff('model_value(x__z)')))
|
|
10
|
+
print(('%s' % symdiff('model_value(y__z)')))
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from symdiff import *
|
|
3
|
+
# Any copyright is dedicated to the Public Domain.
|
|
4
|
+
# http://creativecommons.org/publicdomain/zero/1.0/
|
|
5
|
+
|
|
6
|
+
alpha = 'α'
|
|
7
|
+
print(alpha)
|
|
8
|
+
x = symdiff('%s' % alpha);
|
|
9
|
+
x = symdiff('diff(%s^2, %s)' % (alpha, alpha));
|
|
10
|
+
print(x)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Point(1) = {-10, -10, 0};
|
|
2
|
+
Point(2) = {-10, 10, 0};
|
|
3
|
+
Point(3) = {10, 10, 0};
|
|
4
|
+
Point(4) = {10, -10, 0};
|
|
5
|
+
Point(5) = {-0.3, 0, 0};
|
|
6
|
+
Point(6) = {-0.2, 0, 0};
|
|
7
|
+
Point(7) = {-0.1, 0, 0};
|
|
8
|
+
Point(8) = {0.1, 0, 0};
|
|
9
|
+
Point(9) = {0.2, 0, 0};
|
|
10
|
+
Point(10) = {0.3, 0, 0};
|
|
11
|
+
Point(11) = {0, -10, 0};
|
|
12
|
+
Line(1) = {2, 3};
|
|
13
|
+
Line(2) = {3, 4};
|
|
14
|
+
Line(3) = {4, 11};
|
|
15
|
+
Line(4) = {11, 1};
|
|
16
|
+
Line(5) = {1, 2};
|
|
17
|
+
Line Loop(5) = {1, 2, 3, 4,5};
|
|
18
|
+
Characteristic Length {1, 2, 3, 4,11} = 1;
|
|
19
|
+
Characteristic Length {5, 6,7,8,9,10} = 0.01;
|
|
20
|
+
Circle(7) = {5, 6, 7};
|
|
21
|
+
Circle(8) = {7, 6, 5};
|
|
22
|
+
Circle(9) = {8, 9, 10};
|
|
23
|
+
Circle(10) = {10, 9, 8};
|
|
24
|
+
Line Loop(11) = {8, 7};
|
|
25
|
+
Plane Surface(12) = {11};
|
|
26
|
+
Line Loop(13) = {10, 9};
|
|
27
|
+
Plane Surface(14) = {13};
|
|
28
|
+
Plane Surface(15) = {5, 11, 13};
|
|
29
|
+
Physical Surface("air") = {15};
|
|
30
|
+
Physical Surface("left") = {12};
|
|
31
|
+
Physical Surface("right") = {14};
|
|
32
|
+
Physical Line("air_left_interface") = {8, 7};
|
|
33
|
+
Physical Line("air_right_interface") = {10, 9};
|
|
34
|
+
Physical Point("bottom") = {11};
|