Skip to content

Commit

Permalink
Nova versão: exponenciação entre medidas funcionando (issue #7)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjvnq committed Apr 8, 2019
1 parent 4645175 commit 166aeb1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion LabIFSC/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__author__ = "Gabriel Queiroz"
__credits__ = ["gabriel Queiroz", "Pedro Ilídio"]
__license__ = "MIT"
__version__ = "0.1.8"
__version__ = "0.1.9"
__email__ = "[email protected]"
__status__ = "Production"

Expand Down
19 changes: 10 additions & 9 deletions LabIFSC/medida.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,18 @@ def __pow__(self, outro):

A = self.nominal
B = outro.nominal
σA = self.incerteza
σB = outro.incerteza
σAB = σA*σB # Não tenho certeza se esse valor está certo
# s = σ
sA = self.incerteza
sB = outro.incerteza
sAB = sA*sB # Não tenho certeza se esse valor está certo

f = self.nominal ** outro.nominal
σf = 0
σf += ((B/A)*σA)**2
σf += (math.log(A)*σB)**2
σf += 2*B*math.log(A)*σAB/A
σf = math.fabs(f)*math.sqrt(σf)
return Medida((f, σf), unidades)
sf = 0
sf += ((B/A)*sA)**2
sf += (math.log(A)*sB)**2
sf += 2*B*math.log(A)*sAB/A
sf = math.fabs(f)*math.sqrt(sf)
return Medida((f, sf), unidades)

def __abs__(self):
m = Medida((abs(self.nominal), self.incerteza), self.unidades_originais)
Expand Down

0 comments on commit 166aeb1

Please sign in to comment.