Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import numpy as np
- import csv
- #Array dos Dados
- x = []
- y = []
- #Tipo da linha
- ls = 'none'
- #Barra de Erro:
- xerro = 1/120
- yerro = 0
- #Equação do PG doido
- Yo = 0
- t =
- g = g
- c =
- lyt = Yo - (g/c**2) + ((g*t)/c) + ((g*c)/c**2)
- #Pegar dados de um arquivo no pc, lembrem de colocar o path certo
- #with open('quedap8.txt','r') as csvfile:
- plots = csv.reader(csvfile, delimiter=',')
- for row in plots:
- x.append(float(row[0]))
- y.append(float(row[1]))
- a, b = 0, 0
- dx = 0.01
- #Plot
- while t <= 10:
- x.append(float(a))
- lyt = Yo - (g/c**2) + ((g*t)/c) + ((g*c)/c**2)
- y.append(float(lyt))
- a += dx
- plt.scatter(x,y, label='Pontos')
- #plt.errorbar(x, y, xerr=xerro, yerr=yerro, linestyle=ls)
- plt.xlabel('x')
- plt.ylabel('y')
- plt.title('Grafico')
- plt.legend()
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement