秦明螺旋,螺旋的分形迭代,python源程序,首发

发布时间:2025-06-27 14:53  浏览量:2

螺旋的分形迭代

近代西方数学才开始研究分形,继而研究分形迭代,研究混沌,之后研究julia集,研究分叉理论。。。。。。

西方人喜欢用人名给研究结果挂名,例如康托三分集,科赫雪花,谢尔宾斯地毯等等。由于文化习惯的问题,图记住了,人名总记不住。这样的好处是容易区分,坏处是不懂的人不知道说的是什么。西方人百年来也凑了万八千的这样有人名的研究结果,看着貌似很繁盛的样子,实际很多是数学分支里面的小分支。你要说曼德尔布罗特分形,julia集,这至少算开启了一个数学分支,加个人名也就算了,而像科赫雪花这种小学内容,直接叫雪花分形就可以了,至少看着明白。

笔者搞这螺旋的分形迭代,至少应该算高中或大学内容了,那也就应该加个人名了。最近韦神的一元五次方程的解法被冠上人名,这是一个好的开始。未来用不了几十年,带有中国人名字的数学概念肯定超过外国的,那时候你就知道西方数学又落后了。现在数学课用英文讲,是因为很多前沿数学概念用英文货特殊符号表达更方便。有一天用中文表达方便的时候,也就意味着中国的理论数学、数学前沿已经领先了。

中国古人没这加名的习惯,且给这类内容起名称,看名字通常就知道在说什么。例如面积,你肯定知道说什么,不用解释。那正态统计结果什么意思?没学概率学的肯定蒙。字看着认识,不知道说什么呢。如果是一个希腊符号表达的数学概念呢?这就是数学现在的表达问题。

实际近代数学也遇到这样的语言障碍。那些数学简化符号,如果不是专业学习数学的,看着方程根本不知道在说什么。

过去研究螺旋,通常是基于点。但在拟合实际现象过程中,笔者发现,螺旋基于一个平衡意义的圆更方便解决拟合问题。

圆外用扩展螺旋分形迭代,圆内用萎缩螺旋分形迭代,你可以用黑洞、内部外部来比喻性地考虑这个解释,而那个黑洞视界光线圈,就是那个平衡的圆,内部细节还是螺旋。且外延半径,是黑洞黑区半径的2倍左右。因此秦明螺旋也被笔者用于拟合银河系和我们所处的总时空,这才会有前面十多篇关于宇宙的文章。

对于天文学,秦明螺旋的圆内随机性大一些,量子理论会占便宜;圆外,决定性大一些,相对论占便宜。而这个圆,是几十个环,可以是薛定谔如搜子样的量子波受黑洞核心实体阻碍产生的反弹波与正向波形成的干涉驻波。

无论牛顿、爱因斯坦、还是近代的一些天文数学公式,都是在用不同的数学方法拟合天文观察的现象,这无非又多了一种更直接的拟合方法而已。同时,这是决定性模型,且是通用模型。

上图本身是模拟银河系中太阳(红色)和地球(黄色)运行轨迹的图,读者还可以基于同样的分形迭代规则,加上月亮和卫星,如此就会图会太乱。

这也是秦明螺旋的一种三维近似表达。图中的蓝色是一个圆,而不是螺旋,所以说上图还是一个近似模型。这种模型扩大的分形迭代,就是蓝色的圆也是同样模式的扩展螺旋,这样你就可以理解银河系悬臂为何会发散扩展了。再螺旋分形迭代下去,就是我们所处的总时空。

当然,笔者进一步把这个模型扩展表达为我们所处的总时空。也就是25或51阶分形迭代之后的结果,你说25维或51维也行,现在数学的表达就这么乱套。前文已经用图表拟合计算。留神的是,如果这个模型拟合天文学正确,近代百年天文学中的宇宙学这部分,会彻底崩塌,需要重建,因为大尺度的测量距离的方法错了。

秦明螺旋扩展一圈,到底循环几次,这现在还是问题。对于银河系,太阳是转七次,且并不是封闭曲线,会有可容忍误差。但这个参数相对简化体系,7圈逼近扩展半径为2;而对于其他一些体系,用8圈解释细节更好些,但是这样第9圈螺旋才到2。而2又是准确必须要到达的位置吗?不是,也是逼近。因此这个模型是简化了,但是如何调整参数,都是逼近拟合。用于不同的体系,螺旋扩展参数要微调,在大约0.125-0.142857这个范围。但微调后,细节目标位置也会有小的变化。

笔者将秦明螺旋用于拟合银河系,考虑了激光自然散射角作为参数,不仅可以解释总星系的分形迭代特征,同时发现拟合银河系中心黑洞的尺度与螺旋态也非常良好。

当然,不要急于否定或肯定这个模型的天文学意义。因为即便是韦伯,面对这种天文模型的尺度,眼神也依然不够用。好在,宇宙的事前面我已解决,且这是一个通用的决定性意义的简化模型,就是一把动态的分形迭代尺,你也可以用于别处,例如笔者用于炒股。

秦明分形迭代模型使用的重点是螺旋参数的确认,参数调整的越合理,拟合结果越逼近。

#python313,win10。‘’‘秦明分形迭代螺旋,引用请注明出处。’‘’

import vtk

import numpy as np

# 螺旋线参数方程

def spiral(t, R, a, b, n):

x = (R + a * np.cos(n * t)) * np.cos(t)

y = (R + a * np.cos(n * t)) * np.sin(t)

z = b * np.sin(n * t)

return x, y, z

# 创建点集

def create_spiral(R, a, b, n, num_points):

points = vtk.vtkPoints

for t in np.linspace(0, 2 * np.pi, num_points):

x, y, z = spiral(t, R, a, b, n)

points.InsertNextPoint(x, y, z)

return points

# 创建螺旋线的 PolyData

def create_spiral_polydata(points):

polydata = vtk.vtkPolyData

polydata.SetPoints(points)

lines = vtk.vtkCellArray

for i in range(points.GetNumberOfPoints - 1):

line = vtk.vtkLine

line.GetPointIds.SetId(0, i)

line.GetPointIds.SetId(1, i + 1)

lines.InsertNextCell(line)

polydata.SetLines(lines)

return polydata

# 创建红色螺旋线

R = 20.0 # 中心圆的半径

a = 1.0 # 螺旋线的径向偏移量

b = 1.0 # 螺旋线的上升速度(在z轴方向扩大一倍)

n = 7 # 螺旋线在中心圆上的圈数(7圈)

num_points = 10000 # 参数 t 的点数

red_spiral_points = create_spiral(R, a, b, n, num_points)

red_spiral_polydata = create_spiral_polydata(red_spiral_points)

# 创建黄色小螺旋线

# 小螺旋线的参数

a_small = 0.5 # 小螺旋线的径向偏移量

b_small = 0.5 # 小螺旋线的上升速度

n_small = 49 # 小螺旋线的圈数(两倍于中心螺旋线)

yellow_spiral_points = vtk.vtkPoints

for t in np.linspace(0, 2 * np.pi, num_points):

# 红色螺旋线的点

x_red, y_red, z_red = spiral(t, R, a, b, n)

# 黄色小螺旋线围绕红色螺旋线旋转

x_yellow = x_red + a_small * np.cos(n_small * t)

y_yellow = y_red + a_small * np.sin(n_small * t)

z_yellow = z_red + b_small * np.sin(n_small * t)

yellow_spiral_points.InsertNextPoint(x_yellow, y_yellow, z_yellow)

yellow_spiral_polydata = create_spiral_polydata(yellow_spiral_points)

# 创建 Mapper 和 Actor

red_spiral_mapper = vtk.vtkPolyDataMapper

red_spiral_mapper.SetInputData(red_spiral_polydata)

red_spiral_actor = vtk.vtkActor

red_spiral_actor.SetMapper(red_spiral_mapper)

red_spiral_actor.GetProperty.SetColor(1, 0, 0) # 设置红色螺旋线颜色

red_spiral_actor.GetProperty.SetLineWidth(2) # 设置红色螺旋线宽度

yellow_spiral_mapper = vtk.vtkPolyDataMapper

yellow_spiral_mapper.SetInputData(yellow_spiral_polydata)

yellow_spiral_actor = vtk.vtkActor

yellow_spiral_actor.SetMapper(yellow_spiral_mapper)

yellow_spiral_actor.GetProperty.SetColor(1, 1, 0) # 设置黄色小螺旋线颜色

yellow_spiral_actor.GetProperty.SetLineWidth(1) # 设置黄色小螺旋线宽度

# 创建三维坐标系

axes = vtk.vtkAxesActor

axes.SetTotalLength(10, 10, 20) # 设置坐标轴长度,z轴方向长度扩大一倍

axes.SetShaftTypeToCylinder # 设置坐标轴为圆柱形

axes.SetCylinderRadius(0.01) # 设置圆柱半径,比螺旋线粗一倍

axes.SetConeRadius(0.05) # 设置箭头半径

axes.GetXAxisCaptionActor2D.GetCaptionTextProperty.SetColor(0, 1, 0) # 设置X轴颜色

axes.GetYAxisCaptionActor2D.GetCaptionTextProperty.SetColor(0, 1, 0) # 设置Y轴颜色

axes.GetZAxisCaptionActor2D.GetCaptionTextProperty.SetColor(0, 1, 0) # 设置Z轴颜色

# 创建 xy 平面上的方格虚线网格

def create_grid_lines(x_range, y_range, step):

grid_lines = vtk.vtkAppendPolyData

for x in np.arange(x_range[0], x_range[1] + step, step):

line = vtk.vtkLineSource

line.SetPoint1(x, y_range[0], 0)

line.SetPoint2(x, y_range[1], 0)

line.Update

grid_lines.AddInputData(line.GetOutput)

for y in np.arange(y_range[0], y_range[1] + step, step):

line.SetPoint1(x_range[0], y, 0)

line.SetPoint2(x_range[1], y, 0)

line.Update

return grid_lines

# 设置网格范围和步长

x_range = (-20, 20)

y_range = (-20, 20)

step = 1.0

grid_lines = create_grid_lines(x_range, y_range, step)

grid_mapper = vtk.vtkPolyDataMapper

grid_mapper.SetInputConnection(grid_lines.GetOutputPort)

grid_actor = vtk.vtkActor

grid_actor.SetMapper(grid_mapper)

grid_actor.GetProperty.SetColor(0.5, 0.5, 0.5) # 设置网格颜色为灰色

grid_actor.GetProperty.SetLineWidth(1) # 设置网格线宽

grid_actor.GetProperty.SetLineStipplePattern(0xF0F0) # 设置虚线样式

# 创建螺旋中心线的圆

def create_center_circle(R, num_points):

circle_points = vtk.vtkPoints

for t in np.linspace(0, 2 * np.pi, num_points):

x = R * np.cos(t)

y = R * np.sin(t)

z = 0

circle_points.InsertNextPoint(x, y, z)

circle_lines = vtk.vtkCellArray

for i in range(num_points - 1):

line = vtk.vtkLine

line.GetPointIds.SetId(0, i)

line.GetPointIds.SetId(1, i + 1)

circle_lines.InsertNextCell(line)

circle_polydata = vtk.vtkPolyData

circle_polydata.SetPoints(circle_points)

circle_polydata.SetLines(circle_lines)

return circle_polydata

# 创建中心圆

num_points = 100

circle_polydata = create_center_circle(R, num_points)

circle_mapper = vtk.vtkPolyDataMapper

circle_mapper.SetInputData(circle_polydata)

circle_actor = vtk.vtkActor

circle_actor.SetMapper(circle_mapper)

circle_actor.GetProperty.SetColor(0, 0, 1) # 设置中心圆颜色为蓝色

circle_actor.GetProperty.SetLineWidth(2) # 设置中心圆线宽

circle_actor.GetProperty.SetLineStipplePattern(0xF0F0) # 设置虚线样式

# 创建 Renderer 和 RenderWindow

renderer = vtk.vtkRenderer

renderer.AddActor(red_spiral_actor)

renderer.AddActor(yellow_spiral_actor)

renderer.AddActor(grid_actor) # 添加网格

renderer.AddActor(circle_actor) # 添加中心圆

renderer.SetBackground(0.1, 0.2, 0.3) # 设置背景颜色

render_window = vtk.vtkRenderWindow

render_window.AddRenderer(renderer)

# 创建 RenderWindowInteractor

render_window_interactor = vtk.vtkRenderWindowInteractor

render_window_interactor.SetRenderWindow(render_window)

# 启动渲染和交互

render_window.Render

render_window_interactor.Start