编程和建模工具集
pmxutils的Python项目详细描述
PMXUtils公司
MODX工具
请注意,该包正在开发中,可能会频繁更新
对于windows,使用python -m pip install pmxutils
安装,对于unix/linux,使用python3 -m pip install pmxutils
进行安装
目录
数学工具(pmxutils.mathtools
)
- 在
construct(expression, var=x)
Returns a function computing the given expression
expression
-要计算的数学表达式,type=stringvar
-数学表达式中使用的变量,默认为tp'x',type=string
- 在
`advConstruct(表达式,*args,constants={})
Returns a function computing the given expression
expression
-要计算的数学表达式,type=stringargs
-任意数量的单个参数,用于命名表达式中使用的变量,type=stringconstants
-表达式中包含任何数值常量的字典,type=dict
- 在
computeLists(function, low, high, step=1)
Returns a touple of two lists containing x values inbetween low and high, and the computed results for y. In the format of (x_list, y_list)
low
-函数限制的下限,type=numberhigh
-函数限制的上限,type=numberfunction
-用于y值计算的数学表达式,type=string或function from constructstep
-x值列表中的步长,默认为“1”,type=number
- 在
newton(function, derivative, low, high, tolerance=1e-8, rounding = 3, iterations = 1000)
Uses Newtons way of finding the root of a function, using the function and its derivative, within the given limits.Returns None if it can't find a solution that satisfies the tolerance after the defined number of terations
function
-目标数学表达式,type=string或construct中的函数derivative
-目标数学表达式的导数,type=string或function from constructlow
-应该检查根的are的下端,type=numberhigh
-应该检查根的are的上端,type=numbertolerance
-加速计算的误差容限,默认为'1e-8',type=numberrounding
-将根的x值舍入到指定的小数位数,默认为“3”,type=numberiterations
-尝试次数,之后函数将提前结束
- 在
isInbetween(number, low, high)
Returns True if number is inbetween limOne and limTwo, returns False otherwise
number
-要检查的数字,type=numberlow
-检查数字的下限,type=numberhigh
-检查数字的上限,type=number
- 在
rectangleIntegral(function, low, high, n)
Returns the numerically calculated integral of the function f inbetween a and b using n rectangles
function
-要集成的函数,type=string或construct中的函数low
-要计算的区域的低端,type=numberhigh
-要计算的区域的高端,type=numbern
-要使用的矩形数,type=int
- 在
trapezoidIntegral(function, low, high, n)
Returns the numerically calculated integral of the function f inbetween a and b using n trapezoids
function
-要集成的函数,type=string或construct中的函数low
-要计算的区域的低端,type=numberhigh
-要计算的区域的高端,type=numbern
-要使用的梯形数,type=int
- 在
simpsonIntegral(function, low, high, n)
Returns the numerically calculated integral of the function inbetween low and high using n quadratic splines
function
-要集成的函数,type=string或construct中的函数low
-要计算的区域的低端,type=numberhigh
-要计算的区域的高端,type=numbern
-要使用的二次样条曲线的数目,type=int
- 在
euler(functionDerivative, low, high, y0, n)
Returns a numpy array x, containing the x values of the function, and an array F, containing the computed values for the antiderivative function of the given function functionDerivative inbetween low and high with N steps
Only supports functions with one variable
functionDerivative
-目标函数的导数,type=string或function from constructlow
-要计算的函数的低端,type=numberhigh
-最高点要计算的区域的终点,类型=数字y0
-目标函数的初始值n
-要执行的计算数
- 在
lemma(a, b)
Returns the greatest common denominator of a and b using the lemma algorithm
a
-第一个数字b
-第二个数字
其他(pmxutils.other
)
- 在
profile(function)
Time profiler. Prints out the elapsed time during function execution
function
-要分析的函数,type=function
loading()
装载等级
- 在
start(flavor="loading")
Starts a loading sequence
flavor
-加载期间要显示的消息,默认为“加载”,type=string
- 在
stop()
在Stops the loading sequence
- 在
animate()
在DO NOT USE, internal function
- 项目
标签: