欧拉公式例题20210914

在这里插入图片描述
在这里插入图片描述

import numpy as np
import matplotlib.pyplot as plt
x = 0
y = 1
t = 0.1
list_1=[]
list_2=[]

for i in range(100):
    y = 1.1*y - (0.2*x)/y
    x = x + t
    print(x,y)
    line1 = x #line为每一次获取的数据
    line2 = y    
    list_1.append(line1) #将每一次获取到的数据存放到总的列表中
    list_2.append(line2)
    
fig1=plt.figure()#创建一个绘图对象  
plt.title("Euler") #图像标题
plt.plot(list_1, list_2, color='green')
plt.plot(x,y)
plt.show()
0.1 1.1
0.2 1.191818181818182
0.30000000000000004 1.277437833714722
0.4 1.35821259956029
0.5 1.4351329186577972
0.6 1.5089662535663324
0.7 1.580338237655218
0.7999999999999999 1.6497834310477122
0.8999999999999999 1.717779347860088
0.9999999999999999 1.7847708324979834

在这里插入图片描述


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值