mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
tests/misc/rge_sm.py: Remove unused code from the test.
This cleans up the test to remove all unused code, making it smaller, a bit faster to deploy to a target to run, and also use less RAM on the target (which may help it run on targets that are just slightly out of memory running it). Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -39,14 +39,6 @@ class RungeKutta(object):
|
||||
if not self.iterate():
|
||||
break
|
||||
|
||||
def solveNSteps(self, nSteps):
|
||||
for i in range(nSteps):
|
||||
if not self.iterate():
|
||||
break
|
||||
|
||||
def series(self):
|
||||
return zip(*self.Trajectory)
|
||||
|
||||
|
||||
# 1-loop RGES for the main parameters of the SM
|
||||
# couplings are: g1, g2, g3 of U(1), SU(2), SU(3); yt (top Yukawa), lambda (Higgs quartic)
|
||||
@@ -79,45 +71,6 @@ sysSM = (
|
||||
)
|
||||
|
||||
|
||||
def drange(start, stop, step):
|
||||
r = start
|
||||
while r < stop:
|
||||
yield r
|
||||
r += step
|
||||
|
||||
|
||||
def phaseDiagram(system, trajStart, trajPlot, h=0.1, tend=1.0, range=1.0):
|
||||
tstart = 0.0
|
||||
for i in drange(0, range, 0.1 * range):
|
||||
for j in drange(0, range, 0.1 * range):
|
||||
rk = RungeKutta(system, trajStart(i, j), tstart, h)
|
||||
rk.solve(tend)
|
||||
# draw the line
|
||||
for tr in rk.Trajectory:
|
||||
x, y = trajPlot(tr)
|
||||
print(x, y)
|
||||
print()
|
||||
# draw the arrow
|
||||
continue
|
||||
l = (len(rk.Trajectory) - 1) / 3
|
||||
if l > 0 and 2 * l < len(rk.Trajectory):
|
||||
p1 = rk.Trajectory[l]
|
||||
p2 = rk.Trajectory[2 * l]
|
||||
x1, y1 = trajPlot(p1)
|
||||
x2, y2 = trajPlot(p2)
|
||||
dx = -0.5 * (y2 - y1) # orthogonal to line
|
||||
dy = 0.5 * (x2 - x1) # orthogonal to line
|
||||
# l = math.sqrt(dx*dx + dy*dy)
|
||||
# if abs(l) > 1e-3:
|
||||
# l = 0.1 / l
|
||||
# dx *= l
|
||||
# dy *= l
|
||||
print(x1 + dx, y1 + dy)
|
||||
print(x2, y2)
|
||||
print(x1 - dx, y1 - dy)
|
||||
print()
|
||||
|
||||
|
||||
def singleTraj(system, trajStart, h=0.02, tend=1.0):
|
||||
is_REPR_C = float("1.0000001") == float("1.0")
|
||||
tstart = 0.0
|
||||
@@ -141,7 +94,5 @@ def singleTraj(system, trajStart, h=0.02, tend=1.0):
|
||||
print(tr_str)
|
||||
|
||||
|
||||
# phaseDiagram(sysSM, (lambda i, j: [0.354, 0.654, 1.278, 0.8 + 0.2 * i, 0.1 + 0.1 * j]), (lambda a: (a[4], a[5])), h=0.1, tend=math.log(10**17))
|
||||
|
||||
# initial conditions at M_Z
|
||||
singleTraj(sysSM, [0.354, 0.654, 1.278, 0.983, 0.131], h=0.5, tend=math.log(10**17)) # true values
|
||||
|
||||
Reference in New Issue
Block a user