# Python代写|Python Program that Analyses an Electrical Circuit

In this lab, some flowcharts that describe each step of the program and how the program works must be determined. First of all, the value of each impedance should be determined. From the data in 4.1.1, each impedance’s resistance, capacitance, conductance and inductance can be found, after that, each component’s impedance can be calculated. Afterwards, its connection type should be determined, to check if it is in series or in parallel. Using a ABCD matrix to get the impedance and a loop to calculate the sum of the impedance in the circuit. Finally, using the results got from the last step like Vin, Iin to calculate the Vout, Iout, Pout, Av, Ai.

Figure 1 displayed how each component is connected, so that in the flowchart the different circumstances should be taken into consideration. That is because the result of the matrix will be different depends on its connection. In case of a series impedance, in the ABCD matrix, A=1, B=Z, C=0, D=1. However, if where the shunt element is an admittance Y=1/Z, A=1, B=0, C=Y, D=1. For example, as is shown in the codes of 4.1.1, when n1=2, n2=0, Z2 and Z1 are in parallel. However, when n1=2, n2=3, Z3 and Z1 are in series.

As described in the flowchart, the program must perform the following tasks, firstly, read the circuit file. Second, analyse the circuit to evaluate the requested output variables. Finally, write the output variables to a file. Afterwards, entered the circuit block and input n=0 into the impedance array. This array is used to store the value of n, and it is useful in the following steps. In this program, using a loop to determine the impedance. When entered the program, checked if the resistance exists. The resistance needed to be checked first because the impedance is a complex number consists of real part and imaginary part, the resistance stands for the real part while capacitance or inductance stands for the imaginary part. If the resistance exists, the real part can be decided, and then the program is going to find the imaginary part. If the capacitance exists, its capacitive reactance is the imaginary part, which is j/wC. if not, the program will try to find if the inductance exists. If the inductance exists, its inductive reactance is the imaginary part, which is jwL. If not, then the imaginary part does not exist, as well as the resistance. So, the program will find the conductance in the next step, using the formula G=1/R to calculate the resistance. Then came to instruction n=n+1 to start a new cycle from the first judgement condition. Finally, the program got every component’s impedance and stored each of them into the array by order.

n1=1 n2=2 R=8.55
n1=2 n2=0 R=141.9
n1=2 n2=3 R=8.55
n1=3 n2=4 L=1.59e-3
n1=4 n2=0 C=3.18e-9
n1=5 n2=6 G=0.02677
If the lines above are the input, the output will be:
Z1=8.55
Z2=141.9
Z3=8.55
Z4=jw1.59e-3 Z5=j/w3.18e-9
Z6=37.35

## contact ## Recent Case

### 高分C语言代写，靠谱保A保90+

C语言作为一门编程语言，它可以把高级语言的基本结构

## Service Scope

C|C++|Java|Python|Matlab|Android|Jsp|Prolo  