R
R
Radistprog2021-09-19 18:50:03
Electronics
Radistprog, 2021-09-19 18:50:03

How to write a program to simulate electrical circuits?

Hello!
I am a beginner developer and I want to write the simplest program for simulating electrical circuits. Similar to Micro-Cap, but much simpler in functionality. With my program I want to build circuits and simulate the electrical processes occurring in them. Preferred programming language С/С++, Java.
Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
VT100, 2021-09-19
@VT100

  • Learn the SPICE language.
  • You make a language parser into the topology and cost of paths (component values).
  • Parse the topology into a matrix (or matrices?) based on Ohm's law and Kirchhoff's rules.
  • Optional - simplify the matrix or topology based on the "star<>triangle" replacement.
  • Solve the matrix(es).
  • See the ngspice source code and bang your head on the table.
  • Repeat until an acceptable result is achieved.

PS If you are a programmer, go ahead!
If an electronics engineer - choose a program to your liking and study it. PPS In the sense that you do not need to make a tool if you do not plan to manufacture them.

A
atereffigies, 2021-09-19
@atereffigies

And what for if there is falstad.com?

M
mlyamasov, 2021-09-19
@mlyamasov

Well, first write a program for some simple circuit, for example, an RC chain.
Then check out https://en.wikipedia.org/wiki/SPICE
Then do better.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question