<jupyter_start><jupyter_text>Resolução da Lista 2 complemento e solução das equações--- <NAME> - 119111128 ---<jupyter_code>from sympy import solve, Eq, symbols
import numpy as np<jupyter_output><empty_output><jupyter_text>Utilizando o método das tensões de nós<jupyter_code>v1, v2, v3, v4 = symbols("v1 v2 v3 v4")

eq1 = Eq(30*v1 + 2*v2 - 3*v3 - 2*v4, 135)
eq2 = Eq(25*v1 + 3*v4, 225)
eq3 = Eq(9*v1 - 14*v2 + 5*v4, 0)
eq4 = Eq(v3 - v4, 5)

soluc = solve((eq1, eq2, eq3, eq4), dict=True)

v1 = np.array([sol[v1] for sol in soluc])
v2 = np.array([sol[v2] for sol in soluc]) 
v3 = np.array([sol[v3] for sol in soluc]) 
v4 = np.array([sol[v4] for sol in soluc])



print("v1 = ", float(v1))
print("v2 = ", float(v2))
print("v3 = ", float(v3))
print("v4 = ", float(v4))<jupyter_output>v1 =  7.036247334754798
v2 =  10.367803837953092
v3 =  21.36460554371002
v4 =  16.36460554371002<jupyter_text>Para as tensões Va, Vb e Vc<jupyter_code>va = float(v1)
vb = float(v2 - v3)
vc = float(v1 - v3)
print("va = {}\nvb = {}\nvc = {}".format(va, vb, vc))<jupyter_output>va = 7.036247334754798
vb = -10.99680170575693
vc = -14.328358208955224<jupyter_text>Pelo método das correntes de malha<jupyter_code>i1, i2, i3, i4 = symbols("i1, i2, i3, i4")

eq1 = Eq(2*i1 + 3*(i1-i2), 15)
eq2 = Eq(10*i2-3*(i1-i2)+5*(i2-i3)+9*(i2-i3), 0)
eq3 = Eq(-9*(i2-i3)-5*(i2-i3) +6*i4 + 5, 0)
eq4 = Eq(2*i1-2*i2-i3+i4, 0)

soluc = solve((eq1, eq2, eq3, eq4), dict=True)

i1 = np.array([sol[i1] for sol in soluc])
i2 = np.array([sol[i2] for sol in soluc]) 
i3 = np.array([sol[i3] for sol in soluc]) 
i4 = np.array([sol[i4] for sol in soluc])
i_sigma = i2 - i3
i_delta = i1 - i2


print('Solução do sistema:\n\n i1 = %.2f A,\n i2 = %.2f A,\n i3 = %.2f A,\n i4 = %.2f A,\n i_sigma = %.2f A, \n i_delta = %.2f A.' %(i1, i2, i3, i4, i_sigma, i_delta))<jupyter_output>Solução do sistema:

 i1 = 3.98 A,
 i2 = 1.64 A,
 i3 = 2.30 A,
 i4 = -2.39 A,
 i_sigma = -0.67 A, 
 i_delta = 2.35 A.<jupyter_text>Aplicando L.K.T podemos encontrar va, vb e bc<jupyter_code>va = 15 - 2*i1
vb = 9*i_sigma - 5
vc = 6*i4

print('Solução das tensões: \n\n va = %.2f V,\n vb = %.2f V,\n vc = %.2f V.'%(va, vb, vc))
p2 = 2*i1**2
p3 = va * i_delta
p6 = vc * i4
p9 = 8 *i_sigma**2
p10 = 10 * i2**2
print('Potências nos resistores: \n\np2 = %.2f W,\np3 = %.2f W,\np6 = %.2f V,\np9 = %.2f W,\np10 = %.2f W.'%(p2, p3, p6, p9, p10))
pR = p2 + p3 + p6 + p9 + p10
print("pR = ", float(pR))
p5v = 5*i3
p15v = -15*i1
psigma = 5*i_sigma * (i2 - i4)
pdelta = vb * (2*i_delta)

print("p15v = ", float(p15v))
print("psigma = ", float(psigma))
print("pdelta = ", float(pdelta))
print("p5v = ", float(p5v))

print("Somátorio das potências", float(pR + p5v + p15v + pdelta + psigma))<jupyter_output>pR =  112.76237605757385
p15v =  -59.72814498933902
psigma =  -13.407916630675437
pdelta =  -51.584144461972805
p5v =  11.513859275053305
Somátorio das potências -0.4439707493601138
{'fraction_non_alphanumeric': 0.19420489824077267, 'fraction_numerical': 0.1628147637116247, 'mean_word_length': 3.8092868988391375, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '614894', 'license': 'MIT', 'n_tokens_mistral': 1680, 'n_tokens_neox': 1482, 'n_words': 342, 'path': 'problemas/Lista2.ipynb', 'repo_name': 'Willh-AM/ElectricCircuits', 'size': '2909'}