# -*- coding: utf-8 -*-
"""Created on Fri Jun 26 09:58:21 2020@author: 120701101@Email: 18*******30@163.com"""
import numpy as np
from numpy import sign # 导入符号函数
import matplotlib.pyplot as plt
import matplotlib
# 设置能够正确显示出LaTex公式样式的字体,来自知乎大神
from matplotlib import rcParams
matplotlib.use("pgf")
pgf_config = {
"font.family":'serif',
"font.size": 20,
"pgf.rcfonts": False,
"text.usetex": True,
"pgf.preamble": [
r"\usepackage{unicode-math}",
r"\setmainfont{Times New Roman}",
r"\usepackage{xeCJK}",
r"\xeCJKsetup{CJKmath=true}",
r"\setCJKmainfont{SimSun}",
],
}
rcParams.update(pgf_config)
# ---------------------------bisection
def bisection(fun, a