A
A
Alexander Sinitsyn2020-11-29 18:52:16
Electronics
Alexander Sinitsyn, 2020-11-29 18:52:16

How to implement the calculation of a simple circuit of resistors?

For example, there is a simple voltage divider with a load:
- R, V, I, P can be set for any element - both all and separate
- these values ​​\u200b\u200bcan be set both for individual elements and for several (for example, input voltage to two resistors)
- parallel and series connections are used

How to build an application to make it easier to do calculations of non-set values, find and fix conflicts in manually set values ​​(for example, input voltage 12, drops on resistors 3 and 5 ... or mismatched resistance, current and voltage)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
VT100, 2020-11-29
@VT100

Ohm's laws and Kirchhoff's rules. IMHO - everything.
The main question, I think, is in the correct selection of the topology of an arbitrary (?) divider, with series-parallel connections. As an option - try to generate a netlist, give it to the appropriate program (ngspice, for example) and parse its output for errors.
PS What's the point?

H
hint000, 2020-11-30
@hint000

e.g. input voltage 12, drops across resistors 3 and 5
When two parameters are entered, sufficient to calculate the third parameter, then you need to immediately calculate it and block the input of this parameter (we were told to "gray" the control - make it gray, inaccessible).
it is not clear how to organize flexible recalculation for any scheme parameters
One way or another, it makes sense to do the recalculation after entering or adjusting some parameter, i.e. on input event. All options are in the list. We run through the list of parameters in a loop and for each we see if it can be calculated based on the available ones (for each parameter, you can make a flag with three states: 0=undefined, 1=introduced, 2=calculated), if possible, then calculate, set the flag .
for each value, you need to save the input time
This is useless, from the word at all. If after each input to calculate everything that can already be calculated, then it does not matter which parameter was entered earlier and which later.

L
Lev Zabudkin, 2020-12-02
@zabudkin

Well, first of all, you need to get a higher technical education.
You won’t learn this yourself, don’t even try, otherwise you will be known in circles as a self-taught tyrant.

For example, there is a simple voltage divider with a load:
- R, V, I, P can be set for any element - both all and separate
- these values ​​\u200b\u200bcan be set both for individual elements and for several (for example, input voltage to two resistors)
- parallel and serial connections are used

And what's stopping you from simply adding up the values ​​​​for several elements, and in general making calculations by quantity, or will you enter each element into the circuit? It is especially interesting how you will process the values ​​\u200b\u200bof the "input voltage across two resistors" :) Or are you about a divider or are you going to stupidly plus?
And as I understand it, you have both a serial and parallel circuit at the same time. How are you going to count it? Okay, parallel, but serial? The failure of one element and there is no your scheme.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question