passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.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.
Potentially problematic release.
This version of passagemath-singular might be problematic. Click here for more details.
- PySingular.cpython-314-aarch64-linux-gnu.so +0 -0
- passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
- passagemath_singular-10.6.31rc3.dist-info/RECORD +490 -0
- passagemath_singular-10.6.31rc3.dist-info/WHEEL +6 -0
- passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
- passagemath_singular.libs/libSingular-4-6a2a8666.4.1.so +0 -0
- passagemath_singular.libs/libcddgmp-ac579979.so.0.1.3 +0 -0
- passagemath_singular.libs/libfactory-4-66e33516.4.1.so +0 -0
- passagemath_singular.libs/libflint-81de1160.so.21.0.0 +0 -0
- passagemath_singular.libs/libgf2x-fbd36f80.so.3.0.0 +0 -0
- passagemath_singular.libs/libgfortran-e1b7dfc8.so.5.0.0 +0 -0
- passagemath_singular.libs/libgmp-93ebf16a.so.10.5.0 +0 -0
- passagemath_singular.libs/libgsl-e3525837.so.28.0.0 +0 -0
- passagemath_singular.libs/libmpfr-e0f11cf3.so.6.2.1 +0 -0
- passagemath_singular.libs/libntl-0043a3a2.so.44.0.1 +0 -0
- passagemath_singular.libs/libomalloc-0-06512335.9.6.so +0 -0
- passagemath_singular.libs/libopenblasp-r0-4c5b64b1.3.29.so +0 -0
- passagemath_singular.libs/libpolys-4-cb7246b5.4.1.so +0 -0
- passagemath_singular.libs/libreadline-28330744.so.8.2 +0 -0
- passagemath_singular.libs/libsingular_resources-4-8c425241.4.1.so +0 -0
- passagemath_singular.libs/libtinfo-f81c2d16.so.6.3 +0 -0
- sage/algebras/all__sagemath_singular.py +3 -0
- sage/algebras/fusion_rings/all.py +19 -0
- sage/algebras/fusion_rings/f_matrix.py +2448 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
- sage/algebras/fusion_rings/fusion_double.py +899 -0
- sage/algebras/fusion_rings/fusion_ring.py +1580 -0
- sage/algebras/fusion_rings/poly_tup_engine.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
- sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
- sage/algebras/fusion_rings/shm_managers.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/fusion_rings/shm_managers.pxd +24 -0
- sage/algebras/fusion_rings/shm_managers.pyx +780 -0
- sage/algebras/letterplace/all.py +1 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
- sage/algebras/letterplace/free_algebra_letterplace.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
- sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
- sage/algebras/letterplace/letterplace_ideal.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
- sage/algebras/quatalg/all.py +2 -0
- sage/algebras/quatalg/quaternion_algebra.py +4778 -0
- sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
- sage/algebras/quatalg/quaternion_algebra_element.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
- sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
- sage/all__sagemath_singular.py +11 -0
- sage/ext_data/all__sagemath_singular.py +1 -0
- sage/ext_data/singular/function_field/core.lib +98 -0
- sage/interfaces/all__sagemath_singular.py +1 -0
- sage/interfaces/singular.py +2835 -0
- sage/libs/all__sagemath_singular.py +1 -0
- sage/libs/singular/__init__.py +1 -0
- sage/libs/singular/decl.pxd +1168 -0
- sage/libs/singular/function.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/function.pxd +87 -0
- sage/libs/singular/function.pyx +1901 -0
- sage/libs/singular/function_factory.py +61 -0
- sage/libs/singular/groebner_strategy.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/groebner_strategy.pxd +22 -0
- sage/libs/singular/groebner_strategy.pyx +582 -0
- sage/libs/singular/option.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/option.pyx +671 -0
- sage/libs/singular/polynomial.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/polynomial.pxd +39 -0
- sage/libs/singular/polynomial.pyx +661 -0
- sage/libs/singular/ring.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/ring.pxd +58 -0
- sage/libs/singular/ring.pyx +893 -0
- sage/libs/singular/singular.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/libs/singular/singular.pxd +72 -0
- sage/libs/singular/singular.pyx +1944 -0
- sage/libs/singular/standard_options.py +145 -0
- sage/matrix/all__sagemath_singular.py +1 -0
- sage/matrix/matrix_mpolynomial_dense.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
- sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
- sage/rings/all__sagemath_singular.py +1 -0
- sage/rings/function_field/all__sagemath_singular.py +1 -0
- sage/rings/function_field/derivations_polymod.py +911 -0
- sage/rings/function_field/element_polymod.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/rings/function_field/element_polymod.pyx +406 -0
- sage/rings/function_field/function_field_polymod.py +2611 -0
- sage/rings/function_field/ideal_polymod.py +1775 -0
- sage/rings/function_field/order_polymod.py +1475 -0
- sage/rings/function_field/place_polymod.py +681 -0
- sage/rings/polynomial/all__sagemath_singular.py +1 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
- sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
- sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
- sage/rings/polynomial/plural.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/plural.pxd +48 -0
- sage/rings/polynomial/plural.pyx +3171 -0
- sage/symbolic/all__sagemath_singular.py +1 -0
- sage/symbolic/comparison_impl.pxi +428 -0
- sage/symbolic/constants_c_impl.pxi +178 -0
- sage/symbolic/expression.cpython-314-aarch64-linux-gnu.so +0 -0
- sage/symbolic/expression.pxd +7 -0
- sage/symbolic/expression.pyx +14200 -0
- sage/symbolic/getitem_impl.pxi +202 -0
- sage/symbolic/pynac.pxi +572 -0
- sage/symbolic/pynac_constant_impl.pxi +133 -0
- sage/symbolic/pynac_function_impl.pxi +206 -0
- sage/symbolic/pynac_impl.pxi +2576 -0
- sage/symbolic/pynac_wrap.h +124 -0
- sage/symbolic/series_impl.pxi +272 -0
- sage/symbolic/substitution_map_impl.pxi +94 -0
- sage_wheels/bin/ESingular +0 -0
- sage_wheels/bin/Singular +0 -0
- sage_wheels/bin/TSingular +0 -0
- sage_wheels/lib/singular/MOD/cohomo.la +41 -0
- sage_wheels/lib/singular/MOD/cohomo.so +0 -0
- sage_wheels/lib/singular/MOD/customstd.la +41 -0
- sage_wheels/lib/singular/MOD/customstd.so +0 -0
- sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
- sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
- sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
- sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
- sage_wheels/lib/singular/MOD/gitfan.la +41 -0
- sage_wheels/lib/singular/MOD/gitfan.so +0 -0
- sage_wheels/lib/singular/MOD/interval.la +41 -0
- sage_wheels/lib/singular/MOD/interval.so +0 -0
- sage_wheels/lib/singular/MOD/loctriv.la +41 -0
- sage_wheels/lib/singular/MOD/loctriv.so +0 -0
- sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
- sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
- sage_wheels/lib/singular/MOD/partialgb.la +41 -0
- sage_wheels/lib/singular/MOD/partialgb.so +0 -0
- sage_wheels/lib/singular/MOD/pyobject.la +41 -0
- sage_wheels/lib/singular/MOD/pyobject.so +0 -0
- sage_wheels/lib/singular/MOD/singmathic.la +41 -0
- sage_wheels/lib/singular/MOD/singmathic.so +0 -0
- sage_wheels/lib/singular/MOD/sispasm.la +41 -0
- sage_wheels/lib/singular/MOD/sispasm.so +0 -0
- sage_wheels/lib/singular/MOD/subsets.la +41 -0
- sage_wheels/lib/singular/MOD/subsets.so +0 -0
- sage_wheels/lib/singular/MOD/systhreads.la +41 -0
- sage_wheels/lib/singular/MOD/systhreads.so +0 -0
- sage_wheels/lib/singular/MOD/syzextra.la +41 -0
- sage_wheels/lib/singular/MOD/syzextra.so +0 -0
- sage_wheels/libexec/singular/MOD/change_cost +0 -0
- sage_wheels/libexec/singular/MOD/singularsurf +11 -0
- sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
- sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
- sage_wheels/libexec/singular/MOD/solve_IP +0 -0
- sage_wheels/libexec/singular/MOD/surfex +16 -0
- sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
- sage_wheels/share/factory/gftables/10201 +342 -0
- sage_wheels/share/factory/gftables/1024 +37 -0
- sage_wheels/share/factory/gftables/10609 +356 -0
- sage_wheels/share/factory/gftables/11449 +384 -0
- sage_wheels/share/factory/gftables/11881 +398 -0
- sage_wheels/share/factory/gftables/121 +6 -0
- sage_wheels/share/factory/gftables/12167 +408 -0
- sage_wheels/share/factory/gftables/125 +7 -0
- sage_wheels/share/factory/gftables/12769 +428 -0
- sage_wheels/share/factory/gftables/128 +7 -0
- sage_wheels/share/factory/gftables/1331 +47 -0
- sage_wheels/share/factory/gftables/1369 +48 -0
- sage_wheels/share/factory/gftables/14641 +490 -0
- sage_wheels/share/factory/gftables/15625 +523 -0
- sage_wheels/share/factory/gftables/16 +3 -0
- sage_wheels/share/factory/gftables/16129 +540 -0
- sage_wheels/share/factory/gftables/16384 +549 -0
- sage_wheels/share/factory/gftables/16807 +563 -0
- sage_wheels/share/factory/gftables/1681 +58 -0
- sage_wheels/share/factory/gftables/169 +8 -0
- sage_wheels/share/factory/gftables/17161 +574 -0
- sage_wheels/share/factory/gftables/1849 +64 -0
- sage_wheels/share/factory/gftables/18769 +628 -0
- sage_wheels/share/factory/gftables/19321 +646 -0
- sage_wheels/share/factory/gftables/19683 +659 -0
- sage_wheels/share/factory/gftables/2048 +71 -0
- sage_wheels/share/factory/gftables/2187 +75 -0
- sage_wheels/share/factory/gftables/2197 +76 -0
- sage_wheels/share/factory/gftables/2209 +76 -0
- sage_wheels/share/factory/gftables/22201 +742 -0
- sage_wheels/share/factory/gftables/22801 +762 -0
- sage_wheels/share/factory/gftables/2401 +82 -0
- sage_wheels/share/factory/gftables/243 +11 -0
- sage_wheels/share/factory/gftables/24389 +815 -0
- sage_wheels/share/factory/gftables/24649 +824 -0
- sage_wheels/share/factory/gftables/25 +3 -0
- sage_wheels/share/factory/gftables/256 +11 -0
- sage_wheels/share/factory/gftables/26569 +888 -0
- sage_wheels/share/factory/gftables/27 +3 -0
- sage_wheels/share/factory/gftables/27889 +932 -0
- sage_wheels/share/factory/gftables/2809 +96 -0
- sage_wheels/share/factory/gftables/28561 +954 -0
- sage_wheels/share/factory/gftables/289 +12 -0
- sage_wheels/share/factory/gftables/29791 +995 -0
- sage_wheels/share/factory/gftables/29929 +1000 -0
- sage_wheels/share/factory/gftables/3125 +107 -0
- sage_wheels/share/factory/gftables/32 +4 -0
- sage_wheels/share/factory/gftables/32041 +1070 -0
- sage_wheels/share/factory/gftables/32761 +1094 -0
- sage_wheels/share/factory/gftables/32768 +1095 -0
- sage_wheels/share/factory/gftables/343 +14 -0
- sage_wheels/share/factory/gftables/3481 +118 -0
- sage_wheels/share/factory/gftables/361 +14 -0
- sage_wheels/share/factory/gftables/36481 +1218 -0
- sage_wheels/share/factory/gftables/3721 +126 -0
- sage_wheels/share/factory/gftables/37249 +1244 -0
- sage_wheels/share/factory/gftables/38809 +1296 -0
- sage_wheels/share/factory/gftables/39601 +1322 -0
- sage_wheels/share/factory/gftables/4 +3 -0
- sage_wheels/share/factory/gftables/4096 +139 -0
- sage_wheels/share/factory/gftables/44521 +1486 -0
- sage_wheels/share/factory/gftables/4489 +152 -0
- sage_wheels/share/factory/gftables/49 +4 -0
- sage_wheels/share/factory/gftables/4913 +166 -0
- sage_wheels/share/factory/gftables/49729 +1660 -0
- sage_wheels/share/factory/gftables/5041 +170 -0
- sage_wheels/share/factory/gftables/50653 +1691 -0
- sage_wheels/share/factory/gftables/512 +20 -0
- sage_wheels/share/factory/gftables/51529 +1720 -0
- sage_wheels/share/factory/gftables/52441 +1750 -0
- sage_wheels/share/factory/gftables/529 +20 -0
- sage_wheels/share/factory/gftables/5329 +180 -0
- sage_wheels/share/factory/gftables/54289 +1812 -0
- sage_wheels/share/factory/gftables/57121 +1906 -0
- sage_wheels/share/factory/gftables/58081 +1938 -0
- sage_wheels/share/factory/gftables/59049 +1971 -0
- sage_wheels/share/factory/gftables/6241 +210 -0
- sage_wheels/share/factory/gftables/625 +23 -0
- sage_wheels/share/factory/gftables/63001 +2102 -0
- sage_wheels/share/factory/gftables/64 +5 -0
- sage_wheels/share/factory/gftables/6561 +221 -0
- sage_wheels/share/factory/gftables/6859 +231 -0
- sage_wheels/share/factory/gftables/6889 +232 -0
- sage_wheels/share/factory/gftables/729 +27 -0
- sage_wheels/share/factory/gftables/7921 +266 -0
- sage_wheels/share/factory/gftables/8 +3 -0
- sage_wheels/share/factory/gftables/81 +5 -0
- sage_wheels/share/factory/gftables/8192 +276 -0
- sage_wheels/share/factory/gftables/841 +30 -0
- sage_wheels/share/factory/gftables/9 +3 -0
- sage_wheels/share/factory/gftables/9409 +316 -0
- sage_wheels/share/factory/gftables/961 +34 -0
- sage_wheels/share/info/singular.info +191898 -0
- sage_wheels/share/singular/LIB/GND.lib +1359 -0
- sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
- sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
- sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
- sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
- sage_wheels/share/singular/LIB/VecField.lib +1542 -0
- sage_wheels/share/singular/LIB/absfact.lib +959 -0
- sage_wheels/share/singular/LIB/ainvar.lib +730 -0
- sage_wheels/share/singular/LIB/aksaka.lib +419 -0
- sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
- sage_wheels/share/singular/LIB/algebra.lib +1193 -0
- sage_wheels/share/singular/LIB/all.lib +136 -0
- sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
- sage_wheels/share/singular/LIB/arnold.lib +4553 -0
- sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
- sage_wheels/share/singular/LIB/arr.lib +3486 -0
- sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
- sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
- sage_wheels/share/singular/LIB/bfun.lib +1964 -0
- sage_wheels/share/singular/LIB/bimodules.lib +774 -0
- sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
- sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
- sage_wheels/share/singular/LIB/central.lib +2169 -0
- sage_wheels/share/singular/LIB/chern.lib +4162 -0
- sage_wheels/share/singular/LIB/cimonom.lib +571 -0
- sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
- sage_wheels/share/singular/LIB/classify.lib +3239 -0
- sage_wheels/share/singular/LIB/classify2.lib +1462 -0
- sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
- sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
- sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
- sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
- sage_wheels/share/singular/LIB/combinat.lib +91 -0
- sage_wheels/share/singular/LIB/compregb.lib +276 -0
- sage_wheels/share/singular/LIB/control.lib +1636 -0
- sage_wheels/share/singular/LIB/crypto.lib +3795 -0
- sage_wheels/share/singular/LIB/curveInv.lib +667 -0
- sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
- sage_wheels/share/singular/LIB/customstd.lib +100 -0
- sage_wheels/share/singular/LIB/deRham.lib +5979 -0
- sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
- sage_wheels/share/singular/LIB/decomp.lib +1655 -0
- sage_wheels/share/singular/LIB/deflation.lib +872 -0
- sage_wheels/share/singular/LIB/deform.lib +925 -0
- sage_wheels/share/singular/LIB/difform.lib +3055 -0
- sage_wheels/share/singular/LIB/divisors.lib +750 -0
- sage_wheels/share/singular/LIB/dmod.lib +5817 -0
- sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
- sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
- sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
- sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
- sage_wheels/share/singular/LIB/dummy.lib +17 -0
- sage_wheels/share/singular/LIB/elim.lib +1009 -0
- sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
- sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
- sage_wheels/share/singular/LIB/equising.lib +2127 -0
- sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
- sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
- sage_wheels/share/singular/LIB/findifs.lib +778 -0
- sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
- sage_wheels/share/singular/LIB/finvar.lib +7989 -0
- sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
- sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
- sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
- sage_wheels/share/singular/LIB/freegb.lib +3853 -0
- sage_wheels/share/singular/LIB/general.lib +1350 -0
- sage_wheels/share/singular/LIB/gfan.lib +1768 -0
- sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
- sage_wheels/share/singular/LIB/gkdim.lib +99 -0
- sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
- sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
- sage_wheels/share/singular/LIB/goettsche.lib +909 -0
- sage_wheels/share/singular/LIB/graal.lib +1366 -0
- sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
- sage_wheels/share/singular/LIB/graphics.lib +360 -0
- sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
- sage_wheels/share/singular/LIB/groups.lib +1123 -0
- sage_wheels/share/singular/LIB/grwalk.lib +507 -0
- sage_wheels/share/singular/LIB/hdepth.lib +194 -0
- sage_wheels/share/singular/LIB/help.cnf +57 -0
- sage_wheels/share/singular/LIB/hess.lib +1946 -0
- sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
- sage_wheels/share/singular/LIB/hodge.lib +400 -0
- sage_wheels/share/singular/LIB/homolog.lib +1965 -0
- sage_wheels/share/singular/LIB/hyperel.lib +975 -0
- sage_wheels/share/singular/LIB/inout.lib +679 -0
- sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
- sage_wheels/share/singular/LIB/interval.lib +1418 -0
- sage_wheels/share/singular/LIB/intprog.lib +778 -0
- sage_wheels/share/singular/LIB/invar.lib +443 -0
- sage_wheels/share/singular/LIB/involut.lib +980 -0
- sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
- sage_wheels/share/singular/LIB/kskernel.lib +534 -0
- sage_wheels/share/singular/LIB/latex.lib +3146 -0
- sage_wheels/share/singular/LIB/lejeune.lib +651 -0
- sage_wheels/share/singular/LIB/linalg.lib +2040 -0
- sage_wheels/share/singular/LIB/locnormal.lib +212 -0
- sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
- sage_wheels/share/singular/LIB/makedbm.lib +294 -0
- sage_wheels/share/singular/LIB/mathml.lib +813 -0
- sage_wheels/share/singular/LIB/matrix.lib +1372 -0
- sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
- sage_wheels/share/singular/LIB/methods.lib +212 -0
- sage_wheels/share/singular/LIB/moddiq.lib +322 -0
- sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
- sage_wheels/share/singular/LIB/modnormal.lib +218 -0
- sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
- sage_wheels/share/singular/LIB/modquotient.lib +269 -0
- sage_wheels/share/singular/LIB/modstd.lib +1024 -0
- sage_wheels/share/singular/LIB/modular.lib +545 -0
- sage_wheels/share/singular/LIB/modules.lib +2561 -0
- sage_wheels/share/singular/LIB/modwalk.lib +609 -0
- sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
- sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
- sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
- sage_wheels/share/singular/LIB/mregular.lib +1863 -0
- sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
- sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
- sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
- sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
- sage_wheels/share/singular/LIB/ncall.lib +31 -0
- sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
- sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
- sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
- sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
- sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
- sage_wheels/share/singular/LIB/ncloc.lib +361 -0
- sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
- sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
- sage_wheels/share/singular/LIB/nctools.lib +1887 -0
- sage_wheels/share/singular/LIB/nets.lib +1456 -0
- sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
- sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
- sage_wheels/share/singular/LIB/noether.lib +1106 -0
- sage_wheels/share/singular/LIB/normal.lib +8700 -0
- sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
- sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
- sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
- sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
- sage_wheels/share/singular/LIB/olga.lib +1933 -0
- sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
- sage_wheels/share/singular/LIB/parallel.lib +319 -0
- sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
- sage_wheels/share/singular/LIB/perron.lib +202 -0
- sage_wheels/share/singular/LIB/pfd.lib +2223 -0
- sage_wheels/share/singular/LIB/phindex.lib +642 -0
- sage_wheels/share/singular/LIB/pointid.lib +673 -0
- sage_wheels/share/singular/LIB/polybori.lib +1430 -0
- sage_wheels/share/singular/LIB/polyclass.lib +525 -0
- sage_wheels/share/singular/LIB/polylib.lib +1174 -0
- sage_wheels/share/singular/LIB/polymake.lib +1902 -0
- sage_wheels/share/singular/LIB/presolve.lib +1533 -0
- sage_wheels/share/singular/LIB/primdec.lib +9576 -0
- sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
- sage_wheels/share/singular/LIB/primitiv.lib +401 -0
- sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
- sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
- sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
- sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
- sage_wheels/share/singular/LIB/random.lib +455 -0
- sage_wheels/share/singular/LIB/ratgb.lib +489 -0
- sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
- sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
- sage_wheels/share/singular/LIB/realrad.lib +1197 -0
- sage_wheels/share/singular/LIB/recover.lib +2628 -0
- sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
- sage_wheels/share/singular/LIB/reesclos.lib +465 -0
- sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
- sage_wheels/share/singular/LIB/resgraph.lib +789 -0
- sage_wheels/share/singular/LIB/resjung.lib +820 -0
- sage_wheels/share/singular/LIB/resolve.lib +5110 -0
- sage_wheels/share/singular/LIB/resources.lib +170 -0
- sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
- sage_wheels/share/singular/LIB/ring.lib +1328 -0
- sage_wheels/share/singular/LIB/ringgb.lib +343 -0
- sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
- sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
- sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
- sage_wheels/share/singular/LIB/rootsur.lib +886 -0
- sage_wheels/share/singular/LIB/rstandard.lib +607 -0
- sage_wheels/share/singular/LIB/rwalk.lib +336 -0
- sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
- sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
- sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
- sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
- sage_wheels/share/singular/LIB/schreyer.lib +321 -0
- sage_wheels/share/singular/LIB/schubert.lib +2551 -0
- sage_wheels/share/singular/LIB/sets.lib +524 -0
- sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
- sage_wheels/share/singular/LIB/signcond.lib +437 -0
- sage_wheels/share/singular/LIB/sing.lib +1094 -0
- sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
- sage_wheels/share/singular/LIB/solve.lib +2243 -0
- sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
- sage_wheels/share/singular/LIB/spectrum.lib +62 -0
- sage_wheels/share/singular/LIB/sresext.lib +757 -0
- sage_wheels/share/singular/LIB/ssi.lib +143 -0
- sage_wheels/share/singular/LIB/standard.lib +2769 -0
- sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
- sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
- sage_wheels/share/singular/LIB/stratify.lib +1070 -0
- sage_wheels/share/singular/LIB/surf.lib +506 -0
- sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
- sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
- sage_wheels/share/singular/LIB/surfex.lib +1462 -0
- sage_wheels/share/singular/LIB/swalk.lib +877 -0
- sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
- sage_wheels/share/singular/LIB/systhreads.lib +74 -0
- sage_wheels/share/singular/LIB/tasks.lib +1324 -0
- sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
- sage_wheels/share/singular/LIB/teachstd.lib +858 -0
- sage_wheels/share/singular/LIB/template.lib +116 -0
- sage_wheels/share/singular/LIB/toric.lib +1119 -0
- sage_wheels/share/singular/LIB/transformation.lib +116 -0
- sage_wheels/share/singular/LIB/triang.lib +1197 -0
- sage_wheels/share/singular/LIB/tropical.lib +8741 -0
- sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
- sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
- sage_wheels/share/singular/LIB/tst.lib +1108 -0
- sage_wheels/share/singular/LIB/weierstr.lib +241 -0
- sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
- sage_wheels/share/singular/emacs/.emacs-general +184 -0
- sage_wheels/share/singular/emacs/.emacs-singular +234 -0
- sage_wheels/share/singular/emacs/COPYING +44 -0
- sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
- sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
- sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
- sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
- sage_wheels/share/singular/emacs/singular.el +4273 -0
- sage_wheels/share/singular/emacs/singular.xpm +39 -0
- sage_wheels/share/singular/singular.idx +5002 -0
|
@@ -0,0 +1,1768 @@
|
|
|
1
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
version="version finitediff.lib 4.1.2.0 Feb_2019 "; // $Id: 9fc46c5f49d8cc06120953f1d4f651b280512da8 $
|
|
3
|
+
category="Teaching";
|
|
4
|
+
info="
|
|
5
|
+
LIBRARY: finitediff.lib procedures to compute finite difference schemes
|
|
6
|
+
for linear differential equations
|
|
7
|
+
AUTHOR: Christian Dingler
|
|
8
|
+
|
|
9
|
+
OVERVIEW:
|
|
10
|
+
@texinfo
|
|
11
|
+
Using @code{qepcad}/@code{qepcadsystem} from this
|
|
12
|
+
library requires the program @code{qepcad} to be installed.
|
|
13
|
+
You can download @code{qepcad} from
|
|
14
|
+
@uref{http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html}
|
|
15
|
+
@end texinfo
|
|
16
|
+
|
|
17
|
+
PROCEDURES:
|
|
18
|
+
visualize(f); shows a scheme in index-notation
|
|
19
|
+
u(D[,#]); gives some vector; depends on @derivatives
|
|
20
|
+
scheme([v1,..,vn]); computes the finite difference scheme defined by v1,..,vn
|
|
21
|
+
laxfrT(Ut,U,space); Lax-Friedrich-approximation for the time-direction
|
|
22
|
+
laxfrX(Ux,U,space); Lax-Friedrich-approximation for the space-direction
|
|
23
|
+
forward(U1,U2,VAR); forward-approximation
|
|
24
|
+
backward(U1,U2,VAR); backward-approximation
|
|
25
|
+
central1st(U1,U2,VAR); central-approximation of first order
|
|
26
|
+
central2nd(U1,U2,VAR); central-approximation of second order
|
|
27
|
+
trapezoid(U1,U2,VAR); trapezoid-approximation
|
|
28
|
+
midpoint(U1,U2,VAR); midpoint-approximation
|
|
29
|
+
pyramid(U1,U2,VAR); pyramid-approximation
|
|
30
|
+
setinitials(variable,der[,#]); constructs and sets the basering for further computations
|
|
31
|
+
errormap(f); performs the Fouriertransformation of a poly
|
|
32
|
+
matrixsystem(M,A); gives the scheme of a pde-system as one matrix
|
|
33
|
+
timestep(M); gives the several timelevels of a scheme derived from a pde-system
|
|
34
|
+
fouriersystem(M,A); performs the Fouriertransformation of a matrix scheme
|
|
35
|
+
PartitionVar(f,n); partitions a poly into the var(n)-part and the rest
|
|
36
|
+
ComplexValue(f); computes the complex value of f, var(1) being the imaginary unit
|
|
37
|
+
VarToPar(f); substitute var(i) by par(i)
|
|
38
|
+
ParToVar(f); substitute par(i) by var(i)
|
|
39
|
+
qepcad(f); ask QEPCAD for equivalent constraints to f<1
|
|
40
|
+
qepcadsystem(l); ask QEPCAD for equivalent constraints to all eigenvals of some matrices being <1
|
|
41
|
+
";
|
|
42
|
+
|
|
43
|
+
LIB "ring.lib";
|
|
44
|
+
LIB "general.lib";
|
|
45
|
+
LIB "standard.lib";
|
|
46
|
+
LIB "linalg.lib";
|
|
47
|
+
LIB "matrix.lib";
|
|
48
|
+
LIB "polylib.lib";
|
|
49
|
+
LIB "teachstd.lib";
|
|
50
|
+
LIB "qhmoduli.lib";
|
|
51
|
+
///////////////////////////////////////////////////////////////////////
|
|
52
|
+
static proc getit(module M)
|
|
53
|
+
{
|
|
54
|
+
int nderiv=pos(U,@derivatives);
|
|
55
|
+
def M2=groebner(M);
|
|
56
|
+
module N1=gen(nderiv);
|
|
57
|
+
def N2=intersect(M2,N1);
|
|
58
|
+
def S=N2[1][nderiv];
|
|
59
|
+
return(S);
|
|
60
|
+
}
|
|
61
|
+
///////////////////////////////////////////////////////////////////////
|
|
62
|
+
proc visualize(poly f)
|
|
63
|
+
"USAGE: visualize(f); f of type poly.
|
|
64
|
+
RETURN: type string; translates the polynomial form of a finite difference scheme into an indexed one as often seen in literature
|
|
65
|
+
EXAMPLE: example visualize; shows an example
|
|
66
|
+
"
|
|
67
|
+
{
|
|
68
|
+
def n=size(f);
|
|
69
|
+
string str;
|
|
70
|
+
intvec v;
|
|
71
|
+
if (n>0)
|
|
72
|
+
{
|
|
73
|
+
int i;
|
|
74
|
+
int j;
|
|
75
|
+
for(i=1;i<=n;i++)
|
|
76
|
+
{
|
|
77
|
+
intvec w=leadexp(f);
|
|
78
|
+
for(j=1;j<=size(@variables);j++)
|
|
79
|
+
{
|
|
80
|
+
v[j]=w[j+1];
|
|
81
|
+
}
|
|
82
|
+
if(i==1)
|
|
83
|
+
{
|
|
84
|
+
str=print(leadcoef(f),"%s")+"*"+"U("+print(v,"%s")+")";
|
|
85
|
+
}
|
|
86
|
+
else
|
|
87
|
+
{
|
|
88
|
+
str=str+"+"+print(leadcoef(f),"%s")+"*"+"U("+print(v,"%s")+")";
|
|
89
|
+
}
|
|
90
|
+
kill w;
|
|
91
|
+
f=f-lead(f);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return(str);
|
|
95
|
+
}
|
|
96
|
+
example
|
|
97
|
+
{
|
|
98
|
+
"EXAMPLE:";echo=2;
|
|
99
|
+
list D="Ux","Ut","U";
|
|
100
|
+
list P="a";
|
|
101
|
+
list V="t","x";
|
|
102
|
+
setinitials(V,D,P);
|
|
103
|
+
scheme(u(Ut)+a*u(Ux),trapezoid(Ux,U,x),backward(Ut,U,t));
|
|
104
|
+
visualize(_);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
///////////////////////////////////
|
|
108
|
+
static proc imageideal()
|
|
109
|
+
{
|
|
110
|
+
|
|
111
|
+
def n=size(@variables)-1;
|
|
112
|
+
ideal IDEAL=var(1),var(2);
|
|
113
|
+
int j;
|
|
114
|
+
for(j=1;j<=n;j++)
|
|
115
|
+
{
|
|
116
|
+
ideal II=var(2+j+n)+var(1)*var(2+2*n+j);
|
|
117
|
+
IDEAL=IDEAL+II;
|
|
118
|
+
kill II;
|
|
119
|
+
}
|
|
120
|
+
return(IDEAL);
|
|
121
|
+
}
|
|
122
|
+
/////////////////////////////////////
|
|
123
|
+
proc u(string D,list #)
|
|
124
|
+
"USAGE: u(D[,#]); D a string that occurs in the list of @derivatives, # an optional list of integers.
|
|
125
|
+
RETURN: type vector; gives the vector, that corresponds with gen(n)*m, where m is the monomial defined by #
|
|
126
|
+
EXAMPLE: example u; shows an example
|
|
127
|
+
"
|
|
128
|
+
{
|
|
129
|
+
def n=size(#);
|
|
130
|
+
def nv=nvars(basering)-1;
|
|
131
|
+
int nn;
|
|
132
|
+
if(nv<=n)
|
|
133
|
+
{
|
|
134
|
+
nn=nv;
|
|
135
|
+
}
|
|
136
|
+
else
|
|
137
|
+
{
|
|
138
|
+
nn=n;
|
|
139
|
+
}
|
|
140
|
+
int index=pos(D,@derivatives);
|
|
141
|
+
poly g=1;
|
|
142
|
+
if(nn>=1)
|
|
143
|
+
{
|
|
144
|
+
int j;
|
|
145
|
+
for(j=1;j<=nn;j++)
|
|
146
|
+
{
|
|
147
|
+
int nnn;
|
|
148
|
+
nnn=int(#[j]);
|
|
149
|
+
g=var(1+j)**nnn*g;
|
|
150
|
+
kill nnn;
|
|
151
|
+
}
|
|
152
|
+
return(gen(index)*g);
|
|
153
|
+
}
|
|
154
|
+
else
|
|
155
|
+
{
|
|
156
|
+
return(gen(index)*g);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
example
|
|
160
|
+
{
|
|
161
|
+
"EXAMPLE:";echo=2;
|
|
162
|
+
list D="Ux","Uy","Ut","U";
|
|
163
|
+
list P="a","b";
|
|
164
|
+
list V="t","x","y";
|
|
165
|
+
setinitials(V,D,P);
|
|
166
|
+
u(Ux);
|
|
167
|
+
u(Ux,2,3,7);
|
|
168
|
+
u(Uy)+u(Ut)-u(Ux);
|
|
169
|
+
u(U)*234-dx*dt*dy*3*u(Uy);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/////////////////////////////////////////////////////////
|
|
173
|
+
static proc pos(string D,list L)
|
|
174
|
+
{
|
|
175
|
+
int j;
|
|
176
|
+
int index=-1;
|
|
177
|
+
def n=size(L);
|
|
178
|
+
for(j=1;j<=n;j++)
|
|
179
|
+
{
|
|
180
|
+
if(D==L[j])
|
|
181
|
+
{
|
|
182
|
+
index=j;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return(index);
|
|
186
|
+
}
|
|
187
|
+
///////////////////////////////////
|
|
188
|
+
static proc re(list L)
|
|
189
|
+
{
|
|
190
|
+
def n=size(L);
|
|
191
|
+
int j; string s;
|
|
192
|
+
for(j=1;j<=n;j++)
|
|
193
|
+
{
|
|
194
|
+
s="string "+print(L[j],"%s")+"="+"nameof("+print(L[j],"%s")+")"+";";
|
|
195
|
+
execute(s);
|
|
196
|
+
exportto(Top,`L[j]`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
///////////////////////////////////////////////
|
|
200
|
+
proc scheme(list #)
|
|
201
|
+
"USAGE: scheme([v1,..,vn]); v1,..,vn of type vector
|
|
202
|
+
RETURN: poly
|
|
203
|
+
PURPOSE: performs substitutions by the means of Groebner basis computation
|
|
204
|
+
of the submodule, generated by the input vectors, then intersects the
|
|
205
|
+
intermediate result with the suitable component in order to get a finite
|
|
206
|
+
difference scheme
|
|
207
|
+
NOTE: works only for a single PDE, for the case of a system use @code{matrixsystem}
|
|
208
|
+
EXAMPLE: example scheme; shows an example
|
|
209
|
+
"
|
|
210
|
+
{
|
|
211
|
+
def N=size(#);
|
|
212
|
+
if(N==0)
|
|
213
|
+
{
|
|
214
|
+
if(defined(M)==1)
|
|
215
|
+
{
|
|
216
|
+
kill M;
|
|
217
|
+
module M;
|
|
218
|
+
}
|
|
219
|
+
else
|
|
220
|
+
{
|
|
221
|
+
module M;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else
|
|
225
|
+
{
|
|
226
|
+
int j;
|
|
227
|
+
if(defined(M)==1)
|
|
228
|
+
{
|
|
229
|
+
kill M;
|
|
230
|
+
module M;
|
|
231
|
+
for(j=1;j<=N;j++)
|
|
232
|
+
{
|
|
233
|
+
M=M+#[j];
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else
|
|
237
|
+
{
|
|
238
|
+
module M;
|
|
239
|
+
for(j=1;j<=N;j++)
|
|
240
|
+
{
|
|
241
|
+
M=M+#[j];
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
def S=getit(M);
|
|
246
|
+
matrix mat[1][1]=S;
|
|
247
|
+
list l=timestep(mat);
|
|
248
|
+
poly f=l[2][1,1];
|
|
249
|
+
return(f);
|
|
250
|
+
}
|
|
251
|
+
example
|
|
252
|
+
{
|
|
253
|
+
"EXAMPLE:";echo=2;
|
|
254
|
+
list D="Ux","Ut","U";
|
|
255
|
+
list P="a";
|
|
256
|
+
list V="t","x";
|
|
257
|
+
setinitials(V,D,P);
|
|
258
|
+
def s1=scheme(u(Ut)+a*u(Ux),backward(Ux,U,x),forward(Ut,U,t));
|
|
259
|
+
s1;
|
|
260
|
+
}
|
|
261
|
+
////////////////////////
|
|
262
|
+
static proc diffpar(poly ff)
|
|
263
|
+
{
|
|
264
|
+
def gg=print(ff,"%s");
|
|
265
|
+
def str="d"+gg;
|
|
266
|
+
return(`str`);
|
|
267
|
+
}
|
|
268
|
+
////////////////////////
|
|
269
|
+
proc laxfrT(string Ut, string U, poly space)
|
|
270
|
+
"USAGE: laxfrT(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
271
|
+
RETURN: type vector; gives a predefined approximation of the Lax-Friedrich-approximation for the derivation in the timevariable as often used in literature;
|
|
272
|
+
NOTE: see also laxfrX, setinitials, scheme; Warning: laxfrT is not to be interchanged with laxfrX
|
|
273
|
+
EXAMPLE: example laxfrT; shows an example
|
|
274
|
+
"
|
|
275
|
+
{
|
|
276
|
+
poly time=var(2);
|
|
277
|
+
poly dtime=diffpar(time);
|
|
278
|
+
poly dspace=diffpar(space);
|
|
279
|
+
def v=dtime*space*u(Ut)-time*space*u(U)+1/2*(space**2*u(U)+u(U));
|
|
280
|
+
return(v);
|
|
281
|
+
}
|
|
282
|
+
example
|
|
283
|
+
{
|
|
284
|
+
"EXAMPLE:";echo=2;
|
|
285
|
+
list D="Ux","Ut","U";
|
|
286
|
+
list P="a";
|
|
287
|
+
list V="t","x";
|
|
288
|
+
setinitials(V,D,P);
|
|
289
|
+
laxfrT(Ux,U,x);
|
|
290
|
+
}
|
|
291
|
+
////////////////////////
|
|
292
|
+
proc laxfrX(string Ux, string U, poly space)
|
|
293
|
+
"USAGE: laxfrX(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
294
|
+
RETURN: type vector; gives a predefined approximation of the Lax-Friedrich-approximation for the derivation in one of the spatial variables as often used in literature;
|
|
295
|
+
NOTE: see also laxfrT, setinitials, scheme; Warning: laxfrX is not to be interchanged with laxfrT
|
|
296
|
+
EXAMPLE: example laxfrX; shows an example
|
|
297
|
+
"
|
|
298
|
+
{
|
|
299
|
+
poly dspace = diffpar(space);
|
|
300
|
+
def v=2*dspace*space*u(Ux)-(space**2-1)*u(U);
|
|
301
|
+
return(v);
|
|
302
|
+
}
|
|
303
|
+
example
|
|
304
|
+
{
|
|
305
|
+
"EXAMPLE:";echo=2;
|
|
306
|
+
list D="Ux","Ut","U";
|
|
307
|
+
list P="a";
|
|
308
|
+
list V="t","x";
|
|
309
|
+
setinitials(V,D,P);
|
|
310
|
+
laxfrX(Ux,U,x);
|
|
311
|
+
}
|
|
312
|
+
////////////////////////
|
|
313
|
+
proc forward(string U1,string U2,poly VAR)
|
|
314
|
+
"USAGE: forward(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
315
|
+
RETURN: type vector; gives a predefined approximation of the forward approximation as often used in literature;
|
|
316
|
+
NOTE: see also laxfrT,setinitials,scheme;
|
|
317
|
+
EXAMPLE: example forward; shows an example
|
|
318
|
+
"
|
|
319
|
+
{
|
|
320
|
+
if(pos(U1,@derivatives)<pos(U2,@derivatives))
|
|
321
|
+
{
|
|
322
|
+
def V1=U1;
|
|
323
|
+
def V2=U2;
|
|
324
|
+
}
|
|
325
|
+
else
|
|
326
|
+
{
|
|
327
|
+
def V1=U2;
|
|
328
|
+
def V2=U1;
|
|
329
|
+
}
|
|
330
|
+
def v=diffpar(VAR)*u(V1)+u(V2)-VAR*u(V2);
|
|
331
|
+
return(v);
|
|
332
|
+
}
|
|
333
|
+
example
|
|
334
|
+
{
|
|
335
|
+
"EXAMPLE:";echo=2;
|
|
336
|
+
list D="Ut","Ux","Uy","U";
|
|
337
|
+
list V="t","x","y";
|
|
338
|
+
list P="a","b";
|
|
339
|
+
setinitials(V,D,P);
|
|
340
|
+
forward(Ux,U,x);
|
|
341
|
+
forward(Uy,U,y);
|
|
342
|
+
forward(Ut,U,t);
|
|
343
|
+
}
|
|
344
|
+
///////////////////////
|
|
345
|
+
proc backward(string U1,string U2,poly VAR)
|
|
346
|
+
"USAGE: backward(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
347
|
+
RETURN: type vector; gives a predefined approximation of the backward approximation as often used in literature;
|
|
348
|
+
NOTE: see also forward,laxfrT,setinitials,scheme;
|
|
349
|
+
EXAMPLE: example backward; shows an example
|
|
350
|
+
"
|
|
351
|
+
{
|
|
352
|
+
if(pos(U1,@derivatives)<pos(U2,@derivatives))
|
|
353
|
+
{
|
|
354
|
+
def V1=U1;
|
|
355
|
+
def V2=U2;
|
|
356
|
+
}
|
|
357
|
+
else
|
|
358
|
+
{
|
|
359
|
+
def V1=U2;
|
|
360
|
+
def V2=U1;
|
|
361
|
+
}
|
|
362
|
+
def v=diffpar(VAR)*VAR*u(V1)+u(V2)-VAR*u(V2);
|
|
363
|
+
return(v);
|
|
364
|
+
}
|
|
365
|
+
example
|
|
366
|
+
{
|
|
367
|
+
"EXAMPLE:";echo=2;
|
|
368
|
+
list D="Ut","Ux","Uy","U";
|
|
369
|
+
list V="t","x","y";
|
|
370
|
+
list P="a","b";
|
|
371
|
+
setinitials(V,D,P);
|
|
372
|
+
backward(Ux,U,x);
|
|
373
|
+
backward(Uy,U,y);
|
|
374
|
+
backward(Ut,U,t);
|
|
375
|
+
}
|
|
376
|
+
/////////////////////////////
|
|
377
|
+
proc central1st(string U1,string U2,poly VAR)
|
|
378
|
+
"USAGE: central1st(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
379
|
+
RETURN: type vector; gives a predefined approximation of the first-order-central-approximation as often used in literature;
|
|
380
|
+
NOTE: see also forward,laxfrT,setinitials,scheme;
|
|
381
|
+
EXAMPLE: example central1st; shows an example
|
|
382
|
+
"
|
|
383
|
+
{
|
|
384
|
+
if(pos(U1,@derivatives)<pos(U2,@derivatives))
|
|
385
|
+
{
|
|
386
|
+
def V1=U1;
|
|
387
|
+
def V2=U2;
|
|
388
|
+
}
|
|
389
|
+
else
|
|
390
|
+
{
|
|
391
|
+
def V1=U2;
|
|
392
|
+
def V2=U1;
|
|
393
|
+
}
|
|
394
|
+
def v=2*diffpar(VAR)*VAR*u(V1)+u(V2)-VAR**2*u(V2);
|
|
395
|
+
return(v);
|
|
396
|
+
}
|
|
397
|
+
example
|
|
398
|
+
{
|
|
399
|
+
"EXAMPLE:";echo=2;
|
|
400
|
+
list D="Ut","Ux","Uy","U";
|
|
401
|
+
list V="t","x","y";
|
|
402
|
+
list P="a","b";
|
|
403
|
+
setinitials(V,D,P);
|
|
404
|
+
central1st(Ux,U,x);
|
|
405
|
+
central1st(Uy,U,y);
|
|
406
|
+
}
|
|
407
|
+
////////////////////////////////
|
|
408
|
+
proc central2nd(string U1,string U2,poly VAR)
|
|
409
|
+
"USAGE: central2nd(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
410
|
+
RETURN: type vector; gives a predefined approximation of the second-order-central-approximation as often used in literature;
|
|
411
|
+
NOTE: see also forward,laxfrT,setinitials,scheme;
|
|
412
|
+
EXAMPLE: example central2nd; shows an example
|
|
413
|
+
"
|
|
414
|
+
{
|
|
415
|
+
if(pos(U1,@derivatives)<pos(U2,@derivatives))
|
|
416
|
+
{
|
|
417
|
+
def V1=U1;
|
|
418
|
+
def V2=U2;
|
|
419
|
+
}
|
|
420
|
+
else
|
|
421
|
+
{
|
|
422
|
+
def V1=U2;
|
|
423
|
+
def V2=U1;
|
|
424
|
+
}
|
|
425
|
+
def v=diffpar(VAR)**2*VAR*u(V1)-(VAR**2*u(V2)-2*VAR*u(V2)+u(V2));
|
|
426
|
+
return(v);
|
|
427
|
+
}
|
|
428
|
+
example
|
|
429
|
+
{
|
|
430
|
+
"EXAMPLE:";echo=2;
|
|
431
|
+
list D="Uxx","Ux","Utt","Ut","U";
|
|
432
|
+
list P="lambda";
|
|
433
|
+
list V="t","x";
|
|
434
|
+
setinitials(V,D,P);
|
|
435
|
+
central2nd(Uxx,U,x);
|
|
436
|
+
central2nd(Utt,U,t);
|
|
437
|
+
}
|
|
438
|
+
/////////////////////////////////
|
|
439
|
+
proc trapezoid(string U1,string U2,poly VAR)
|
|
440
|
+
"USAGE: trapezoid(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
441
|
+
RETURN: type vector; gives a predefined approximation of the trapezoid-approximation as often used in literature;
|
|
442
|
+
NOTE: see also forward,laxfrT,setinitials,scheme;
|
|
443
|
+
EXAMPLE: example trapezoid; shows an example
|
|
444
|
+
"
|
|
445
|
+
{
|
|
446
|
+
if(pos(U1,@derivatives)<pos(U2,@derivatives))
|
|
447
|
+
{
|
|
448
|
+
def V1=U1;
|
|
449
|
+
def V2=U2;
|
|
450
|
+
}
|
|
451
|
+
else
|
|
452
|
+
{
|
|
453
|
+
def V1=U2;
|
|
454
|
+
def V2=U1;
|
|
455
|
+
}
|
|
456
|
+
def v=1/2*diffpar(VAR)*(VAR+1)*u(V1)+(1-VAR)*u(V2);
|
|
457
|
+
return(v);
|
|
458
|
+
}
|
|
459
|
+
example
|
|
460
|
+
{
|
|
461
|
+
"EXAMPLE:";echo=2;
|
|
462
|
+
list D="Uxx","Ux","Utt","Ut","U";
|
|
463
|
+
list P="lambda";
|
|
464
|
+
list V="t","x";
|
|
465
|
+
setinitials(V,D,P);
|
|
466
|
+
trapezoid(Uxx,Ux,x);
|
|
467
|
+
trapezoid(Ux,U,x);
|
|
468
|
+
}
|
|
469
|
+
///////////////////////////////////
|
|
470
|
+
proc midpoint(string U1,string U2,poly VAR)
|
|
471
|
+
"USAGE: midpoint(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
472
|
+
RETURN: type vector; gives a predefined approximation of the midpoint-approximation as often used in literature;
|
|
473
|
+
NOTE: see also forward,laxfrT,setinitials,scheme;
|
|
474
|
+
EXAMPLE: example midpoint; shows an example
|
|
475
|
+
"
|
|
476
|
+
{
|
|
477
|
+
if(pos(U1,@derivatives)<pos(U2,@derivatives))
|
|
478
|
+
{
|
|
479
|
+
def V1=U1;
|
|
480
|
+
def V2=U2;
|
|
481
|
+
}
|
|
482
|
+
else
|
|
483
|
+
{
|
|
484
|
+
def V1=U2;
|
|
485
|
+
def V2=U1;
|
|
486
|
+
}
|
|
487
|
+
def v=2*diffpar(VAR)*VAR*u(V1)+(1-VAR**2)*u(V2);
|
|
488
|
+
return(v);
|
|
489
|
+
}
|
|
490
|
+
example
|
|
491
|
+
{
|
|
492
|
+
"EXAMPLE:";echo=2;
|
|
493
|
+
list D="Uxx","Ux","Utt","Ut","U";
|
|
494
|
+
list P="lambda";
|
|
495
|
+
list V="t","x";
|
|
496
|
+
setinitials(V,D,P);
|
|
497
|
+
midpoint(Ux,U,x);
|
|
498
|
+
}
|
|
499
|
+
//////////////////////////////////////
|
|
500
|
+
proc pyramid(string U1,string U2,poly VAR)
|
|
501
|
+
"USAGE: pyramid(U1,U2,var); U1, U2 are the names of occuring derivatives, var is a variable in the basering;
|
|
502
|
+
RETURN: type vector; gives a predefined approximation of the pyramid-approximation as often used in literature;
|
|
503
|
+
NOTE: see also forward,laxfrT,setinitials,scheme;
|
|
504
|
+
EXAMPLE: example pyramid; shows an example
|
|
505
|
+
"
|
|
506
|
+
{
|
|
507
|
+
if(pos(U1,@derivatives)<pos(U2,@derivatives))
|
|
508
|
+
{
|
|
509
|
+
def V1=U1;
|
|
510
|
+
def V2=U2;
|
|
511
|
+
}
|
|
512
|
+
else
|
|
513
|
+
{
|
|
514
|
+
def V1=U2;
|
|
515
|
+
def V2=U1;
|
|
516
|
+
}
|
|
517
|
+
def v=1/3*diffpar(VAR)*(VAR**2+VAR+1)*u(V1)+(VAR-VAR**3)*u(V2);
|
|
518
|
+
return(v);
|
|
519
|
+
}
|
|
520
|
+
example
|
|
521
|
+
{
|
|
522
|
+
"EXAMPLE:";echo=2;
|
|
523
|
+
list D="Uxx","Ux","Utt","Ut","U";
|
|
524
|
+
list P="lambda";
|
|
525
|
+
list V="t","x";
|
|
526
|
+
setinitials(V,D,P);
|
|
527
|
+
pyramid(Ux,U,x);
|
|
528
|
+
}
|
|
529
|
+
//////////////////////////////////////////////
|
|
530
|
+
proc setinitials(list variable, list der,list #)
|
|
531
|
+
"USAGE: setinitials(V,D[,P]); V,D,P are lists with strings as elements
|
|
532
|
+
RETURN: no return value: sets the dependence order of the occuring derivatives,
|
|
533
|
+
constructs the suitable ring to compute in containing user chosen parameters, sets new basering
|
|
534
|
+
NOTE: P is optional, used to introduce some additional parameters into the ring. The Sine and
|
|
535
|
+
Cosine values needed for the fourier transformation are symbolically introduced under the names
|
|
536
|
+
string(c)+nameof(variable), i.e. if x is any spatial variable then cx:=cosine(dx*ksi), when
|
|
537
|
+
regarding the fourier transform after ksi (for sine respectively). Artificial parameters I,T,Px,Py
|
|
538
|
+
are introduced for the later eigenvalue analysis. Variables can be transformed into parameters
|
|
539
|
+
of similar name
|
|
540
|
+
EXAMPLE: example setinitials; shows an example
|
|
541
|
+
"
|
|
542
|
+
{
|
|
543
|
+
def LV=variable;
|
|
544
|
+
def @variables=variable;
|
|
545
|
+
def @derivatives=der;
|
|
546
|
+
export(@variables);
|
|
547
|
+
export(@derivatives);
|
|
548
|
+
re(der);
|
|
549
|
+
int j;
|
|
550
|
+
string dvar="d"+print(LV[1],"%s");
|
|
551
|
+
dvar=dvar+","+"d"+print(LV[2],"%s");
|
|
552
|
+
string pvar="P"+print(LV[2],"%s");
|
|
553
|
+
string COS="C"+print(LV[2],"%s");
|
|
554
|
+
string SIN="S"+print(LV[2],"%s");
|
|
555
|
+
for(j=3;j<=size(LV);j++)
|
|
556
|
+
{
|
|
557
|
+
dvar=dvar+","+"d"+print(LV[j],"%s");
|
|
558
|
+
pvar=pvar+","+"P"+print(LV[j],"%s");
|
|
559
|
+
COS=COS+","+"C"+print(LV[j],"%s");
|
|
560
|
+
SIN=SIN+","+"S"+print(LV[j],"%s");
|
|
561
|
+
}
|
|
562
|
+
string scf="(0,"+"I,"+"T,"+pvar+","+COS+","+SIN+","+print(#,"%s")+","+dvar+")"; //coefficient_field
|
|
563
|
+
string svars="(i";
|
|
564
|
+
kill j;
|
|
565
|
+
int j;
|
|
566
|
+
for(j=1;j<=size(LV);j++)
|
|
567
|
+
{
|
|
568
|
+
svars=svars+","+print(LV[j],"%s");
|
|
569
|
+
}
|
|
570
|
+
string cosine;
|
|
571
|
+
string sine;
|
|
572
|
+
kill j;
|
|
573
|
+
int j;
|
|
574
|
+
cosine="c"+print(LV[2],"%s");
|
|
575
|
+
sine="s"+print(LV[2],"%s");
|
|
576
|
+
for(j=3;j<=size(LV);j++)
|
|
577
|
+
{
|
|
578
|
+
cosine=cosine+","+"c"+print(LV[j],"%s");
|
|
579
|
+
sine=sine+","+"s"+print(LV[j],"%s");
|
|
580
|
+
}
|
|
581
|
+
kill j;
|
|
582
|
+
string strvar=cosine+","+sine+")";
|
|
583
|
+
svars=svars+","+strvar; ////variables
|
|
584
|
+
string sord="(c,lp)"; ////ordering
|
|
585
|
+
ring Q = create_ring(scf, svars, sord);
|
|
586
|
+
ideal Id=i**2+1;
|
|
587
|
+
int j;
|
|
588
|
+
for(j=1;j<=size(LV)-1;j++)
|
|
589
|
+
{
|
|
590
|
+
ideal II=var(2+j+size(LV)-1)**2+var(2+j+2*(size(LV)-1))**2-1;
|
|
591
|
+
Id=Id+II;
|
|
592
|
+
kill II;
|
|
593
|
+
}
|
|
594
|
+
if(defined(basering)==1)
|
|
595
|
+
{
|
|
596
|
+
kill basering;
|
|
597
|
+
}
|
|
598
|
+
qring R=std(Id);
|
|
599
|
+
setring R;
|
|
600
|
+
// comment by VL: it's better to return this ring! causes many changes
|
|
601
|
+
// across the library
|
|
602
|
+
export(R);
|
|
603
|
+
}
|
|
604
|
+
example
|
|
605
|
+
{
|
|
606
|
+
"EXAMPLE:"; echo = 2;
|
|
607
|
+
list D="Ut","Ux","Uy","U";
|
|
608
|
+
list V="t","x","y";
|
|
609
|
+
list P="alpha","beta","gamma";
|
|
610
|
+
setinitials(V,D,P);////does not show the ring, since there is no output
|
|
611
|
+
basering;///does show the ring
|
|
612
|
+
}
|
|
613
|
+
////////////////////////////
|
|
614
|
+
proc errormap(poly f)
|
|
615
|
+
"USAGE: errormap(f); f of type poly
|
|
616
|
+
RETURN: type poly; performs the fouriertransformation of a single polynomial
|
|
617
|
+
EXAMPLE: example errormap; shows an example
|
|
618
|
+
"
|
|
619
|
+
{
|
|
620
|
+
ideal Id=imageideal();
|
|
621
|
+
map phi=R,Id;
|
|
622
|
+
def g=phi(f);
|
|
623
|
+
g=reduce(g,std(0));
|
|
624
|
+
return(g);
|
|
625
|
+
}
|
|
626
|
+
example
|
|
627
|
+
{
|
|
628
|
+
"EXAMPLE";echo=2;
|
|
629
|
+
list D="Ux","Ut","U";
|
|
630
|
+
list P="a";
|
|
631
|
+
list V="t","x";
|
|
632
|
+
setinitials(V,D,P);
|
|
633
|
+
scheme(u(Ut)+a*u(Ux),central1st(Ux,U,x),backward(Ut,U,t));
|
|
634
|
+
errormap(_);
|
|
635
|
+
}
|
|
636
|
+
/////////////////////////////////////
|
|
637
|
+
static proc stepmatrix(int n, poly f)
|
|
638
|
+
{
|
|
639
|
+
int spavars=size(@variables)-1;
|
|
640
|
+
int range=n*spavars;
|
|
641
|
+
if(f==0)
|
|
642
|
+
{
|
|
643
|
+
return(unitmat(range));
|
|
644
|
+
}
|
|
645
|
+
matrix M[range][range];
|
|
646
|
+
int length=size(f);
|
|
647
|
+
intvec max=maxexp(f);
|
|
648
|
+
int i;
|
|
649
|
+
intvec shiftback;
|
|
650
|
+
intvec vzero;
|
|
651
|
+
intvec vmax;
|
|
652
|
+
intvec shiftforward;
|
|
653
|
+
for(i=1;i<=size(max);i++)
|
|
654
|
+
{
|
|
655
|
+
shiftback[i]=int(floor(max[i]/2));
|
|
656
|
+
vzero[i]=0;
|
|
657
|
+
vmax[i]=n-1;
|
|
658
|
+
shiftforward[i]=0;
|
|
659
|
+
}
|
|
660
|
+
kill i;
|
|
661
|
+
int i;
|
|
662
|
+
for(i=1;i<=range;i++)
|
|
663
|
+
{
|
|
664
|
+
poly g=f;
|
|
665
|
+
}
|
|
666
|
+
kill i;
|
|
667
|
+
}
|
|
668
|
+
//////////////////////////////////////
|
|
669
|
+
static proc floor(n)
|
|
670
|
+
{
|
|
671
|
+
number h1=numerator(n);
|
|
672
|
+
number h2=denominator(n);
|
|
673
|
+
return((h1- (h1 mod h2))/h2);
|
|
674
|
+
}
|
|
675
|
+
/////////////////////////////////////
|
|
676
|
+
static proc maxexp(poly f)
|
|
677
|
+
{
|
|
678
|
+
int length=size(f);
|
|
679
|
+
poly g=f;
|
|
680
|
+
intvec v;
|
|
681
|
+
int i;
|
|
682
|
+
for(i=1;i<size(@variables);i++)
|
|
683
|
+
{
|
|
684
|
+
v[i]=leadexp(g)[i+2];
|
|
685
|
+
}
|
|
686
|
+
while(g!=0)
|
|
687
|
+
{
|
|
688
|
+
int j;
|
|
689
|
+
for(j=1;j<size(@variables);j++)
|
|
690
|
+
{
|
|
691
|
+
v[j]=maximal(leadexp(g)[j+2],v[j]);
|
|
692
|
+
g=g-lead(g);
|
|
693
|
+
}
|
|
694
|
+
kill j;
|
|
695
|
+
}
|
|
696
|
+
return(v);
|
|
697
|
+
}
|
|
698
|
+
////////////////////////////////////
|
|
699
|
+
static proc maximal(int n1,int n2)
|
|
700
|
+
{
|
|
701
|
+
if(n1>n2)
|
|
702
|
+
{
|
|
703
|
+
return(n1);
|
|
704
|
+
}
|
|
705
|
+
else
|
|
706
|
+
{
|
|
707
|
+
return(n2);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
////////////////////////////////////
|
|
711
|
+
static proc minimal(int n1, int n2)
|
|
712
|
+
{
|
|
713
|
+
return(-maximal(-n1,-n2));
|
|
714
|
+
}
|
|
715
|
+
////////////////////////////////////
|
|
716
|
+
static proc MatrixEntry(int n, intvec v)
|
|
717
|
+
{
|
|
718
|
+
int j;
|
|
719
|
+
int entry;
|
|
720
|
+
int spavar=size(@variables)-1;
|
|
721
|
+
for(j=1;j<=spavar;j++)
|
|
722
|
+
{
|
|
723
|
+
entry=entry+v[j]*n**(spavar-j);
|
|
724
|
+
}
|
|
725
|
+
entry=entry+1;
|
|
726
|
+
return(entry);
|
|
727
|
+
}
|
|
728
|
+
//////////////////////////////////
|
|
729
|
+
static proc CompareVec(intvec ToTest, intvec Reference)//1 if ToTest>=Reference, 0 else
|
|
730
|
+
{
|
|
731
|
+
int i;
|
|
732
|
+
for(i=1;i<=size(@variables)-1;i++)
|
|
733
|
+
{
|
|
734
|
+
if(ToTest[i+2]<Reference[i])
|
|
735
|
+
{
|
|
736
|
+
return(0);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
return(1);
|
|
740
|
+
}
|
|
741
|
+
/////////////////////////////////
|
|
742
|
+
static proc MaxVecZero(intvec ToTest, intvec Reference) //KGV, size=size(input)
|
|
743
|
+
{
|
|
744
|
+
int length=size(ToTest);
|
|
745
|
+
int i;
|
|
746
|
+
intvec Maximum;
|
|
747
|
+
for(i=1;i<=length;i++)
|
|
748
|
+
{
|
|
749
|
+
Maximum[i]=maximal(ToTest[i],Reference[i]);
|
|
750
|
+
}
|
|
751
|
+
return(Maximum);
|
|
752
|
+
}
|
|
753
|
+
//////////////////////////////////
|
|
754
|
+
proc matrixsystem(list Matrices,list Approx)
|
|
755
|
+
"USAGE: matrixsystem(M,A); where the M=Mt,M1,..,Mn is a list with square matrices of the same dimension as entries, and A=At,A1,..,An gives the corresponding approximations for the several variables (t,x1,..,xn) as vector. Intended to solve Mt*U_t + M1*U_x1+..+Mn*U_xn=0 as a linear sytem of partial differential equations numerically by a finite difference scheme;
|
|
756
|
+
RETURN: type matrix; gives back the matrices B1,B2 that represent the finite difference scheme, partitioned into different time levels in the form: B1*U(t=N)=B2*U(t<N), where N is the maximal occurring degree (timelevel) of t.
|
|
757
|
+
EXAMPLE: example matrixsystem; shows an example
|
|
758
|
+
"
|
|
759
|
+
{
|
|
760
|
+
if(size(Matrices)>size(@variables) or size(Matrices)!=size(Approx))
|
|
761
|
+
{
|
|
762
|
+
ERROR("Check number of variables: it must hold #(matrices)<= #(spatial variables)+1 !!! ");
|
|
763
|
+
}
|
|
764
|
+
if(size(Matrices)!=size(Approx))
|
|
765
|
+
{
|
|
766
|
+
ERROR("Every variable needs EXACTLY ONE approximation rule, i.e. #(first argument) =#(second argument) ! ");
|
|
767
|
+
}
|
|
768
|
+
ideal Mon=leadmonomial(Approx[1]);
|
|
769
|
+
int N=size(Matrices);
|
|
770
|
+
int i;
|
|
771
|
+
for(i=2;i<=N;i++)
|
|
772
|
+
{
|
|
773
|
+
Mon=Mon,leadmonomial(Approx[i]);
|
|
774
|
+
}
|
|
775
|
+
kill i;
|
|
776
|
+
poly LCM=lcm(Mon);
|
|
777
|
+
matrix M[nrows(Matrices[1])][ncols(Matrices[1])];
|
|
778
|
+
int i;
|
|
779
|
+
for(i=1;i<=size(Matrices);i++)
|
|
780
|
+
{
|
|
781
|
+
M=M+(LCM/leadmonomial(Approx[i]))*normalize(Approx[i])[size(@derivatives)]*Matrices[i];
|
|
782
|
+
}
|
|
783
|
+
kill i;
|
|
784
|
+
return(M);
|
|
785
|
+
}
|
|
786
|
+
example
|
|
787
|
+
{
|
|
788
|
+
"EXAMPLE:";echo=2;
|
|
789
|
+
list D="Ut","Ux","Uy","U";
|
|
790
|
+
list V="t","x","y";
|
|
791
|
+
list P="a","b";
|
|
792
|
+
setinitials(V,D,P);
|
|
793
|
+
list Mat=unitmat(2),unitmat(2);
|
|
794
|
+
list Appr=forward(Ut,U,t),forward(Ux,U,x);
|
|
795
|
+
matrixsystem(Mat,Appr);
|
|
796
|
+
}
|
|
797
|
+
//////////////////////////////////
|
|
798
|
+
proc timestep(matrix M)
|
|
799
|
+
"USAGE: timestep(M); M a square matrix with polynomials over the basering as entries;
|
|
800
|
+
RETURN: type list; gives two matrices M1,M2 that are the splitting of M with respect to the degree of the variable t in the entries, where the first list-entry M1 consists of the polynomials of the highest timelevel and M2 of the lower levels in the form: M=0 => M1=M2, i.e. M1-M2=M
|
|
801
|
+
NOTE: intended to be used for the finite-difference-scheme-construction and partition into the several time steps
|
|
802
|
+
EXAMPLE: example timestep; shows an example
|
|
803
|
+
"
|
|
804
|
+
{
|
|
805
|
+
int N=nrows(M);
|
|
806
|
+
int i;
|
|
807
|
+
int maxdegT;
|
|
808
|
+
for(i=1;i<=N;i++)
|
|
809
|
+
{
|
|
810
|
+
int j;
|
|
811
|
+
for(j=1;j<=N;j++)
|
|
812
|
+
{
|
|
813
|
+
poly f=M[i,j];
|
|
814
|
+
int k;
|
|
815
|
+
for(k=1;k<=size(f);k++)
|
|
816
|
+
{
|
|
817
|
+
if(leadexp(M[i,j])[2]>maxdegT)
|
|
818
|
+
{
|
|
819
|
+
maxdegT=leadexp(M[i,j])[2];
|
|
820
|
+
}
|
|
821
|
+
f=f-lead(f);
|
|
822
|
+
}
|
|
823
|
+
kill f;
|
|
824
|
+
kill k;
|
|
825
|
+
}
|
|
826
|
+
kill j;
|
|
827
|
+
}
|
|
828
|
+
kill i;
|
|
829
|
+
matrix highT[nrows(M)][nrows(M)];
|
|
830
|
+
vector leftside=0;
|
|
831
|
+
int GenIndex=0;
|
|
832
|
+
int i;
|
|
833
|
+
for(i=1;i<=N;i++)
|
|
834
|
+
{
|
|
835
|
+
int j;
|
|
836
|
+
for(j=1;j<=N;j++)
|
|
837
|
+
{
|
|
838
|
+
poly f=M[i,j];
|
|
839
|
+
int k;
|
|
840
|
+
for(k=1;k<=size(f)+1;k++)
|
|
841
|
+
{
|
|
842
|
+
if(leadexp(f)[2]==maxdegT)
|
|
843
|
+
{
|
|
844
|
+
GenIndex++;
|
|
845
|
+
highT[i,j]=highT[i,j]+lead(f);
|
|
846
|
+
leftside=leftside+highT[i,j]*gen(GenIndex);
|
|
847
|
+
}
|
|
848
|
+
f=f-lead(f);
|
|
849
|
+
}
|
|
850
|
+
kill k;
|
|
851
|
+
kill f;
|
|
852
|
+
}
|
|
853
|
+
kill j;
|
|
854
|
+
}
|
|
855
|
+
kill i;
|
|
856
|
+
matrix tUpper=highT;
|
|
857
|
+
matrix tLower=-1*(M-tUpper);
|
|
858
|
+
tUpper=tUpper/content(leftside);
|
|
859
|
+
tLower=tLower/content(leftside);
|
|
860
|
+
list L=tUpper,tLower;
|
|
861
|
+
return(L);
|
|
862
|
+
}
|
|
863
|
+
example
|
|
864
|
+
{
|
|
865
|
+
"EXAMPLE:"; echo=2;
|
|
866
|
+
list D="Ut","Ux","Uy","U";
|
|
867
|
+
list V="t","x","y";
|
|
868
|
+
list P="a","b";
|
|
869
|
+
setinitials(V,D,P);
|
|
870
|
+
list Mat=unitmat(2),unitmat(2);
|
|
871
|
+
list Apr=forward(Ut,U,t),forward(Ux,U,x);
|
|
872
|
+
matrixsystem(Mat,Apr);
|
|
873
|
+
timestep(_);
|
|
874
|
+
}
|
|
875
|
+
//////////////////////////////////
|
|
876
|
+
proc fouriersystem(list Matrices, list Approx)
|
|
877
|
+
"USAGE: fouriersystem(M,A); M a list of matrices, A a list of approximations;
|
|
878
|
+
RETURN: type list; each entry is some matrix obtained by performing the substitution of the single approximations into the system of pde's, partitioning the equation into the several timesteps and fouriertransforming these parts
|
|
879
|
+
EXAMPLE: example fouriersystem; shows an example
|
|
880
|
+
"
|
|
881
|
+
{
|
|
882
|
+
matrix M=matrixsystem(Matrices,Approx);
|
|
883
|
+
matrix T1=timestep(M)[1];
|
|
884
|
+
matrix T0=timestep(M)[2];
|
|
885
|
+
int i;
|
|
886
|
+
for(i=1;i<=nrows(M);i++)
|
|
887
|
+
{
|
|
888
|
+
int j;
|
|
889
|
+
for(j=1;j<=nrows(M);j++)
|
|
890
|
+
{
|
|
891
|
+
T1[i,j]=errormap(T1[i,j]);
|
|
892
|
+
T1[i,j]=VarToPar(T1[i,j]);
|
|
893
|
+
T0[i,j]=errormap(T0[i,j]);
|
|
894
|
+
T0[i,j]=VarToPar(T0[i,j]);
|
|
895
|
+
}
|
|
896
|
+
kill j;
|
|
897
|
+
}
|
|
898
|
+
kill i;
|
|
899
|
+
ideal EV1=eigenvals(T1)[1];
|
|
900
|
+
ideal EV0=eigenvals(T0)[1];
|
|
901
|
+
list L=list(T1,T0),list(EV1,EV0);
|
|
902
|
+
def N1=size(EV1);
|
|
903
|
+
def N0=size(EV0);
|
|
904
|
+
list CV1;
|
|
905
|
+
list CV0;
|
|
906
|
+
int i;
|
|
907
|
+
for(i=1;i<=N1;i++)
|
|
908
|
+
{
|
|
909
|
+
CV1[i]=VarToPar(EV1[i]);
|
|
910
|
+
if(content(CV1[i])==CV1[i])
|
|
911
|
+
{
|
|
912
|
+
CV1[i]=content(CV1[i]);
|
|
913
|
+
CV1[i]=VarToPar(ComplexValue(numerator(CV1[i])))/VarToPar(ComplexValue(denominator(CV1[i])));
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
kill i;
|
|
917
|
+
int i;
|
|
918
|
+
for(i=1;i<=N0;i++)
|
|
919
|
+
{
|
|
920
|
+
CV0[i]=VarToPar(EV0[i]);
|
|
921
|
+
if(content(CV0[i])==CV0[i])
|
|
922
|
+
{
|
|
923
|
+
CV0[i]=content(CV0[i]);
|
|
924
|
+
CV0[i]=VarToPar(ComplexValue(numerator(CV0[i])))/VarToPar(ComplexValue(denominator(CV0[i])));
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
kill i;
|
|
928
|
+
list CV=list(CV1,CV0);
|
|
929
|
+
L=L,CV;
|
|
930
|
+
return(L);
|
|
931
|
+
}
|
|
932
|
+
example
|
|
933
|
+
{
|
|
934
|
+
"EXAMPLE:"; echo = 2;
|
|
935
|
+
list D="Ut","Ux","Uy","U";
|
|
936
|
+
list V="t","x","y";
|
|
937
|
+
list P="a","b";
|
|
938
|
+
setinitials(V,D,P);
|
|
939
|
+
matrix M[2][2]=0,-a,-a,0;
|
|
940
|
+
list Mat=unitmat(2),M;
|
|
941
|
+
list Appr=forward(Ut,U,t),trapezoid(Ux,U,x);
|
|
942
|
+
def s=fouriersystem(Mat,Appr);s;
|
|
943
|
+
}
|
|
944
|
+
//////////////////////////////////
|
|
945
|
+
proc PartitionVar(poly f,int n)
|
|
946
|
+
"USAGE: PartitionVar(f); f a poly in the basering;
|
|
947
|
+
RETURN: type poly; gives back a list L=f1,f2 obtained by the partition of f into two parts f1,f2 with deg_var_n(f1) >0 deg_var_n(f2)=0
|
|
948
|
+
EXAMPLE: example PartitionVar; shows an example
|
|
949
|
+
"
|
|
950
|
+
{
|
|
951
|
+
if(n>=nvars(basering))
|
|
952
|
+
{
|
|
953
|
+
ERROR("this variable does not exist in the current basering");
|
|
954
|
+
}
|
|
955
|
+
int i;
|
|
956
|
+
poly partition=0;
|
|
957
|
+
poly g=f;
|
|
958
|
+
for(i=1;i<=size(f);i++)
|
|
959
|
+
{
|
|
960
|
+
if(leadexp(g)[n]!=0)
|
|
961
|
+
{
|
|
962
|
+
partition=partition+lead(g);
|
|
963
|
+
}
|
|
964
|
+
g=g-lead(g);
|
|
965
|
+
}
|
|
966
|
+
list L=partition,f-partition;
|
|
967
|
+
return(L);
|
|
968
|
+
}
|
|
969
|
+
example
|
|
970
|
+
{
|
|
971
|
+
"EXAMPLE:"; echo = 2;
|
|
972
|
+
list D="Ut","Ux","Uy","U";
|
|
973
|
+
list V="t","x","y";
|
|
974
|
+
list P="a","b";
|
|
975
|
+
setinitials(V,D,P);////does not show the ring, since there is no output
|
|
976
|
+
basering;///does show the ring
|
|
977
|
+
poly f=t**3*cx**2-cy**2*dt+i**3*sx;
|
|
978
|
+
PartitionVar(f,1); ////i is the first variable
|
|
979
|
+
}
|
|
980
|
+
//////////////////////////////////
|
|
981
|
+
proc ComplexValue(poly f)
|
|
982
|
+
"USAGE: ComplexValue(f); f a poly in the basering;
|
|
983
|
+
RETURN: type poly; gives back the formal complex-value of f, where var(1) is redarded as the imaginary unit. Does only make sense, if the proc <setinitials> is executed before -> nvars <= npars
|
|
984
|
+
EXAMPLE: example ComplexValue; shows an example
|
|
985
|
+
"
|
|
986
|
+
{
|
|
987
|
+
poly g=ParToVar(f);
|
|
988
|
+
def L=PartitionVar(g,1);
|
|
989
|
+
poly f1=subst(L[1],var(1),1);
|
|
990
|
+
poly f2=L[2];
|
|
991
|
+
poly result=reduce(f1**2+f2**2,std(0));
|
|
992
|
+
return(result);
|
|
993
|
+
}
|
|
994
|
+
example
|
|
995
|
+
{
|
|
996
|
+
"EXAMPLE:"; echo = 2;
|
|
997
|
+
list D="Ut","Ux","Uy","U";
|
|
998
|
+
list V="t","x","y";
|
|
999
|
+
list P="a","b";
|
|
1000
|
+
setinitials(V,D,P);////does not show the ring, as there is no output
|
|
1001
|
+
basering;///does show the ring
|
|
1002
|
+
poly f=t**3*cx**2-cy**2*dt+i**3*sx;
|
|
1003
|
+
f;
|
|
1004
|
+
ComplexValue(f);
|
|
1005
|
+
}
|
|
1006
|
+
//////////////////////////////////
|
|
1007
|
+
proc VarToPar(poly f)
|
|
1008
|
+
"USAGE: VarToPar(f); f a poly in the basering;
|
|
1009
|
+
RETURN: type poly; gives back the poly obtained by substituting var(i) by par(i), for all variables. Does only make sense, if the proc <setinitials> is executed before -> nvars <= npars;
|
|
1010
|
+
EXAMPLE: example VarToPar; shows an example
|
|
1011
|
+
"
|
|
1012
|
+
{
|
|
1013
|
+
int N=nvars(basering);
|
|
1014
|
+
int i;
|
|
1015
|
+
def g=f;
|
|
1016
|
+
for(i=1;i<=N;i++)
|
|
1017
|
+
{
|
|
1018
|
+
g=subst(g,var(i),par(i));
|
|
1019
|
+
}
|
|
1020
|
+
return(g);
|
|
1021
|
+
}
|
|
1022
|
+
example
|
|
1023
|
+
{
|
|
1024
|
+
"EXAMPLE:"; echo = 2;
|
|
1025
|
+
list D="Ut","Ux","Uy","U";
|
|
1026
|
+
list V="t","x","y";
|
|
1027
|
+
list P="a","b";
|
|
1028
|
+
setinitials(V,D,P);////does not show the ring, as there is no output
|
|
1029
|
+
basering;///does show the ring
|
|
1030
|
+
poly f=t**3*cx**2-cy**2*dt+i**3*sx;
|
|
1031
|
+
f;
|
|
1032
|
+
VarToPar(f);
|
|
1033
|
+
}
|
|
1034
|
+
/////////////////////////////////////
|
|
1035
|
+
proc ParToVar(poly f)
|
|
1036
|
+
"USAGE: ParToVar(f); f a poly in the basering;
|
|
1037
|
+
RETURN: type poly; gives back the poly obtained by substituting par(i) by var(i), for the first nvars(basering parameters. Does only make sense, if setinitials is executed before -> nvars <= npars. Is the opposite action to VarToPar, see example ParToVar;
|
|
1038
|
+
EXAMPLE: example ParToVar; shows an example
|
|
1039
|
+
"
|
|
1040
|
+
{
|
|
1041
|
+
int N=nvars(basering);
|
|
1042
|
+
int i;
|
|
1043
|
+
number g=number(VarToPar(f));
|
|
1044
|
+
number denom=denominator(g);
|
|
1045
|
+
g=denom*g;
|
|
1046
|
+
def gg=subst(g,par(1),var(1));
|
|
1047
|
+
for(i=2;i<=N;i++)
|
|
1048
|
+
{
|
|
1049
|
+
gg=subst(gg,par(i),var(i));
|
|
1050
|
+
}
|
|
1051
|
+
return(gg/denom);
|
|
1052
|
+
}
|
|
1053
|
+
example
|
|
1054
|
+
{
|
|
1055
|
+
"EXAMPLE:"; echo = 2;
|
|
1056
|
+
list D="Ut","Ux","Uy","U";
|
|
1057
|
+
list V="t","x","y";
|
|
1058
|
+
list P="a","b";
|
|
1059
|
+
setinitials(V,D,P);////does not show the ring, as there is no output
|
|
1060
|
+
basering;///does show the ring
|
|
1061
|
+
poly f=t**3*cx**2-cy**2*dt+i**3*sx/dt*dx;
|
|
1062
|
+
f;
|
|
1063
|
+
def g=VarToPar(f);
|
|
1064
|
+
g;
|
|
1065
|
+
def h=ParToVar(g);
|
|
1066
|
+
h==f;
|
|
1067
|
+
}
|
|
1068
|
+
/////////////////////////////////////////
|
|
1069
|
+
proc qepcad(poly f)
|
|
1070
|
+
"USAGE: qepcad(f); f a poly in the basering;
|
|
1071
|
+
RETURN: type list; gives back some constraints that are equivalent to f<1 (computed by QEPCAD);
|
|
1072
|
+
EXAMPLE: example qepcad; shows an example
|
|
1073
|
+
"
|
|
1074
|
+
{
|
|
1075
|
+
// how to test, whether QEPCAD is installed?
|
|
1076
|
+
createQCfilter(); // creates/overwrites qepcadfilter.pl
|
|
1077
|
+
system("sh","rm -f QEPCAD-out");
|
|
1078
|
+
system("sh","rm -f QEPCAD-in");
|
|
1079
|
+
if(denominator(content(f))==1)
|
|
1080
|
+
{
|
|
1081
|
+
poly g=f-1;
|
|
1082
|
+
}
|
|
1083
|
+
else
|
|
1084
|
+
{
|
|
1085
|
+
if(f==content(f))
|
|
1086
|
+
{
|
|
1087
|
+
poly g=f*denominator(content(f))-1*denominator(content(f));
|
|
1088
|
+
g=ParToVar(g);
|
|
1089
|
+
g=reduce(g,std(0));
|
|
1090
|
+
}
|
|
1091
|
+
else
|
|
1092
|
+
{
|
|
1093
|
+
poly g=cleardenom(f)-1/content(f);
|
|
1094
|
+
g=ParToVar(g);
|
|
1095
|
+
g=reduce(g,std(0));
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
string in="QEPCAD-in";
|
|
1099
|
+
string out="QEPCAD-out";
|
|
1100
|
+
link l1=in;
|
|
1101
|
+
link l2=out;
|
|
1102
|
+
string s1="[trial]"; //description
|
|
1103
|
+
string s2=varlist(); //the variables
|
|
1104
|
+
string s3=nfreevars(); //number of free variables
|
|
1105
|
+
string s4=aquantor()+"["+writepoly(g)+rel()+"]."; //the input prenex formula
|
|
1106
|
+
string s5=projection();
|
|
1107
|
+
string s6=projection();
|
|
1108
|
+
string s7=choice();
|
|
1109
|
+
string s8=solution();
|
|
1110
|
+
write(l1,s1,s2,s3,s4,s5,s6,s7,s8);
|
|
1111
|
+
system("sh","qepcad < QEPCAD-in | qepcadfilter.pl > QEPCAD-out");
|
|
1112
|
+
string output=read(out);
|
|
1113
|
+
print(output,"%s");
|
|
1114
|
+
if(size(output)==0)
|
|
1115
|
+
{
|
|
1116
|
+
return("Try manually"); //maybe too few cells
|
|
1117
|
+
}
|
|
1118
|
+
if(find(output,"FALSE")!=0)
|
|
1119
|
+
{
|
|
1120
|
+
return("FALSE");
|
|
1121
|
+
}
|
|
1122
|
+
if(find(output,"WARNING")!=0)
|
|
1123
|
+
{
|
|
1124
|
+
return("WARNING! Try manually");
|
|
1125
|
+
}
|
|
1126
|
+
else
|
|
1127
|
+
{
|
|
1128
|
+
string strpolys=findthepoly(output);
|
|
1129
|
+
list lpolys=listpolynew(strpolys);
|
|
1130
|
+
return(lpolys);
|
|
1131
|
+
}
|
|
1132
|
+
system("sh","rm -f QEPCAD-out");
|
|
1133
|
+
system("sh","rm -f QEPCAD-in");
|
|
1134
|
+
|
|
1135
|
+
}
|
|
1136
|
+
example
|
|
1137
|
+
{
|
|
1138
|
+
"EXAMPLE:"; echo = 2;
|
|
1139
|
+
list D="Ux","Ut","U";
|
|
1140
|
+
list P="a";
|
|
1141
|
+
list V="t","x";
|
|
1142
|
+
setinitials(V,D,P);
|
|
1143
|
+
def s1=scheme(u(Ut)+a*u(Ux),laxfrX(Ux,U,x),laxfrT(Ut,U,x));
|
|
1144
|
+
s1;
|
|
1145
|
+
def s2=errormap(s1);
|
|
1146
|
+
s2;
|
|
1147
|
+
def s3=ComplexValue(s2);s3;
|
|
1148
|
+
qepcad(s3);
|
|
1149
|
+
}
|
|
1150
|
+
///////////////////////////////////////////
|
|
1151
|
+
proc createQCfilter()
|
|
1152
|
+
{
|
|
1153
|
+
// writes the following to the file qepcadfilter.pl
|
|
1154
|
+
// is there already such a file? remove it!
|
|
1155
|
+
system("sh","rm -f qepcadfilter.pl");
|
|
1156
|
+
link l=":w qepcadfilter.pl";
|
|
1157
|
+
write(l, "#!/usr/bin/perl");
|
|
1158
|
+
write(l, "$flag = 0;");
|
|
1159
|
+
write(l, "$res = \"\";");
|
|
1160
|
+
write(l,"while(<>)");
|
|
1161
|
+
write(l,"{ if ($_ =~ /Warning|WARNING|warning|Error|error|ERROR/) { print $_; }");
|
|
1162
|
+
write(l,"elsif ($_ =~ /An\ equivalent/) { $flag = 1; }");
|
|
1163
|
+
write(l,"elsif ($flag == 1 && $_ ne \"\n\") { print $_; $flag = 0; } }");
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
///////////////////////////////////////////
|
|
1167
|
+
proc qepcadsystem(list l)
|
|
1168
|
+
"USAGE: qepcadsytem(f); l a list;
|
|
1169
|
+
RETURN: list
|
|
1170
|
+
PURPOSE: gives back some constraints that are equivalent to the
|
|
1171
|
+
eigenvalues of the matrices in the list l being < 1 (computed by QEPCAD)
|
|
1172
|
+
EXAMPLE: example qepcadsystem; shows an example
|
|
1173
|
+
"
|
|
1174
|
+
{
|
|
1175
|
+
// how to test, whether QEPCAD is installed?
|
|
1176
|
+
createQCfilter(); // creates/overwrites qepcadfilter.pl
|
|
1177
|
+
system("sh","rm -f QEPCAD-out");
|
|
1178
|
+
system("sh","rm -f QEPCAD-in");
|
|
1179
|
+
string in="QEPCAD-in";
|
|
1180
|
+
string out="QEPCAD-out";
|
|
1181
|
+
link l1=in;
|
|
1182
|
+
link l2=out;
|
|
1183
|
+
string s1="[trial]"; //description
|
|
1184
|
+
string s2=varlist(); //the variables
|
|
1185
|
+
string s3=nfreevars(); //number of free variables
|
|
1186
|
+
string thepolys;
|
|
1187
|
+
int n2=size(l[2]);
|
|
1188
|
+
int count;
|
|
1189
|
+
int i;
|
|
1190
|
+
list lpolys;
|
|
1191
|
+
int j;
|
|
1192
|
+
for(j=1;j<=n2;j++)
|
|
1193
|
+
{
|
|
1194
|
+
count++;
|
|
1195
|
+
poly g2=ParToVar(l[2][j]);
|
|
1196
|
+
if(denominator(content(g2))==1)
|
|
1197
|
+
{
|
|
1198
|
+
lpolys[count]=writepoly(ParToVar(reduce(g2-1,std(0))))+rel();
|
|
1199
|
+
}
|
|
1200
|
+
else
|
|
1201
|
+
{
|
|
1202
|
+
if(g2==content(g2))
|
|
1203
|
+
{
|
|
1204
|
+
g2=g2*denominator(content(g2))-1*denominator(content(g2));
|
|
1205
|
+
g2=ParToVar(g2);
|
|
1206
|
+
g2=reduce(g2,std(0));
|
|
1207
|
+
lpolys[count]=writepoly(g2)+rel();
|
|
1208
|
+
}
|
|
1209
|
+
else
|
|
1210
|
+
{
|
|
1211
|
+
lpolys[count]=writepoly(reduce(ParToVar(cleardenom(g2)-1/content(g2)),std(0)))+rel();
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
kill g2;
|
|
1215
|
+
}
|
|
1216
|
+
kill j;
|
|
1217
|
+
int k;
|
|
1218
|
+
for(k=1;k<=size(lpolys);k++)
|
|
1219
|
+
{
|
|
1220
|
+
thepolys=thepolys+lpolys[k];
|
|
1221
|
+
if(k<size(lpolys))
|
|
1222
|
+
{
|
|
1223
|
+
thepolys=thepolys+print(" /","s%")+print("\\ ","s%");
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
string s4=aquantor()+"["+thepolys+"]."; //the input prenex formula
|
|
1227
|
+
string s5=projection();
|
|
1228
|
+
string s6=projection();
|
|
1229
|
+
string s7=choice();
|
|
1230
|
+
string s8=solution();
|
|
1231
|
+
write(l1,s1,s2,s3,s4,s5,s6,s7,s8);
|
|
1232
|
+
system("sh","qepcad < QEPCAD-in | qepcadfilter.pl > QEPCAD-out");
|
|
1233
|
+
string output=read(out);
|
|
1234
|
+
print(output,"%s");
|
|
1235
|
+
if(size(output)==0)
|
|
1236
|
+
{
|
|
1237
|
+
ERROR("Try manually"); //maybe too few cells
|
|
1238
|
+
}
|
|
1239
|
+
if(find(output,"FALSE")!=0)
|
|
1240
|
+
{
|
|
1241
|
+
ERROR("FALSE");
|
|
1242
|
+
}
|
|
1243
|
+
if(find(output,"WARNING")!=0)
|
|
1244
|
+
{
|
|
1245
|
+
ERROR("WARNING! Try manually");
|
|
1246
|
+
}
|
|
1247
|
+
else
|
|
1248
|
+
{
|
|
1249
|
+
string strpolys=findthepoly(output);
|
|
1250
|
+
list llpolys=listpolynew(strpolys);
|
|
1251
|
+
return(llpolys);
|
|
1252
|
+
}
|
|
1253
|
+
system("sh","rm -f QEPCAD-out");
|
|
1254
|
+
system("sh","rm -f QEPCAD-in");
|
|
1255
|
+
}
|
|
1256
|
+
example
|
|
1257
|
+
{
|
|
1258
|
+
"EXAMPLE:"; echo = 2;
|
|
1259
|
+
list D="Ut","Ux","Uy","U";
|
|
1260
|
+
list V="t","x","y";
|
|
1261
|
+
list P="a","b";
|
|
1262
|
+
setinitials(V,D,P);
|
|
1263
|
+
matrix M[2][2]=0,-a,-a,0;
|
|
1264
|
+
list Mat=unitmat(2),M;
|
|
1265
|
+
list Appr=forward(Ut,U,t),forward(Ux,U,x);
|
|
1266
|
+
//matrixsystem(Mat,Appr);
|
|
1267
|
+
//timestep(_);
|
|
1268
|
+
fouriersystem(Mat,Appr);
|
|
1269
|
+
qepcadsystem(_[2]);
|
|
1270
|
+
}
|
|
1271
|
+
///////////////////////////////////////////
|
|
1272
|
+
static proc substbracketstar(string s)
|
|
1273
|
+
{
|
|
1274
|
+
int i;
|
|
1275
|
+
int k;
|
|
1276
|
+
int index=1;
|
|
1277
|
+
string finish=s;
|
|
1278
|
+
for(k=1;k<=size(s);k++)
|
|
1279
|
+
{
|
|
1280
|
+
if(finish[1]=="(" or finish[1]=="*" or finish[1]==" ")
|
|
1281
|
+
{
|
|
1282
|
+
kill finish;
|
|
1283
|
+
index=index+1;
|
|
1284
|
+
string finish=s[index..size(s)];
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
for(i=1;i<=size(finish);i++)
|
|
1288
|
+
{
|
|
1289
|
+
if(finish[i]=="*" or finish[i]=="(" or finish[i]== ")")
|
|
1290
|
+
{
|
|
1291
|
+
finish[i]=" ";
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
return(finish);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
////////////////////////////////////
|
|
1298
|
+
static proc distribution(string SUM, string MON)
|
|
1299
|
+
{
|
|
1300
|
+
string sum=substbracketstar(SUM);
|
|
1301
|
+
string mon=substbracketstar(MON);
|
|
1302
|
+
string result;
|
|
1303
|
+
list signs;
|
|
1304
|
+
list p;
|
|
1305
|
+
int i;
|
|
1306
|
+
int j;
|
|
1307
|
+
int init;
|
|
1308
|
+
for(i=2;i<=size(sum);i++)
|
|
1309
|
+
{
|
|
1310
|
+
if(sum[i]=="+" or sum[i]=="-")
|
|
1311
|
+
{
|
|
1312
|
+
j++;
|
|
1313
|
+
p[j]=i;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
if(j==0)
|
|
1317
|
+
{
|
|
1318
|
+
if(sum[1]!="-")
|
|
1319
|
+
{
|
|
1320
|
+
result=sum+" "+" "+mon;
|
|
1321
|
+
result="+"+" "+result;
|
|
1322
|
+
}
|
|
1323
|
+
else
|
|
1324
|
+
{
|
|
1325
|
+
result=sum+" "+mon;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
else
|
|
1329
|
+
{
|
|
1330
|
+
int l;
|
|
1331
|
+
int anfang;
|
|
1332
|
+
if(sum[1]=="-")
|
|
1333
|
+
{
|
|
1334
|
+
result="-"+" "+result;
|
|
1335
|
+
anfang=2;
|
|
1336
|
+
}
|
|
1337
|
+
else
|
|
1338
|
+
{
|
|
1339
|
+
result="+"+" "+result;
|
|
1340
|
+
if(sum[1]=="+")
|
|
1341
|
+
{
|
|
1342
|
+
anfang=2;
|
|
1343
|
+
}
|
|
1344
|
+
else
|
|
1345
|
+
{
|
|
1346
|
+
anfang=1;
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
for(l=1;l<=j;l++)
|
|
1350
|
+
{
|
|
1351
|
+
string a;
|
|
1352
|
+
int k;
|
|
1353
|
+
for(k=anfang;k<=p[l]-1;k++)
|
|
1354
|
+
{
|
|
1355
|
+
a=a+sum[k];
|
|
1356
|
+
}
|
|
1357
|
+
result=result+" "+a+" "+mon+" "+sum[p[l]];
|
|
1358
|
+
anfang=p[l]+1;
|
|
1359
|
+
kill a;
|
|
1360
|
+
kill k;
|
|
1361
|
+
}
|
|
1362
|
+
if(p[j]<size(sum))
|
|
1363
|
+
{
|
|
1364
|
+
int kk;
|
|
1365
|
+
string aa;
|
|
1366
|
+
for(kk=anfang;kk<=size(sum);kk++)
|
|
1367
|
+
{
|
|
1368
|
+
aa=aa+sum[kk];
|
|
1369
|
+
}
|
|
1370
|
+
result=result+" "+aa+" "+mon;
|
|
1371
|
+
kill aa;
|
|
1372
|
+
kill kk;
|
|
1373
|
+
}
|
|
1374
|
+
else
|
|
1375
|
+
{
|
|
1376
|
+
int kkk;
|
|
1377
|
+
string aaa;
|
|
1378
|
+
for(kkk=anfang;kkk<size(sum);kkk++)
|
|
1379
|
+
{
|
|
1380
|
+
aaa=aaa+sum[kkk];
|
|
1381
|
+
}
|
|
1382
|
+
result=result+" "+aaa+" "+mon;
|
|
1383
|
+
kill aaa;
|
|
1384
|
+
kill kkk;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
return(result);
|
|
1388
|
+
}
|
|
1389
|
+
/////////////////////////////////////////////////////////////////
|
|
1390
|
+
static proc writepoly(poly f)
|
|
1391
|
+
{
|
|
1392
|
+
poly g=f;
|
|
1393
|
+
string lc;
|
|
1394
|
+
string lm;
|
|
1395
|
+
string strpoly;
|
|
1396
|
+
string intermediate;
|
|
1397
|
+
int n=size(f);
|
|
1398
|
+
int i;
|
|
1399
|
+
for(i=1;i<=n;i++)
|
|
1400
|
+
{
|
|
1401
|
+
|
|
1402
|
+
lc=substbracketstar(string(leadcoef(g)));
|
|
1403
|
+
lm=substbracketstar(string(leadmonom(g)));
|
|
1404
|
+
intermediate=distribution(lc,lm);
|
|
1405
|
+
strpoly=strpoly+" "+intermediate;
|
|
1406
|
+
g=g-lead(g);
|
|
1407
|
+
}
|
|
1408
|
+
return(strpoly);
|
|
1409
|
+
}
|
|
1410
|
+
///////////////////////////////////////////////////////////////
|
|
1411
|
+
static proc varlist()
|
|
1412
|
+
{
|
|
1413
|
+
poly p1=par(2+size(@variables));
|
|
1414
|
+
p1=ParToVar(p1);
|
|
1415
|
+
string name=print(p1,"%s");
|
|
1416
|
+
string p="("+name+",";
|
|
1417
|
+
int i;
|
|
1418
|
+
for(i=3+size(@variables);i<=npars(basering);i++)
|
|
1419
|
+
{
|
|
1420
|
+
p1=ParToVar(par(i));
|
|
1421
|
+
name=substbracketstar(print(p1,"%s"));
|
|
1422
|
+
p=p+name+",";
|
|
1423
|
+
}
|
|
1424
|
+
p1=ParToVar(par(2));
|
|
1425
|
+
name=print(p1,"%s");
|
|
1426
|
+
p=p+name+")";
|
|
1427
|
+
return(p);
|
|
1428
|
+
}
|
|
1429
|
+
///////////////////////////////////////////////////////
|
|
1430
|
+
static proc normalization()
|
|
1431
|
+
{
|
|
1432
|
+
int n1=npars(basering)-size(@variables);
|
|
1433
|
+
int n2=npars(basering)-n1;
|
|
1434
|
+
string assumption="assume["+" "+substbracketstar(print(par(n1+1),"%s"))+" >0";
|
|
1435
|
+
int i;
|
|
1436
|
+
for(i=2;i<=n2;i++)
|
|
1437
|
+
{
|
|
1438
|
+
string s=" /\\"+" "+substbracketstar(print(par(n1+i),"%s"))+" >0";
|
|
1439
|
+
assumption=assumption+" "+s;
|
|
1440
|
+
kill s;
|
|
1441
|
+
}
|
|
1442
|
+
assumption=assumption+" ]"+newline+"go";
|
|
1443
|
+
return(assumption);
|
|
1444
|
+
}
|
|
1445
|
+
///////////////////////////////////////////////////////
|
|
1446
|
+
static proc projection()
|
|
1447
|
+
{
|
|
1448
|
+
string s="go";
|
|
1449
|
+
return(s);
|
|
1450
|
+
}
|
|
1451
|
+
///////////////////////////////////////////////////////
|
|
1452
|
+
static proc choice()
|
|
1453
|
+
{
|
|
1454
|
+
string s="go";
|
|
1455
|
+
return(s);
|
|
1456
|
+
}
|
|
1457
|
+
///////////////////////////////////////////////////////
|
|
1458
|
+
static proc solution()
|
|
1459
|
+
{
|
|
1460
|
+
string s="go";
|
|
1461
|
+
return(s);
|
|
1462
|
+
}
|
|
1463
|
+
///////////////////////////////////////////////////////
|
|
1464
|
+
static proc nfreevars()
|
|
1465
|
+
{
|
|
1466
|
+
int n=npars(basering)-size(@variables)-1;
|
|
1467
|
+
string no=print(n,"%s");
|
|
1468
|
+
return(no);
|
|
1469
|
+
}
|
|
1470
|
+
/////////////////////////////////////////////////////////
|
|
1471
|
+
static proc aquantor()
|
|
1472
|
+
{
|
|
1473
|
+
string s="(A "+print(var(2),"%s")+")";
|
|
1474
|
+
return(s);
|
|
1475
|
+
}
|
|
1476
|
+
////////////////////////////////////////////////////////
|
|
1477
|
+
static proc rel()
|
|
1478
|
+
{
|
|
1479
|
+
return("<0");
|
|
1480
|
+
}
|
|
1481
|
+
/////////////////////////////////////////////////////////
|
|
1482
|
+
static proc rm()
|
|
1483
|
+
{
|
|
1484
|
+
system("sh","rm -f dummy");
|
|
1485
|
+
system("sh","rm -f QEPCAD-in");
|
|
1486
|
+
}
|
|
1487
|
+
////////////////////////////////////////////////////////
|
|
1488
|
+
static proc findthepoly(string word)
|
|
1489
|
+
{
|
|
1490
|
+
int init=1;
|
|
1491
|
+
int index=find(word,newline);
|
|
1492
|
+
if(index==size(word) or index== 0)
|
|
1493
|
+
{
|
|
1494
|
+
return(word);
|
|
1495
|
+
}
|
|
1496
|
+
else
|
|
1497
|
+
{
|
|
1498
|
+
while(index<size(word))
|
|
1499
|
+
{
|
|
1500
|
+
init=index;
|
|
1501
|
+
index=find(word,newline,index+1);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
string thepoly=word[(init+1)..(size(word)-1)];
|
|
1505
|
+
return(thepoly);
|
|
1506
|
+
}
|
|
1507
|
+
//////////////////////////////////////////////////
|
|
1508
|
+
static proc listpolynew(string thepoly)
|
|
1509
|
+
{
|
|
1510
|
+
string p=thepoly;
|
|
1511
|
+
intvec v;
|
|
1512
|
+
p=TestAndDelete(p,"[")[1];
|
|
1513
|
+
p=TestAndDelete(p,"]")[1]; //remove the brackets
|
|
1514
|
+
string AND="/"+"\\";
|
|
1515
|
+
string OR="\\"+"/";
|
|
1516
|
+
list thesigns=AND,OR,"~","<==>","==>","<==";///these can occur in QEPCAD
|
|
1517
|
+
int i;
|
|
1518
|
+
for(i=1;i<=size(thesigns);i++)
|
|
1519
|
+
{
|
|
1520
|
+
list l=TestAndDelete(p,thesigns[i]);
|
|
1521
|
+
p=l[1];
|
|
1522
|
+
v=addintvec(v,l[2]);
|
|
1523
|
+
kill l;
|
|
1524
|
+
}
|
|
1525
|
+
intvec w=rightorder(v);
|
|
1526
|
+
int N=size(v);
|
|
1527
|
+
list lstrings;
|
|
1528
|
+
if(size(w)==1 and w[1]==0)
|
|
1529
|
+
{
|
|
1530
|
+
N=0;
|
|
1531
|
+
lstrings[1]=p;
|
|
1532
|
+
}
|
|
1533
|
+
else
|
|
1534
|
+
{
|
|
1535
|
+
string s1=p[1..w[1]-1];
|
|
1536
|
+
lstrings[1]=s1;
|
|
1537
|
+
int j;
|
|
1538
|
+
for(j=1;j<N;j++)
|
|
1539
|
+
{
|
|
1540
|
+
string s2=p[w[j]..w[j+1]-1];
|
|
1541
|
+
lstrings[j+1]=s2;
|
|
1542
|
+
kill s2;
|
|
1543
|
+
}
|
|
1544
|
+
string s3=p[w[N]..size(p)];
|
|
1545
|
+
lstrings[N+1]=s3;
|
|
1546
|
+
}
|
|
1547
|
+
list cutstrings;
|
|
1548
|
+
int k;
|
|
1549
|
+
list Id;
|
|
1550
|
+
for(k=1;k<=N+1;k++)
|
|
1551
|
+
{
|
|
1552
|
+
cutstrings[k]=cutoffrel(lstrings[k]);
|
|
1553
|
+
Id[k]=translatenew(cutstrings[k]);
|
|
1554
|
+
}
|
|
1555
|
+
return(Id);
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
}
|
|
1559
|
+
/////////////////////////////////////////////////
|
|
1560
|
+
static proc translatenew(string word)
|
|
1561
|
+
{
|
|
1562
|
+
int n=size(word);
|
|
1563
|
+
string subword=word[1..n];
|
|
1564
|
+
string strpoly="poly f=";
|
|
1565
|
+
list linterim;
|
|
1566
|
+
int i;
|
|
1567
|
+
for(i=1;i<=n;i++)
|
|
1568
|
+
{
|
|
1569
|
+
if(i<n and subword[i]==" " and subword[i+1]!="+" and subword[i+1]!="-" and subword[i+1]!=" " and subword[i-1]!="+" and subword[i-1]!="-" and subword[i-1]!=" " and i>1)
|
|
1570
|
+
{
|
|
1571
|
+
linterim[i]="*";
|
|
1572
|
+
}
|
|
1573
|
+
else
|
|
1574
|
+
{
|
|
1575
|
+
linterim[i]=word[i];
|
|
1576
|
+
}
|
|
1577
|
+
strpoly=strpoly+print(linterim[i],"%s");
|
|
1578
|
+
}
|
|
1579
|
+
strpoly=strpoly+";";
|
|
1580
|
+
execute(strpoly);
|
|
1581
|
+
return(f);
|
|
1582
|
+
}
|
|
1583
|
+
//////////////////////////////////////////////////
|
|
1584
|
+
static proc rightorder(intvec v)
|
|
1585
|
+
////////////orders the entries of an intvec from small to bigger
|
|
1586
|
+
{
|
|
1587
|
+
list ldown=intveclist(v);
|
|
1588
|
+
list lup;
|
|
1589
|
+
intvec v1;
|
|
1590
|
+
int counter;
|
|
1591
|
+
int min;
|
|
1592
|
+
int i;
|
|
1593
|
+
for(i=1;i<=size(v);i++)
|
|
1594
|
+
{
|
|
1595
|
+
min=Min(listintvec(ldown));
|
|
1596
|
+
lup[i]=min;
|
|
1597
|
+
counter=listfind(ldown,min);
|
|
1598
|
+
ldown=delete(ldown,counter);
|
|
1599
|
+
}
|
|
1600
|
+
intvec result=listintvec(lup);
|
|
1601
|
+
return(result);
|
|
1602
|
+
}
|
|
1603
|
+
/////////////////////////////////////////////////
|
|
1604
|
+
static proc listfind(list l, int n)
|
|
1605
|
+
//////gives the position of n in l, 0 if not found
|
|
1606
|
+
{
|
|
1607
|
+
int i;
|
|
1608
|
+
intvec counter;
|
|
1609
|
+
int j=1;
|
|
1610
|
+
for(i=1;i<=size(l);i++)
|
|
1611
|
+
{
|
|
1612
|
+
if(n==l[i])
|
|
1613
|
+
{
|
|
1614
|
+
counter[j]=i;
|
|
1615
|
+
j++;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
int result=Min(counter);
|
|
1619
|
+
return(result);
|
|
1620
|
+
}
|
|
1621
|
+
//////////////////////////////////////////////////
|
|
1622
|
+
static proc cutoffrel(string str)
|
|
1623
|
+
/////////cut off the relations "/=,<= etc." from output-string
|
|
1624
|
+
{
|
|
1625
|
+
list rels="<=",">=","<",">","/=","="; //these are all of qepcad's relations
|
|
1626
|
+
int i;
|
|
1627
|
+
list l;
|
|
1628
|
+
for(i=1;i<=size(rels);i++)
|
|
1629
|
+
{
|
|
1630
|
+
l[i]=find(str,rels[i]);
|
|
1631
|
+
}
|
|
1632
|
+
intvec v=listintvec(l);
|
|
1633
|
+
v=addintvec(v,v);
|
|
1634
|
+
int position=Min(v);
|
|
1635
|
+
string result;
|
|
1636
|
+
if(position==0)
|
|
1637
|
+
{
|
|
1638
|
+
result=str;
|
|
1639
|
+
}
|
|
1640
|
+
else
|
|
1641
|
+
{
|
|
1642
|
+
result=str[1..position-1];
|
|
1643
|
+
}
|
|
1644
|
+
return(result);
|
|
1645
|
+
}
|
|
1646
|
+
//////////////////////////////////////////////////
|
|
1647
|
+
static proc addintvec(intvec v1, intvec v2)
|
|
1648
|
+
///////concatenates two intvecs and deletes occurring zeroentries, output intvec
|
|
1649
|
+
{
|
|
1650
|
+
list lresult;
|
|
1651
|
+
int i;
|
|
1652
|
+
list l1;
|
|
1653
|
+
list l2;
|
|
1654
|
+
for(i=1;i<=size(v1);i++)
|
|
1655
|
+
{
|
|
1656
|
+
l1[i]=v1[i];
|
|
1657
|
+
}
|
|
1658
|
+
kill i;
|
|
1659
|
+
int k;
|
|
1660
|
+
for(k=1;k<=size(v2);k++)
|
|
1661
|
+
{
|
|
1662
|
+
l2[k]=v2[k];
|
|
1663
|
+
}
|
|
1664
|
+
lresult=l1+l2;
|
|
1665
|
+
intvec result;
|
|
1666
|
+
int j;
|
|
1667
|
+
int counter=1;
|
|
1668
|
+
for(j=1;j<=size(lresult);j++)
|
|
1669
|
+
{
|
|
1670
|
+
if(lresult[j]!=0)
|
|
1671
|
+
{
|
|
1672
|
+
result[counter]=lresult[j];
|
|
1673
|
+
counter++;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
return(result);
|
|
1677
|
+
|
|
1678
|
+
}
|
|
1679
|
+
/////////////////////////////////////////////////
|
|
1680
|
+
static proc intveclist(intvec v)
|
|
1681
|
+
//////returns the intvec as list
|
|
1682
|
+
{
|
|
1683
|
+
list l;
|
|
1684
|
+
int i;
|
|
1685
|
+
for(i=size(v);i>=1;i--)
|
|
1686
|
+
{
|
|
1687
|
+
l[i]=v[i];
|
|
1688
|
+
}
|
|
1689
|
+
return(l);
|
|
1690
|
+
}
|
|
1691
|
+
//////////////////////////////////////////////////
|
|
1692
|
+
static proc listintvec(list l)
|
|
1693
|
+
//////////returns the list as intvec: only integer-entries allowed
|
|
1694
|
+
{
|
|
1695
|
+
intvec v;
|
|
1696
|
+
int i;
|
|
1697
|
+
for(i=size(l);i>=1;i--)
|
|
1698
|
+
{
|
|
1699
|
+
v[i]=l[i];
|
|
1700
|
+
}
|
|
1701
|
+
return(v);
|
|
1702
|
+
}
|
|
1703
|
+
//////////////////////////////////////////////////
|
|
1704
|
+
static proc TestAndDelete(string str, string booleansign)
|
|
1705
|
+
{
|
|
1706
|
+
int decide=find(str,booleansign);
|
|
1707
|
+
intvec v;
|
|
1708
|
+
v[1]=decide;
|
|
1709
|
+
while(decide!=0 and decide<size(str))//if booleansign ist not contained in str
|
|
1710
|
+
{
|
|
1711
|
+
int n=size(v);
|
|
1712
|
+
decide=find(str,booleansign,decide+1);
|
|
1713
|
+
if(decide!=0)
|
|
1714
|
+
{
|
|
1715
|
+
v[n+1]=decide;
|
|
1716
|
+
}
|
|
1717
|
+
kill n;
|
|
1718
|
+
}
|
|
1719
|
+
if(size(v)==1 and v[1]==0)/////i.e. booleansign NOT in str
|
|
1720
|
+
{
|
|
1721
|
+
list result=str,v;
|
|
1722
|
+
return(result);
|
|
1723
|
+
}
|
|
1724
|
+
else
|
|
1725
|
+
{
|
|
1726
|
+
list l;
|
|
1727
|
+
string p;
|
|
1728
|
+
int i;
|
|
1729
|
+
int j;
|
|
1730
|
+
for(i=1;i<=size(str);i++)///copy the string str into l
|
|
1731
|
+
{
|
|
1732
|
+
l[i]=str[i];
|
|
1733
|
+
}
|
|
1734
|
+
kill i;
|
|
1735
|
+
for(j=1;j<=size(v);j++)///replace booleansign by empty char
|
|
1736
|
+
{
|
|
1737
|
+
int k;
|
|
1738
|
+
for(k=0;k<=size(booleansign)-1;k++)
|
|
1739
|
+
{
|
|
1740
|
+
l[v[j]+k]=" ";
|
|
1741
|
+
}
|
|
1742
|
+
kill k;
|
|
1743
|
+
}
|
|
1744
|
+
int s;
|
|
1745
|
+
for(s=1;s<=size(l);s++)///copy back
|
|
1746
|
+
{
|
|
1747
|
+
p=p+string(l[s]);
|
|
1748
|
+
}
|
|
1749
|
+
kill s;
|
|
1750
|
+
kill l;
|
|
1751
|
+
list result=p,v;
|
|
1752
|
+
return(result);
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
//////////////////////////////////////////////////
|
|
1756
|
+
static proc nchoice(int n1,int n2)
|
|
1757
|
+
{
|
|
1758
|
+
int N2=maximal(n1,n2);
|
|
1759
|
+
int N1=minimal(n1,n2);
|
|
1760
|
+
if(N1==0)
|
|
1761
|
+
{
|
|
1762
|
+
return(N2);
|
|
1763
|
+
}
|
|
1764
|
+
else
|
|
1765
|
+
{
|
|
1766
|
+
return(N1);
|
|
1767
|
+
}
|
|
1768
|
+
}
|