versnelling

Moderator: physicalattraction

Gebruikersavatar
Berichten: 2.333

Re: versnelling

Die formule is juist. Ik heb dezelfde gebruikt. Ik denk dat het in mijn afgeleide zit ofzo. Ik heb mijn code nog niet uitvoerig getest.

Gebruikersavatar
Berichten: 2.333

Re: versnelling

Ongeveer hetzelfde nu. Er zat een foutje in mijn tweede afgeleide.


Afstand van A tot B 46.36507977299504
Afstand van B tot C 128.63492022700495
Tijd van B tot C 7.19513057526426
Snelheid bij C 20.756104460211407
Kromtestraal bij C 416.905988408713
a centripetaal bij C 1.03336455781695
a bij C 1.30684440900676


Code: Selecteer alles

from scipy.optimize import root_scalar
from scipy.misc import derivative
from sympy import *
from sympy.abc import x, c
from sympy import *
from scipy import integrate

sol = root_scalar(lambda x: 30-(x**3)/250000-5*(cos(0.05*x)), x0=205, bracket = [200,210])
xa = sol.root

def df(x):
    return derivative(lambda x: 30-(x**3)/250000-5*(cos(0.05*x)),x, n = 1, dx = 0.01)

def ddf(x):
    return derivative(lambda x: 30-(x**3)/250000-5*(cos(0.05*x)),x, n = 2, dx = 0.01)


def fbooglengte(a):
    return integrate.quad(lambda x: (1+(-3*(x**2)/250000 + 0.25*(sin(0.05*x)))**2)**(0.5), a, xa)[0]

sol = root_scalar(lambda x: fbooglengte(x)-175, x0=35, bracket = [30,40])
xc = sol.root

afstandab = integrate.quad(lambda x: (1+(-3*(x**2)/250000 + 0.25*(sin(0.05*x)))**2)**(0.5), 160, xa)[0]

print(f"Afstand van A tot B {afstandab}" )

afstandcb = 175 - afstandab

print(f"Afstand van B tot C {afstandcb}" )


sol = root_scalar(lambda t: 15*t+ 0.4*t**2-afstandcb, x0=35, bracket = [5,10])
tijdbc = sol.root

print(f"Tijd van B tot C {tijdbc}" )

vc = 15 + 0.8*tijdbc

print(f"Snelheid bij C {vc}" )

kromtestraal = abs(((1+df(xc)**2)**1.5 / ddf(xc)))

print(f"Kromtestraal bij C {kromtestraal}")

acent = (vc**2)/kromtestraal
print(f"a centripetaal bij C {acent}")

atot = (0.8**2 + acent**2 )**0.5
print(f"a bij C {atot}")

Reageer