代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
"""
file:ch2_symbol模块表达极限
author: Fuwen
time: 2022/7/15 7:17
software:PyCharm
"""
# limit(函数, variable, point)
# float('inf) 或者 oo --无穷
from sympy import *
x = Symbol('x')
f = 58 * (1/2)**x # 酒精浓度稀释的函数
res1 = limit(f, x, float('inf'))
res2 = limit(f, x, oo)
print('limit(f, x, float("inf")) = {}'.format(res1))
print('limit(f, x, oo) = {}'.format(res2))
#%%
# 倒数的函数 f = 1 / x
x = Symbol('x')
f = 1 / x
right_to_zero = limit(f, x, 0, dir='+')
left_to_zero = limit(f, x, 0, dir='-')
print('左边逼近于0,函数极限= {}'.format(left_to_zero))
print('右边逼近于0,函数极限= {}'.format(right_to_zero))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。