Question: sSOLVE USING PYTHON PROGRAMMING LANGUAGE. Q4. An RL circuit is an electrical circuit consisting of a resistor and an inductor, as shown in the following
sSOLVE USING PYTHON PROGRAMMING LANGUAGE.
Q4. An RL circuit is an electrical circuit consisting of a resistor and an inductor, as shown in the following figure. Voltage V Close switch att = 0 = 0000 Inductance L Resistance R The voltage source raise the voltage V. Through the resistor, the voltage drops by IR (I is the current and R is the resistance). Through the inductor, the voltage drops by LdI/dt (L is the inductance). So, we have the ordinary differential equation: dI(t) I(t)R + L dt where we emphasize that I is a function of time t. Solve this equation of SymPy. 1. Define the symbols I, R, L, t and V. 2. Define the above equation. 3. Solve the equation with the initial condition: I(t = 0) = 0. 4. Substitute the parameters: R 50 (unit: 12), L 1 (unit: H) and V = 5 (unit: V) into the expression of the solution. Print out the solution after substitution. 5. Convert the solution I(t) to a python function by sympy.lambdify(). 6. Plot I vs. t by matplotlib. 7. Replace the DC voltage source by an AC voltage source such that V = 5 sin(200t) (unit: V). Solve the above differential equation for this AC source with parameters given in Question 4 (except V). Finally, plot I vs. t. Q4. An RL circuit is an electrical circuit consisting of a resistor and an inductor, as shown in the following figure. Voltage V Close switch att = 0 = 0000 Inductance L Resistance R The voltage source raise the voltage V. Through the resistor, the voltage drops by IR (I is the current and R is the resistance). Through the inductor, the voltage drops by LdI/dt (L is the inductance). So, we have the ordinary differential equation: dI(t) I(t)R + L dt where we emphasize that I is a function of time t. Solve this equation of SymPy. 1. Define the symbols I, R, L, t and V. 2. Define the above equation. 3. Solve the equation with the initial condition: I(t = 0) = 0. 4. Substitute the parameters: R 50 (unit: 12), L 1 (unit: H) and V = 5 (unit: V) into the expression of the solution. Print out the solution after substitution. 5. Convert the solution I(t) to a python function by sympy.lambdify(). 6. Plot I vs. t by matplotlib. 7. Replace the DC voltage source by an AC voltage source such that V = 5 sin(200t) (unit: V). Solve the above differential equation for this AC source with parameters given in Question 4 (except V). Finally, plot I vs. t
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
