python的第一副图

在看《机械振动基础》时,看到老师的有一附图

试着自己做下,v1代码为:

复制代码
 1 from math import *
 2 from numpy import *
 3 import matplotlib.pyplot as plt
 4 
 5 x = arange(0, math.pi, 0.00001)
 6 #y0 = [(math.sqrt((1-s**2)**2))**(-1) for s in x]                           
 7 y1 = [(math.sqrt((1-s**2)**2 + (2*s)**2))**(-1) for s in x] 
 8 y2 = [(math.sqrt((1-s**2)**2 + (2*0.5*s)**2))**(-1) for s in x] 
 9 y3 = [(math.sqrt((1-s**2)**2 + (2*0.375*s)**2))**(-1) for s in x] 
10 y4 = [(math.sqrt((1-s**2)**2 + (2*0.25*s)**2))**(-1) for s in x] 
11 y10 = [(math.sqrt((1-s**2)**2 + (2*0.1*s)**2))**(-1) for s in x] 
12 plt.figure()
13 plt.plot(x, y1, color='r')
14 plt.plot(x, y2, color='b')
15 plt.plot(x, y3, color='g')
16 plt.plot(x, y4, color='y')
17 plt.plot(x, y10)
18 plt.show()
复制代码

图形如下:

 

posted @   叕叒双又  阅读(32)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
历史上的今天:
2021-09-15 markdown中的公式
点击右上角即可分享
微信分享提示