Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
8
Task/Resistor-mesh/Mathematica/resistor-mesh-1.math
Normal file
8
Task/Resistor-mesh/Mathematica/resistor-mesh-1.math
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
ResistanceMatrix[g_Graph] := With[{n = VertexCount[g], km = KirchhoffMatrix[g]},
|
||||
Table[ ReplacePart[ Diagonal[ DrazinInverse[ ReplacePart[km, k -> UnitVector[n, k]]]], k -> 0],
|
||||
{k, n}]
|
||||
]
|
||||
|
||||
rm = ResistanceMatrix[GridGraph[{10, 10}]];
|
||||
|
||||
N[rm[[12, 68]], 40]
|
||||
7
Task/Resistor-mesh/Mathematica/resistor-mesh-2.math
Normal file
7
Task/Resistor-mesh/Mathematica/resistor-mesh-2.math
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
ResistanceMatrix[g_, prec_:$MachinePrecision]:= With[{m = PseudoInverse[N[KirchhoffMatrix[g], prec]]},
|
||||
Outer[Plus, Diagonal[m], Diagonal[m]] - m - Transpose[m]
|
||||
]
|
||||
|
||||
rm = ResistanceMatrix[GridGraph[{10, 10}], 40];
|
||||
|
||||
rm[[12, 68]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue