Answer the question
In order to leave comments, you need to log in
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
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?
e.g. input voltage 12, drops across resistors 3 and 5When 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 parametersOne 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 timeThis 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.
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question