[C5 Circuitos em Série] Análise Computacional 5.12
Autor: Guilherme Paulino | Publicado: 2011-08-01T18:13:00-03:00

Faça a análise do circuito em série na Figura 1 e determine a corrente I, as tensões sobre os resistores R1, R2 e R3 e também as diferenças de potencial em&nbsp;V1 e em&nbsp;V2.



Figura 1. Circuito em Série.

(1)&nbsp;Análise utilizando a linguagem de programação C++.

// Análise de Circuito em Série com C++
#include&lt;iostream&gt;
#include&lt;conio.h&gt;
using namespace std;
class resistor {
&nbsp; &nbsp; &nbsp; public:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;float valor;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;float tensao;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;float potencia;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;};
class fonte_tensao {
&nbsp; &nbsp; &nbsp; public:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;float tensao;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;float corrente;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;float potencia;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;};
int main()
{
&nbsp; &nbsp; &nbsp; resistor R1, R2, R3;
&nbsp; &nbsp; &nbsp; float Rtotal;
&nbsp; &nbsp; &nbsp; fonte_tensao V1;
&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; R1.valor = 6;
&nbsp; &nbsp; &nbsp; R2.valor = 7;
&nbsp; &nbsp; &nbsp; R3.valor = 5;
&nbsp; &nbsp; &nbsp; Rtotal = R1.valor + R2.valor + R3.valor;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Resistencia total: " &lt;&lt; Rtotal &lt;&lt; " ohms." &lt;&lt; endl;
&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; V1.tensao = 54;
&nbsp; &nbsp; &nbsp; V1.corrente = V1.tensao / Rtotal;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Corrente do circuito: " &lt;&lt; V1.corrente &lt;&lt; " amperes" &lt;&lt; endl;
&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; R1.tensao = V1.corrente * R1.valor;
&nbsp; &nbsp; &nbsp; R2.tensao = V1.corrente * R2.valor;
&nbsp; &nbsp; &nbsp; R3.tensao = V1.corrente * R3.valor;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Tensao VR1 = " &lt;&lt; R1.tensao &lt;&lt; " volts." &lt;&lt; endl;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Tensao VR2 = " &lt;&lt; R2.tensao &lt;&lt; " volts." &lt;&lt; endl;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Tensao VR3 = V2 = " &lt;&lt; R3.tensao &lt;&lt; " volts." &lt;&lt; endl;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Tensao V1 = " &lt;&lt; R2.tensao + R3.tensao &lt;&lt; " volts." &lt;&lt; endl;
&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; R1.potencia = V1.corrente * R1.tensao;
&nbsp; &nbsp; &nbsp; R2.potencia = V1.corrente * R2.tensao;
&nbsp; &nbsp; &nbsp; R3.potencia = V1.corrente * R3.tensao;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Potencia PR1 = " &lt;&lt; R1.potencia &lt;&lt; " watts." &lt;&lt; endl;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Potencia PR2 = " &lt;&lt; R2.potencia &lt;&lt; " watts." &lt;&lt; endl;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Potencia PR3 = " &lt;&lt; R3.potencia &lt;&lt; " watts." &lt;&lt; endl;
&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; V1.potencia = V1.tensao * V1.corrente;
&nbsp; &nbsp; &nbsp; cout &lt;&lt; "Potencia total: " &lt;&lt; V1.potencia &lt;&lt; " watts." &lt;&lt; endl;
&nbsp; &nbsp; &nbsp; getch();
&nbsp; &nbsp; &nbsp; return 0;
}




Figura 2. Programa executável da análise em C++.



(2) Análise no software NI Multisim 11.0.




Figura 3. Clique na imagem para visualizar.





Clique aqui para baixar o programa executável em C++, e o circuito funcionando no NI Multisim 11.0 (requer o software simulador instalado).