Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
solve nonlinear system of equations issue.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I`m trying to make this code bellow to work but, seems like i've got some error and I don't know how to solve. This code should give me the solution of a 6x6 nonlinear system of equations. I'm using the "solve" function, should I use another one? It would be usefull too if I can get the symbolic solution of the R's and C's parameters, in function of the the a's.
if true
A = -0.0084;
B = 12.4815;
C = -0.15931;
D = 56.4282;
E = -0.37668;
F = 2.23716;
G = 4.56831;
syms R1 R2 R3 C1 C2 C3
a0 = C/B+E/B+G/B+A/D+E/D+G/D+A/F+C/F+G/F;
a1 = E/(B*D)+G/(B*D)+C/(B*F)+G/(B*F)+A/(D*F)+G/(D*F);
a2 = G/(B*D*F);
a3 = 1/B+1/D+1/F;
a4 = 1/(B*D)+1/(B*F)+1/(D*F);
a5 = 1/(B*D*F);
S = solve('1/(20000*C1) + 1/(20000*C2) + 1/(20000*C3)=a0','(C1*R1*R2 + C2*R1*R2 + C2*R1*R3 + C2*R2*R3 + C3*R1*R3 + C3*R2*R3)/(20000*C1*C2*C3*R1*R2*R3) = a1','(R1 + R2 + R3)/(20000*C1*C2*C3*R1*R2*R3) = a2','1/(100000*C1) + 1/(100000*C2) + 1/(100000*C3) + 1/(C1*R1) + 1/(C2*R2) + 1/(C3*R3) = a3','(C3 + (C1*R1)/100000 + (C2*R2)/100000 + (C3*R1)/100000 + (C3*R2)/100000)/(C1*C2*C3*R1*R2) + (C1*R1 + C2*R2 + (C1*R1*R2)/100000 + (C2*R1*R2)/100000)/(C1*C2*C3*R1*R2*R3) = a4','(R1 + R2 + R3 + 100000)/(100000*C1*C2*C3*R1*R2*R3) = a5','R1','R2','R3','C1','C2','C3');
end
1 comentario
Star Strider
el 18 de Jun. de 2015
When I attempted to solve your system (using solve with the lower-case ‘s’), it just gave up (in R2015a).
What is your original network? (It is always possible that you may not have analysed or characterised it correctly.)
Respuestas (2)
Walter Roberson
el 18 de Jun. de 2015
A = -0.0084; B = 12.4815; C = -0.15931; D = 56.4282; E = -0.37668; F = 2.23716; G = 4.56831;
syms R1 R2 R3 C1 C2 C3 a0 = C/B+E/B+G/B+A/D+E/D+G/D+A/F+C/F+G/F; a1 = E/(B*D)+G/(B*D)+C/(B*F)+G/(B*F)+A/(D*F)+G/(D*F); a2 = G/(B*D*F); a3 = 1/B+1/D+1/F; a4 = 1/(B*D)+1/(B*F)+1/(D*F); a5 = 1/(B*D*F); S = solve(1/(20000*C1) + 1/(20000*C2) + 1/(20000*C3) - a0, (C1*R1*R2 + C2*R1*R2 + C2*R1*R3 + C2*R2*R3 + C3*R1*R3 + C3*R2*R3)/(20000*C1*C2*C3*R1*R2*R3) - a1, (R1 + R2 + R3)/(20000*C1*C2*C3*R1*R2*R3) - a2, 1/(100000*C1) + 1/(100000*C2) + 1/(100000*C3) + 1/(C1*R1) + 1/(C2*R2) + 1/(C3*R3) - a3, (C3 + (C1*R1)/100000 + (C2*R2)/100000 + (C3*R1)/100000 + (C3*R2)/100000)/(C1*C2*C3*R1*R2) + (C1*R1 + C2*R2 + (C1*R1*R2)/100000 + (C2*R1*R2)/100000)/(C1*C2*C3*R1*R2*R3) - a4, (R1 + R2 + R3 + 100000)/(100000*C1*C2*C3*R1*R2*R3) - a5, R1, R2 , R3, C1, C2, C3);
1 comentario
Walter Roberson
el 19 de Jun. de 2015
Editada: Walter Roberson
el 19 de Jun. de 2015
The solutions are:
[C1 = -0.4461646544e-2, C2 = -0.1784004227e-3, C3 = 0.1882728654e-4, R1 = 1.174062707*10^6, R2 = -9781.547493, R3 = -1.060426096*10^5] [C1 = -0.3389681642e-2, C2 = -0.3913004980e-3, C3 = 0.1994594956e-4, R1 = 1.179017807*10^6, R2 = -5055.827149, R3 = -1.157234305*10^5] [C1 = 0.2119389587e-4, C2 = 0.1945650375e-2, C3 = -0.2424439526e-2, R1 = -1.301221986*10^5, R2 = 1181.689443, R3 = 1.187179066*10^6] [C1 = 0.2352974075e-4, C2 = 0.1208655909e-3, C3 = -0.2883195751e-3, R1 = -3.687309804*10^5, R2 = 43614.63767, R3 = 1.383356769*10^6] [C1 = 0.1487214168e-3, C2 = 0.1412855522e-4, C3 = -0.3309343282e-4, R1 = 54482.22349, R2 = -1.749572795*10^6, R3 = 2.753329868*10^6], [C1 = 0.2495289258e-4-0.1993032731e-4*I, C2 = 0.2304846111e-4+0.2178925031e-4*I, C3 = -0.9106413699e-4-0.6114544012e-3*I, R1 = 5.293758021*10^5-2.330764531*10^5*I, R2 = 5.457018310*10^5+1.484636723*10^5*I, R3 = -19142.11257+83314.07280*I] [C1 = 0.2495289258e-4+0.1993032731e-4*I, C2 = 0.2304846111e-4-0.2178925031e-4*I, C3 = -0.9106413699e-4+0.6114544012e-3*I, R1 = 5.293758021*10^5+2.330764531*10^5*I, R2 = 5.457018310*10^5-1.484636723*10^5*I, R3 = -19142.11257-83314.07280*I] [C1 = 0.2589774071e-4-0.1494241798e-4*I, C2 = 0.2441752825e-4-0.2269921972e-4*I, C3 = -0.2355944763e-5+0.2649938508e-4*I, R1 = 5.408541893*10^5-5.177244909*10^5*I, R2 = 1.594864338*10^5+1.193413097*10^6*I, R3 = 3.560509102*10^5-6.782605561*10^5*I] [C1 = 0.2589774071e-4+0.1494241798e-4*I, C2 = 0.2441752825e-4+0.2269921972e-4*I, C3 = -0.2355944763e-5-0.2649938508e-4*I, R1 = 5.408541893*10^5+5.177244909*10^5*I, R2 = 1.594864338*10^5-1.193413097*10^6*I, R3 = 3.560509102*10^5+6.782605561*10^5*I] [C1 = 0.2629006112e-4-0.1271208704e-3*I, C2 = 0.4656771904e-4-0.2584409754e-4*I, C3 = 0.2572753326e-4+0.1462101062e-4*I, R1 = 49938.56523+86025.15396*I, R2 = 6.993322548*10^5-8.451832209*10^5*I, R3 = 3.102562631*10^5+7.589662188*10^5*I] [C1 = 0.2629006112e-4+0.1271208704e-3*I, C2 = 0.4656771904e-4+0.2584409754e-4*I, C3 = 0.2572753326e-4-0.1462101062e-4*I, R1 = 49938.56523-86025.15396*I, R2 = 6.993322548*10^5+8.451832209*10^5*I, R3 = 3.102562631*10^5-7.589662188*10^5*I] [C1 = 0.3126409254e-4-0.1130524733e-4*I, C2 = 0.2719003443e-4+0.1343640581e-4*I, C3 = -0.6769445217e-4-0.3992079749e-4*I, R1 = 6.699418194*10^5-8.693515341*10^5*I, R2 = 5.684122552*10^5+7.330220343*10^5*I, R3 = -1.715059477*10^5+1.473101172*10^5*I] [C1 = 0.3126409254e-4+0.1130524733e-4*I, C2 = 0.2719003443e-4-0.1343640581e-4*I, C3 = -0.6769445217e-4+0.3992079749e-4*I, R1 = 6.699418194*10^5+8.693515341*10^5*I, R2 = 5.684122552*10^5-7.330220343*10^5*I, R3 = -1.715059477*10^5-1.473101172*10^5*I] [C1 = 0.3268603575e-4-0.2050052106e-4*I, C2 = 0.2601243075e-4-0.1483290392e-4*I, C3 = -0.6409913350e-5+0.3174125142e-4*I, R1 = 3.162201919*10^5+1.098023223*10^6*I, R2 = 5.280644453*10^5-5.322842026*10^5*I, R3 = 2.160466849*10^5-5.599731990*10^5*I] [C1 = 0.3268603575e-4+0.2050052106e-4*I, C2 = 0.2601243075e-4+0.1483290392e-4*I, C3 = -0.6409913350e-5-0.3174125142e-4*I, R1 = 3.162201919*10^5-1.098023223*10^6*I, R2 = 5.280644453*10^5+5.322842026*10^5*I, R3 = 2.160466849*10^5+5.599731990*10^5*I] [C1 = 0.3626803089e-4-0.1531205361e-4*I, C2 = 0.4303851920e-4+0.2121447799e-4*I, C3 = 0.2149151458e-3+0.2596669209e-4*I, R1 = 1.646432179*10^5-2.379573937*10^5*I, R2 = 1.754620505*10^5+1.267408248*10^5*I, R3 = 7.166551907*10^5+1.114847563*10^5*I] [C1 = 0.3626803089e-4+0.1531205361e-4*I, C2 = 0.4303851920e-4-0.2121447799e-4*I, C3 = 0.2149151458e-3-0.2596669209e-4*I, R1 = 1.646432179*10^5+2.379573937*10^5*I, R2 = 1.754620505*10^5-1.267408248*10^5*I, R3 = 7.166551907*10^5-1.114847563*10^5*I] [C1 = 0.4061952768e-4-0.1439124973e-4*I, C2 = 0.2455921515e-3+0.4192753332e-5*I, C3 = 0.4148528628e-4+0.1492861648e-4*I, R1 = 1.391654638*10^5-1.802886574*10^5*I, R2 = 7.781320811*10^5+10537.29881*I, R3 = 1.409404199*10^5+1.697533909*10^5*I] [C1 = 0.4061952768e-4+0.1439124973e-4*I, C2 = 0.2455921515e-3-0.4192753332e-5*I, C3 = 0.4148528628e-4-0.1492861648e-4*I, R1 = 1.391654638*10^5+1.802886574*10^5*I, R2 = 7.781320811*10^5-10537.29881*I, R3 = 1.409404199*10^5-1.697533909*10^5*I] [C1 = 0.7960958164e-4-0.5732134278e-4*I, C2 = 0.6294576649e-4-0.6131454147e-4*I, C3 = 0.2693945078e-4+0.1213272754e-4*I, R1 = 8.187046281*10^5-5.991012132*10^5*I, R2 = 1.176185691*10^5+29404.68843*I, R3 = 1.219147323*10^5+5.697014313*10^5*I] [C1 = 0.7960958164e-4+0.5732134278e-4*I, C2 = 0.6294576649e-4+0.6131454147e-4*I, C3 = 0.2693945078e-4-0.1213272754e-4*I, R1 = 8.187046281*10^5+5.991012132*10^5*I, R2 = 1.176185691*10^5-29404.68843*I, R3 = 1.219147323*10^5-5.697014313*10^5*I]
where I is sqrt(-1).
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!