Question
Calculate using C++ code the current flowing through the RC circuit. The circuit consists of a battery connected in series to a switch, a resistor and a capacitor. When the switch is closed, the current flowing through the circuit is given by;
where;
E is the voltage of the battery in volts.
R is the value of the resistor in ohms.
C is the value of the capacitor in farads.
t is the time in seconds after the switch is closed.
e is Euler’s number, which is 2.71828 (rounded to five decimal places).
- Test your solution using the scenarios below;
- Hint: Final result should be a float, do not round off.
- E = 6, R = 100, C = 0.026, t = 1.4 Expected result (0.0350187).
- E = 15, R = 20, C = 0.055, t = 0.067 Expected result (0.705682).
- Compare the results of your code with the expected calculated values.
Deadline
2nd November 2022, 11:59 PM.
Guidelines
- This is a group assignment
- Maximum group size is 5
- Decide your group members before joining the assignment and create a group on the page afterwards.
- Groups already made, remain intact and shall be used throughout all assignments.
- To make adjustments to groups, reach out to your respective TA.
- One member is needed to make a group and the rest are required to join that group.
- Uniquely name your group (Advised to use the name of one group member to avoid repetition of names)
- Only one member is needed to submit on behalf of the group, however, all members have the ability to submit.
Assignment Registration
- Join the assignment page;