1
def datos_velocidad_turbohelice(incremento):
    velocidadInicial = 181.3566
    aceleraciónInicial = 3 - 0.000062 *(velocidadInicial**2)
    print('Tiempo   '+ 'Velocidad(m/s)   '+ 'Aceleracion(m/s**2) '+'\n')
    print ('0       '+ str(velocidadInicial) + str(aceleraciónInicial))
    tiempo=incremento
    while tiempo <= 130:
     velocidadIncremento= (0.00001(tiempo**3)) - (0.00488(tiempo**2)) + (0.75795(tiempo)) + 181.3566
     aceleracionIncremento= 3 - (0.000062 *(velocidadIncremento**2)
     print (str(tiempo)+str(velocidadIncremento)+str(aceleracionIncremento))
     tiempo+= incremento
datos_velocidad_turbohelice(20)

my question is where is the error? it says print (str(tiempo)+str(velocidadIncremento)+str(aceleracionIncremento))
^
SyntaxError: invalid syntax

2
  • Not sure why it would point to that line, but two lines above there are errors: by 0.00001(...) I suppose you mean 0.00001 * (...), etc. Commented Feb 8, 2019 at 21:27
  • it points the t in print im sorry for that Commented Feb 8, 2019 at 21:30

2 Answers 2

1

You have a few errors here.

For one, the SyntaxError you are initially describing impacting this line, (str(tiempo)+str(velocidadIncremento)+str(aceleracionIncremento)) is not actually involving this line but rather the line above it, aceleracionIncremento= 3 - (0.000062 *(velocidadIncremento**2); you are missing a closing parenthesis there at the end.

Once you fix this error you will encounter another error (a TypeError) stating that the 'float' object is not callable, to which you will need to address by fixing this line velocidadIncremento=(0.00001*(tiempo**3)) - (0.00488*(tiempo**2)) + (0.75795*(tiempo)) + 181.3566 by adding an * operator to multiply the 0.75795 by tiempo. This should fix the code.

Full fix below.

#!/usr/bin/env python3

def datos_velocidad_turbohelice(incremento):
    velocidadInicial = 181.3566
    aceleracionInicial = 3 - 0.000062 *(velocidadInicial**2)
    print('Tiempo   '+ 'Velocidad(m/s)   '+ 'Aceleracion(m/s**2) '+'\n')
    print('0       '+ str(velocidadInicial) + str(aceleracionInicial))
    tiempo=incremento
    while tiempo <= 130:
     velocidadIncremento=(0.00001*(tiempo**3)) - (0.00488*(tiempo**2)) + (0.75795*(tiempo)) + 181.3566
     aceleracionIncremento= 3 - (0.000062 *(velocidadIncremento**2))
     print(str(tiempo)+str(velocidadIncremento)+str(aceleracionIncremento))
     tiempo+= incremento
datos_velocidad_turbohelice(20)

Output:

Tiempo   Velocidad(m/s)   Aceleracion(m/s**2)

0       181.35660.960806585459
20194.64360.6510598767
40204.50660.406977134499
60211.42560.228551371208
80215.88060.110525125706
100218.35160.0439998842013
120219.31860.0177598050305
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot . I noticed after a while.
0

You have several syntax error in line number 8 and 9. You need to add * before the brackets and in line number 9 you added an extra bracket which you did not close.

 velocidadIncremento= (0.00001*(tiempo**3)) - (0.00488*(tiempo**2)) + (0.75795*(tiempo)) + 181.3566
 aceleracionIncremento= 3 - 0.000062 *(velocidadIncremento**2)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.