Exemplo n.º 1
0
sat = Satellit1(intervall_duration=1, end_time=25)

####Resultate Plotten####

timespan = np.linspace(0, 25, 1000, endpoint=False)

#'echte kurve'##
t, p, s = curve_runge_kutta(timespan)
x_rk, y_rk = zip(*p)
x_rk = np.array(x_rk)
y_rk = np.array(y_rk)

plt.figure()
plt.title("Störungskorrektur Ordnung 1")
plot_nicely(x_rk[::50], y_rk[::50], 'g*', 'Exakt per Runge Kutta berechnet')
plot_nicely(sat.x, sat.y, 'r', 'Störungsapproximiert')
plot_nicely(curve_naive()[0], curve_naive()[1], 'b', 'Ohne Luftwiderstand')
plt.axis('equal')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.grid()
plt.savefig("figs/Ansatz2_Ordnung1_Curves.png")
plt.show()  ##bereits jetzt ist von auge kein fehler zu erkennen.

#Nur den Fehler plotten:
plt.figure()
plt.title("Fehler")
err_x = (x_rk - sat.x)
err_y = (y_rk - sat.y)
Exemplo n.º 2
0
import numpy as np
import matplotlib.pyplot as plt

from PlotAssistance import plot_error, plot_nicely
from Variables import r0x, r0y, v0x, v0y, m, k, g
from Curve_Calculation import curve_analytical, curve_naive, curve_runge_kutta

#############Runge Simulator Plotten und Vergleichen mit alten Resultaten##################
###########################################################################################
t, p, s = curve_runge_kutta()
x_rk, y_rk = zip(*p)

plt.figure()

x_math, y_math = curve_naive()
plot_nicely(x_math, y_math, 'b', "Ohne Luftwiderstand")

x_real, y_real = curve_analytical()
plot_nicely(x_real, y_real, 'g', "Analytische Lösung")

plot_nicely(x_rk, y_rk, 'r', 'RungeKutta 4. Ordn.')

plt.axis('equal')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.grid()
plt.show()

##################Geschwindigkeit in längerem Bereich anschauen##############################
################################################################################?#############
sat = Satellit1t(intervall_duration=1, end_time = 25)
    
####Resultate Plotten####

timespan = np.linspace(0,25,1000, endpoint=False)

#'echte kurve'##
t, p, s = curve_runge_kutta(timespan)
x_rk, y_rk = zip(*p)
x_rk = np.array(x_rk)
y_rk = np.array(y_rk)

plt.figure()
plt.title("Störungskorrektur Ordnung 1, Taylor")
plot_nicely(x_rk[::5], y_rk[::5], 'g*', 'Exakt per Runge Kutta berechnet')
plot_nicely(sat.x, sat.y, 'r', 'Störungsapproximiert')
#plot_nicely(curve_naive()[0], curve_naive()[1], 'b', 'Ohne Luftwiderstand')
#plt.axis('equal')
plt.xlim(200,500)
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.grid()
plt.savefig("figs/Ansatz3_Ordnung1_Taylor_Curves.png")
plt.show() ##bereits jetzt ist von auge kein fehler zu erkennen.


#Nur den Fehler plotten:
plt.figure()
plt.title("Fehler Ordnung 1, Taylor interpoliert, Intervalllänge 1")
    So geht es sauber auf mit den Indexes.
    Diese Werte sind auch als Defaults gsetzt bei den einzelnen Funktionen.
"""

import numpy as np
import matplotlib.pyplot as plt

from PlotAssistance import plot_error, plot_nicely
from Variables import r0x, r0y, v0x, v0y, m, k, g
from Curve_Calculation import curve_analytical, curve_naive, curve_runge_kutta

##Vortragsplot##
plt.figure()
plt.title("Flugbahn")
x_naive, y_naive = curve_naive()
plot_nicely(x_naive, y_naive, 'b', "Ohne Luftwiderstand")
plt.axis('equal')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.grid()
plt.savefig("figs/Ansatz1_Just_Naive.png")
plt.show()

########################Reguläre Bahnen plotten##################
#################################################################

plt.figure()
plt.title("Flugbahnen")
x_naive, y_naive = curve_naive()
plot_nicely(x_naive, y_naive, 'b', "Ohne Luftwiderstand")
Exemplo n.º 5
0
sat = Satellit1(intervall_duration=1, end_time=25)

####Resultate Plotten####

timespan = np.linspace(0, 25, 1000, endpoint=False)

#'echte kurve'##
t, p, s = curve_runge_kutta(timespan)
x_rk, y_rk = zip(*p)
x_rk = np.array(x_rk)
y_rk = np.array(y_rk)

plt.figure()
plt.title("Störungskorrektur Ordnung 1, linear interpoliert")
plot_nicely(x_rk[::50], y_rk[::50], 'g*', 'Exakt per Runge Kutta berechnet')
plt.plot(sat.x, sat.y, 'r', 'Störungsapproximiert')
#plot_nicely(curve_naive()[0], curve_naive()[1], 'b', 'Ohne Luftwiderstand')
plt.axis('equal')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.grid()
plt.savefig("figs/Ansatz3_Ordnung1_Linear_Curves.png")
plt.show()  ##bereits jetzt ist von auge kein fehler zu erkennen.

#Nur den Fehler plotten:
plt.figure()
plt.title("Fehler Ordnung 1, linear interpoliert, Intervalllänge 1s")
err_x = (x_rk - sat.x)
err_y = (y_rk - sat.y)
Exemplo n.º 6
0
"""

import numpy as np
import matplotlib.pyplot as plt

from PlotAssistance import plot_error, plot_nicely
from Variables import r0x, r0y, v0x, v0y, m, k, g
from Curve_Calculation import curve_analytical, curve_naive

########################Reguläre Bahnen plotten##################
#################################################################

plt.figure()

x_naive, y_naive = curve_naive()
plot_nicely(x_naive, y_naive, 'b', "Ohne Luftwiderstand")

x_analytical, y_analytical = curve_analytical()
plot_nicely(x_analytical, y_analytical, 'r', "Mit Luftwiderstand")

plt.axis('equal')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.grid()
plt.show()

#########################Lineare Störungskorrektur#####################
#######################################################################

#Initial Values for t=0 - nothing to correct, no correcetion factors