This repository contains Python code to simulate an electric circuit in real-time using asyncio module. The code was developed and tested using PYthon 3.11.5
To run the code, follow these steps:
- Clone the repository:
git clone https://github.com/your-username/simulate-circuit.git - Navigate to the project directory:
cd simulate-circuit - Run the command
>>> python simulation_app.py
Check out the file output.txt
The current implementation has some issues:
- It seems like the readings go out of sync due to the time each computational operation takes.
- For example, the readings of the first Ohmmeter go way below the expected 30 k-Ohm due to the mismatch of the timestamps.
- A possible solution to these issues is to introduce a system "clock" that each component has to follow.
- Rolling average in Ohmmeter 2 helps but it is still not accurate enough.
- Alternatively, the simulation could be implemented using modules that do not implement concurrent processes.
- Additionally, the readings of the ammeter are behind by an offset of 100 msec.