1

Topic: Computing method of calculation of a difficult electrical circuit

Hello, And whether someone can direct me to the necessary side. How difficult electrical circuits settle up? Clearly, there are any human methods, type there planimetric currents, the equivalent generator and so forth But if we have only a graph containing circuit resistors, EMF and current sources how it is possible to fulfill the approximate calculation?

2

Re: Computing method of calculation of a difficult electrical circuit

Hello, RedApe, you wrote: RA> Hello, RA> And whether someone can direct me to the necessary side. How difficult electrical circuits settle up? Clearly, there are any human methods, type there planimetric currents, the equivalent generator and so forth But if we have only a graph containing circuit resistors, EMF and current sources how it is possible to fulfill the approximate calculation? https://www.partsim.com/simulator

3

Re: Computing method of calculation of a difficult electrical circuit

Hello, novitk, you wrote: N> https://www.partsim.com/simulator Yes is not present, the algorithm is necessary to me, that most to implement I represent approximately how to make "naive" implementation: to install values of potentials, to calculate values of currents, then to adjust values of potentials and anew to calculate currents. But simply it is such subject where, apparently, already there should be carefully probed ready algorithms.

4

Re: Computing method of calculation of a difficult electrical circuit

Actually, the standard: SPICE Here any port with source codes: Ngspice is a mixed-level/mixed-signal circuit simulator. Its code is based on three open source software packages: Spice3f5, Cider1b1 and Xspice.

5

Re: Computing method of calculation of a difficult electrical circuit

Hello, RedApe, you wrote: RA> Hello, RA> And whether someone can direct me to the necessary side. How difficult electrical circuits settle up? Clearly, there are any human methods, type there planimetric currents, the equivalent generator and so forth But if we have only a graph containing circuit resistors, EMF and current sources how it is possible to fulfill the approximate calculation? There all this business in matrixes is exhausted and dares - https://www.electronics-tutorials.ws/dc … dcp_5.html

6

Re: Computing method of calculation of a difficult electrical circuit

Hello, RedApe, you wrote: N>> https://www.partsim.com/simulator RA> Yes is not present, the algorithm is necessary to me, that most to implement It and there is UI a jacket over a kernel with such algorithms. Was specific in the link which I resulted is used SPICE. There are also others, here the list of the free: https://en.wikipedia.org/wiki/List_of_f … simulators

7

Re: Computing method of calculation of a difficult electrical circuit

Hello, RedApe, you wrote: RA> And whether someone can direct me to the necessary side. How difficult electrical circuits settle up? Clearly, there are any human methods, type there planimetric currents, the equivalent generator and so forth But if we have only a graph containing circuit resistors, EMF and current sources how it is possible to fulfill the approximate calculation? For the linear circuit - it is elementary, in high school to it learn: - the Total of currents coming to one point is equal to zero. - the total of pressure on a closed circuit is equal to zero. - the law of the Ohm for each passive element Make the list of such equations on all circuits, points and passive elements and solve a method, for example, the Gauss

8

Re: Computing method of calculation of a difficult electrical circuit

Hello, RedApe, you wrote: RA> Hello, RA> And whether someone can direct me to the necessary side. How difficult electrical circuits settle up? Clearly, there are any human methods, type there planimetric currents, the equivalent generator and so forth But if we have only a graph containing circuit resistors, EMF and current sources how it is possible to fulfill the approximate calculation? If a circuit linear that is possible approximately so: #include <math.h> #include <stdio.h> enum {item_E, item_I, item_R}; struct Item {int type; double value; int p [2];}; struct Solver {double U (int k) const {return x [k];} double I (int k) const {return x [np+k];} Solver (int count, Item* items) {rc=solve (count, items);} ~Solver () {delete [] x; x=0;} operator int () const {return rc == 0;} int nl, np; protected: int n, rc; double *x;//x [n] = {u [np], i [nl]} int solve (int count, Item* items) {int nn, k, i, r, ik, u1, u0; double *A, *b;//find np np =-1; nl=count; for (int k=0; k <nl; k ++) {if (np <items [k].p [0]) np=items [k].p [0]; if (np <items [k].p [1]) np=items [k].p [1];} np ++; n=nl+np; nn=n * (n+1);//prepare x=new double [n]; A=new double [nn]; b=new double [n+1]; for (i=0; i <n; i ++) x [i] =b [i] =0; for (i=0; i <nn; i ++) A [i] =0;//build equations for (k=0; k <nl; k ++) {ik=np+k; u1=items [k].p [1]; u0=items [k].p [0];//lines [0. np) A [ik+u0*n] =-1; break; case item_R: {//i [k] *R=u1-u0 A [ik+ik*n] =items [k].value; A [u1+ik*n] =-1; A [u0+ik*n] = +1;} break;}}//line=n A [n*n] =1; b [n] =0;//u [0 =0 r=slae (n, n+1, A, x, b);//solve with 1 dependant equation delete [] b; delete [] A; return r;} static int slae (int n, int m, double *A, double *x, double *b) {//m> =n int i, j, k, mi; double mv, t; for (i=0; i <n; i ++) {//forward mi=i; mv=fabs (A [i+i*n]); for (j=i+1; j <m; j ++) {//find best t=fabs (A [i+j*n]); if (mv <t) {mv=t; mi=j;}} if (mv == 0.0) return 1;//singular if (mi! =i) {//swap for (j=i; j <n; j ++) {t=A [j+i*n]; A [j+i*n] =A [j+mi*n]; A [j+mi*n] =t;} t=b } for (i=n-1; i> =0; i-) {//backward t=b [i]; for (j=i+1; j <n; j ++) T - = A [j+i*n] *x [j]; x [i] =t/A [i+i*n];} return 0;}}; int main (int argc, char ** argv) {/* +------------------------------- + | | (0) - [E] - (1) - R100 - (2) - R200 - (0) | | (2) - R300 - (0) nl - number of lines np - number of points */Item items [] = {{item_E, 5,0,1}, {item_R, 100,1,2}, {item_R, 200,2,0}, {item_R, 300,2,0}}; enum {N=sizeof (items)/sizeof (*items)}; Solver s (N, items); if (! s) printf ("singular\n"); else {for (int k=0; k <s.np; k ++) printf ("U%d = % 8.3f V\n", k, s. U (k)); for (int k=0; k <s.nl; k ++) printf ("I%d = % 8.3f A\n", k, s. I (k type - member type in a line (E-eds, I-ist a current, R-loading) value - value In, And, the Ohm p [0] - quits what point p [1] - in what point enters U (k) - potential of a point I (k) - a current into lines If anywhere  has to work.

9

Re: Computing method of calculation of a difficult electrical circuit

As the linear circuit is called any graph with elements R, L, a C EMF and current sources. Calculation of such circuit is reduced to the decision of systems of equations (generally with complex coefficients). How to write down the equations - there are textbooks, where  to trifles,  a genre.

10

Re: Computing method of calculation of a difficult electrical circuit

V> - the Law of the Ohm for each passive element  it works and for reactive too

11

Re: Computing method of calculation of a difficult electrical circuit

Hello, barn_czn, you wrote: V>> - the Law of the Ohm for each passive element _>  it works and for reactive too do not confuse reactive elements to the active. Capacity - too passive .

12

Re: Computing method of calculation of a difficult electrical circuit

Hello, vmpire, you wrote: V> Make the list of such equations on all circuits, points and passive elements and solve a method, for example, If elements it is a lot of Gauss, the Gauss can and break. The big systems of equations dare approximately any methods of conjugate gradients.

13

Re: Computing method of calculation of a difficult electrical circuit

Hello, RedApe, you wrote: RA> And whether someone can direct me to the necessary side. How difficult electrical circuits settle up? Clearly, there are any human methods, type there planimetric currents, the equivalent generator and so forth But if we have only a graph containing circuit resistors, EMF and current sources how it is possible to fulfill the approximate calculation? A method of planimetric currents and a method of nodal potentials. These are machine methods - they allow you to make system of equations. And further you solve their any conjugate gradient.

14

Re: Computing method of calculation of a difficult electrical circuit

Hello, vmpire, you wrote: V> Hello, barn_czn, you wrote: V>>> - the Law of the Ohm for each passive element _>>  it works and for reactive too V> do not confuse reactive elements to the active. Capacity - too passive . An example of active then result.

15

Re: Computing method of calculation of a difficult electrical circuit

Hello, alpha21264, you wrote: V>> Make the list of such equations on all circuits, points and passive elements and solve a method, for example,> If elements it is a lot of Gauss A, the Gauss can and break. A> the big systems of equations dare approximately any methods of conjugate gradients. It already details. I wrote "for example", instead of "only the Gauss"

16

Re: Computing method of calculation of a difficult electrical circuit

Hello, barn_czn, you wrote: V>>>> - the Law of the Ohm for each passive element _>>>  it works and for reactive too V>> do not confuse reactive elements to the active. Capacity - too passive . _> the Example of active then result. A current or pressure source.