import vpython as vpy import math vpy.scene.width = 1920 vpy.scene.height = 1080 class Body: #planet/trabant def __init__(self, name, radius, position, winkelgeschwindigkeit, exzentrizitaet, grossehalbachse, objekt): #(mass) self.name = name #self.mass = masse self.rad = radius #self.geschwindigkeit = geschwindigkeit, verworfen fuer Winkelgeschwindigkeit self.pos = position self.angularv = winkelgeschwindigkeit #mean angular velocity self.ecc = exzentrizitaet self.axis = grossehalbachse self.ob = objekt # a: Große Halbachse # ε: Exzentrizität # ω: Winkelgeschwindigkeit # name, masse[kg], radius[m], position/anfangs der Abstand zur Sonne[m] def InverseKepler(f, f1, x0, d=5): #general Newton-Method for non-linear equations, used specifically to solve the Kepler-Equation with f1 = f' = df/dx ∀x for i in range(d): x0 = x0-(f(x0)/f1(x0)) return x0 class Viewer: def __init__(self, himmelskoerper_liste): self.himmelskoerper_liste = himmelskoerper_liste def visualize(self, scale = 50): #scaling changes distance between objects, but maintains object size global tags tags = [] for i in range(len(self.himmelskoerper_liste)): var = self.himmelskoerper_liste[i].pos/self.himmelskoerper_liste[1].pos print(var, type(var)) self.himmelskoerper_liste[i].ob = vpy.sphere(pos=vpy.vector(self.himmelskoerper_liste[i].pos,0,0), radius = scale* self.himmelskoerper_liste[i].rad, make_trail=True, retain = var*125+1, trail_color=Colours[i], texture=Skins[i]) #colour, retain/value, texture add seperately for specific object tags.append(vpy.label(pos = self.himmelskoerper_liste[i].ob.pos, text = self.himmelskoerper_liste[i].name, yoffset = 5, line = False, box = False, opacity = 0)) def update(self, Tges, scale = 50): #Tges in Seconds for i in range(len(self.himmelskoerper_liste)): e, v, a = self.himmelskoerper_liste[i].ecc, self.himmelskoerper_liste[i].angularv, self.himmelskoerper_liste[i].axis M = v * Tges # M = mean anomaly def f(x): return x-e*math.sin(x)-M #Kepler Equation def f1(x): return 1-e*math.cos(x) #derivative of Kepler Equation E = InverseKepler(f, f1, 1) # E = eccentric anomaly θ = 2*math.atan(math.sqrt((1+e)/(1-e))*math.tan(E/2)) # θ = real anomaly r = (a*(1-e**2))/(1+e*math.cos(θ)) # r = euclidean distance to center object self.himmelskoerper_liste[i].ob.pos = r*vpy.vector(math.cos(θ), math.sin(θ), 0) tags[i].pos = self.himmelskoerper_liste[i].ob.pos #List excerpt not part of main() Sonne = Body ("Sun", 696342E3, 0, 0, 0, 0, "") #mass = 1.9884E30 kg Merkur = Body ("Mercury", 2440E3, 46E9, 8.266757558468652e-07, 0.20563069, 57909E6, "") #mass = 0.33E24 kg Venus = Body ("Venus", 6052E3, 107.5E9, 3.2363949047127294e-07, 0.00677323, 108209E6, "") #mass = 4.8685E24 kg Erde = Body ("Earth", 6378E3, 147.1E9, 1.991021277657232e-07, 0.01671022, 149598E6, "") #mass = 5.9737E24 kg Mars = Body ("Mars", 3397E3, 206.7E9, 1.0585766107031914e-07, 0.09341233, 227937E6, "") #mass = 0.64185E24 kg Jupiter = Body ("Jupiter", 71493E3,740.7E9, 1.678399979816619e-08, 0.04839266, 778412E6, "") #mass = 1898.7E24 kg Saturn = Body ("Saturn", 60267E3, 1349.8E9, 6.761257875481413e-09, 0.05415060, 1426725E6, "") #mass = 568.51E24 kg Uranus = Body ("Uranus", 25559E3, 2735E9, 2.369788170407197e-09, 0.04716771, 2870972E6, "") #mass = 86.849E24 kg Neptun = Body ("Neptune", 24764E3,4459.8E9, 1.20820761533874e-09, 0.00858587, 4498253E6, "") #mass = 102.44E24 kg Colours = [vpy.color.black, vpy.color.white, vpy.color.magenta, vpy.color.green, vpy.color.red, vpy.color.orange, vpy.color.yellow, vpy.color.cyan, vpy.color.blue] Skins = ["https://i.imgur.com/XdRTvzj.jpg", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/e0763947-6f42-4d09-944f-c2d6f41c415b/dcaig77-18800e1e-24aa-43e5-9dd0-3dff9bcf8d0c.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvZTA3NjM5NDctNmY0Mi00ZDA5LTk0NGYtYzJkNmY0MWM0MTViXC9kY2FpZzc3LTE4ODAwZTFlLTI0YWEtNDNlNS05ZGQwLTNkZmY5YmNmOGQwYy5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.vigtUwmhB5u_KrjxZcgE04UH7OoC16HyLTD5pulA4OA", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/90ad8232-4e09-4675-b9e7-bc2898960870/dc0ss1u-9ce1cbd0-6f56-4bb1-ab24-e64089914504.png/v1/fill/w_1024,h_512,q_80,strp/venus_cloud_texture_map_by_jcpag2010_dc0ss1u-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3siaGVpZ2h0IjoiPD01MTIiLCJwYXRoIjoiXC9mXC85MGFkODIzMi00ZTA5LTQ2NzUtYjllNy1iYzI4OTg5NjA4NzBcL2RjMHNzMXUtOWNlMWNiZDAtNmY1Ni00YmIxLWFiMjQtZTY0MDg5OTE0NTA0LnBuZyIsIndpZHRoIjoiPD0xMDI0In1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmltYWdlLm9wZXJhdGlvbnMiXX0.5Q0wcthS2JaVk3qEWsKsh_6zmmCcL7j6uiaXAGJnoLY",vpy.textures.earth, "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/6e527eb9-99dc-4554-9ea2-dd0e84e79860/dckiu8c-727ad23f-7760-42f2-9669-aa2de0f3c832.png?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvNmU1MjdlYjktOTlkYy00NTU0LTllYTItZGQwZTg0ZTc5ODYwXC9kY2tpdThjLTcyN2FkMjNmLTc3NjAtNDJmMi05NjY5LWFhMmRlMGYzYzgzMi5wbmcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.4w-Xl7_hjAtdYK2z9zk0nhkWpa38FMStpsO177zrOJw", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/58d3c051-62a0-4471-818b-b9b92759d6b6/db6is8m-065c1dbf-d125-4729-a015-f79553c16bf9.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvNThkM2MwNTEtNjJhMC00NDcxLTgxOGItYjliOTI3NTlkNmI2XC9kYjZpczhtLTA2NWMxZGJmLWQxMjUtNDcyOS1hMDE1LWY3OTU1M2MxNmJmOS5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.lYxq2GPyUQyWVogIVdRYiJvPzlVsYkDaRHXUwYjRxF4", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/e0763947-6f42-4d09-944f-c2d6f41c415b/dcaift0-422ad564-f7b0-4291-914f-425b9ac29a35.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvZTA3NjM5NDctNmY0Mi00ZDA5LTk0NGYtYzJkNmY0MWM0MTViXC9kY2FpZnQwLTQyMmFkNTY0LWY3YjAtNDI5MS05MTRmLTQyNWI5YWMyOWEzNS5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.REEY4eftTjq2duJpeXgsJ5QaAU7dFnCUwojV9Ez2XS0", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/90ad8232-4e09-4675-b9e7-bc2898960870/dc0ss0c-aa6fd748-5785-41ec-9b6e-00356bf444c7.png/v1/fill/w_1024,h_512,q_80,strp/uranus_texture_map_by_jcpag2010_dc0ss0c-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3siaGVpZ2h0IjoiPD01MTIiLCJwYXRoIjoiXC9mXC85MGFkODIzMi00ZTA5LTQ2NzUtYjllNy1iYzI4OTg5NjA4NzBcL2RjMHNzMGMtYWE2ZmQ3NDgtNTc4NS00MWVjLTliNmUtMDAzNTZiZjQ0NGM3LnBuZyIsIndpZHRoIjoiPD0xMDI0In1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmltYWdlLm9wZXJhdGlvbnMiXX0.cz2NsO66AT-KlAIOvDYkXXpZ7SgFiuSg1bRgPjaTiCo", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/e0763947-6f42-4d09-944f-c2d6f41c415b/dcaifld-8408b286-dfb4-4b94-9d36-029c36cc636f.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvZTA3NjM5NDctNmY0Mi00ZDA5LTk0NGYtYzJkNmY0MWM0MTViXC9kY2FpZmxkLTg0MDhiMjg2LWRmYjQtNGI5NC05ZDM2LTAyOWMzNmNjNjM2Zi5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.K_9vTX6VPK01nodrwD3YztdaOG9VpBXA8_qlkHQ9Tk0"] SolarSys = [Sonne, Merkur, Venus, Erde, Mars, Jupiter, Saturn, Uranus, Neptun] #main() Tges = 60 #minute intervals ViewSol = Viewer(SolarSys) ViewSol.visualize() while True: ViewSol.update(Tges) Tges += 60
import vpython as vpy import math vpy.scene.width = 1920 vpy.scene.height = 1080 class Body: #planet/trabant def __init__(self, name, radius, masse, position, geschwindigkeit, objekt): #(mass) self.name = name self.rad = radius self.mass = masse self.pos = position self.v = geschwindigkeit #self.angularv = winkelgeschwindigkeit #mean angular velocity #self.ecc = exzentrizitaet #self.axis = grossehalbachse self.ob = objekt # a: Große Halbachse # ε: Exzentrizität # ω: Winkelgeschwindigkeit # name, masse[kg], radius[m], position/anfangs der Abstand zur Sonne[m] def leapfrog(x0, v0, a, dt = 60): #dt sets the time intervall per iteration (in seconds) v0 = v0 + a*dt*1/2 x0 = x0 + v0*dt v0 = v0 + a*dt return x0, v0 class Viewer: def __init__(self, himmelskoerper_liste): self.himmelskoerper_liste = himmelskoerper_liste def visualize(self, scale = 100): #scaling changes object size, but maintains distances between objects global tags tags = [] for i in range(len(self.himmelskoerper_liste)): #var = self.himmelskoerper_liste[i].pos.x/self.himmelskoerper_liste[1].pos.x | tried to make trail length dependent on major semi-axis #print(var, type(var)) self.himmelskoerper_liste[i].ob = vpy.sphere(pos=vpy.vector(self.himmelskoerper_liste[i].pos), radius = scale * self.himmelskoerper_liste[i].rad, make_trail=True, retain = 100000, trail_color=Colours[i], texture=Skins[i]) #colour, retain/value, texture add seperately for specific object tags.append(vpy.label(pos = self.himmelskoerper_liste[i].ob.pos, text = self.himmelskoerper_liste[i].name, yoffset = 5, line = False, box = False, opacity = 0)) def update(self): G = 6.67430E-11 #gravity constant M, X = [], [] #M = list of masses, X = list of positions for i in range(len(self.himmelskoerper_liste)): M.append(self.himmelskoerper_liste[i].mass) X.append(self.himmelskoerper_liste[i].ob.pos) for i in range(len(self.himmelskoerper_liste)): a = vpy.vector(0,0,0) #a = acceleration for j in range(1,len(self.himmelskoerper_liste)): i2 = (i+j) % len(self.himmelskoerper_liste) a += G * M[i2]*(X[i2]-X[i])*1/(((X[i2]-X[i]).mag**3)) #print(X[i], self.himmelskoerper_liste[i].v) #print(leapfrog(X[i], self.himmelskoerper_liste[i].v, a)) self.himmelskoerper_liste[i].ob.pos = leapfrog(X[i], self.himmelskoerper_liste[i].v, a)[0] self.himmelskoerper_liste[i].v = leapfrog(X[i], self.himmelskoerper_liste[i].v, a)[1] tags[i].pos = self.himmelskoerper_liste[i].ob.pos #List excerpt not part of main() Sonne = Body ("Sun", 0.5*696342E3, 1.9884E30, vpy.vector(0,0,0), vpy.vector(0,0,0), "") #Sun radius scaled seperately Merkur = Body ("Mercury", 2440E3, 0.33E24, vpy.vector(57909E6,0,0), vpy.vector(0, 47.8725E3,0), "") Venus = Body ("Venus", 6052E3, 4.8685E24, vpy.vector(108209E6,0,0), vpy.vector(0, -35.0214E3,0), "") Erde = Body ("Earth", 6378E3, 5.9737E24, vpy.vector(149598E6,0,0), vpy.vector(0, 29.7859E3,0), "") Mars = Body ("Mars", 3397E3, 0.64185E24, vpy.vector(227937E6,0,0), vpy.vector(0, -24.1309E3,0), "") Jupiter = Body ("Jupiter", 71493E3, 1898.7E24, vpy.vector(778412E6,0,0), vpy.vector(0, 13.0697E3,0), "") Saturn = Body ("Saturn", 60267E3, 568.51E24, vpy.vector(1426725E6,0,0), vpy.vector(0, -9.6724E3,0), "") Uranus = Body ("Uranus", 25559E3, 86.849E24, vpy.vector(2870972E6,0,0), vpy.vector(0, 6.8352E3,0), "") Neptun = Body ("Neptune", 24764E3, 102.44E24, vpy.vector(4498253E6,0,0), vpy.vector(0, -5.4778E3,0), "") Colours = [vpy.color.black, vpy.color.white, vpy.color.magenta, vpy.color.green, vpy.color.red, vpy.color.orange, vpy.color.yellow, vpy.color.cyan, vpy.color.blue] Skins = ["https://i.imgur.com/XdRTvzj.jpg", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/e0763947-6f42-4d09-944f-c2d6f41c415b/dcaig77-18800e1e-24aa-43e5-9dd0-3dff9bcf8d0c.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvZTA3NjM5NDctNmY0Mi00ZDA5LTk0NGYtYzJkNmY0MWM0MTViXC9kY2FpZzc3LTE4ODAwZTFlLTI0YWEtNDNlNS05ZGQwLTNkZmY5YmNmOGQwYy5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.vigtUwmhB5u_KrjxZcgE04UH7OoC16HyLTD5pulA4OA", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/90ad8232-4e09-4675-b9e7-bc2898960870/dc0ss1u-9ce1cbd0-6f56-4bb1-ab24-e64089914504.png/v1/fill/w_1024,h_512,q_80,strp/venus_cloud_texture_map_by_jcpag2010_dc0ss1u-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3siaGVpZ2h0IjoiPD01MTIiLCJwYXRoIjoiXC9mXC85MGFkODIzMi00ZTA5LTQ2NzUtYjllNy1iYzI4OTg5NjA4NzBcL2RjMHNzMXUtOWNlMWNiZDAtNmY1Ni00YmIxLWFiMjQtZTY0MDg5OTE0NTA0LnBuZyIsIndpZHRoIjoiPD0xMDI0In1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmltYWdlLm9wZXJhdGlvbnMiXX0.5Q0wcthS2JaVk3qEWsKsh_6zmmCcL7j6uiaXAGJnoLY",vpy.textures.earth, "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/6e527eb9-99dc-4554-9ea2-dd0e84e79860/dckiu8c-727ad23f-7760-42f2-9669-aa2de0f3c832.png?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvNmU1MjdlYjktOTlkYy00NTU0LTllYTItZGQwZTg0ZTc5ODYwXC9kY2tpdThjLTcyN2FkMjNmLTc3NjAtNDJmMi05NjY5LWFhMmRlMGYzYzgzMi5wbmcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.4w-Xl7_hjAtdYK2z9zk0nhkWpa38FMStpsO177zrOJw", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/58d3c051-62a0-4471-818b-b9b92759d6b6/db6is8m-065c1dbf-d125-4729-a015-f79553c16bf9.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvNThkM2MwNTEtNjJhMC00NDcxLTgxOGItYjliOTI3NTlkNmI2XC9kYjZpczhtLTA2NWMxZGJmLWQxMjUtNDcyOS1hMDE1LWY3OTU1M2MxNmJmOS5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.lYxq2GPyUQyWVogIVdRYiJvPzlVsYkDaRHXUwYjRxF4", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/e0763947-6f42-4d09-944f-c2d6f41c415b/dcaift0-422ad564-f7b0-4291-914f-425b9ac29a35.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvZTA3NjM5NDctNmY0Mi00ZDA5LTk0NGYtYzJkNmY0MWM0MTViXC9kY2FpZnQwLTQyMmFkNTY0LWY3YjAtNDI5MS05MTRmLTQyNWI5YWMyOWEzNS5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.REEY4eftTjq2duJpeXgsJ5QaAU7dFnCUwojV9Ez2XS0", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/90ad8232-4e09-4675-b9e7-bc2898960870/dc0ss0c-aa6fd748-5785-41ec-9b6e-00356bf444c7.png/v1/fill/w_1024,h_512,q_80,strp/uranus_texture_map_by_jcpag2010_dc0ss0c-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3siaGVpZ2h0IjoiPD01MTIiLCJwYXRoIjoiXC9mXC85MGFkODIzMi00ZTA5LTQ2NzUtYjllNy1iYzI4OTg5NjA4NzBcL2RjMHNzMGMtYWE2ZmQ3NDgtNTc4NS00MWVjLTliNmUtMDAzNTZiZjQ0NGM3LnBuZyIsIndpZHRoIjoiPD0xMDI0In1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmltYWdlLm9wZXJhdGlvbnMiXX0.cz2NsO66AT-KlAIOvDYkXXpZ7SgFiuSg1bRgPjaTiCo", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/e0763947-6f42-4d09-944f-c2d6f41c415b/dcaifld-8408b286-dfb4-4b94-9d36-029c36cc636f.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvZTA3NjM5NDctNmY0Mi00ZDA5LTk0NGYtYzJkNmY0MWM0MTViXC9kY2FpZmxkLTg0MDhiMjg2LWRmYjQtNGI5NC05ZDM2LTAyOWMzNmNjNjM2Zi5qcGcifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.K_9vTX6VPK01nodrwD3YztdaOG9VpBXA8_qlkHQ9Tk0"] SolarSys = [Sonne, Merkur, Venus, Erde, Mars, Jupiter, Saturn, Uranus, Neptun] #main() ViewSol = Viewer(SolarSys) ViewSol.visualize() while True: ViewSol.update()