![fd00b8b2e5268da2a8fcf1830e837090.png](https://i-blog.csdnimg.cn/blog_migrate/0ad04695ca21edc6ac3ddda057130996.jpeg)
首发公众号:120701101.
1. 代码
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 1 11:17:23 2020
@author: 120701101
@Email: 18*******30@163.com
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
config = {
"font.family":'serif',
"font.size": 20,
"mathtext.fontset":'stix',
"font.serif": ['SimSun'],
}
rcParams.update(config)
import matplotlib as mlt
mlt.rcParams['axes.unicode_minus']=False
# -----------------------------secant
def secant(fun, x1, x2, stepmax, tol):
x = np.zeros(stepmax+1)
x[1] = x1
x[2] = x2