tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
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 @@
|
|||
graphresistor[g_, a_, b_] :=
|
||||
LinearSolve[
|
||||
SparseArray[{{a, a} -> 1, {i_, i_} :> Length@AdjacencyList[g, i],
|
||||
Alternatives @@ Join[#, Reverse /@ #] &[
|
||||
List @@@ EdgeList[VertexDelete[g, a]]] -> -1}, {VertexCount[
|
||||
g], VertexCount[g]}], SparseArray[b -> 1, VertexCount[g]]][[b]];
|
||||
N[graphresistor[GridGraph[{10, 10}], 12, 77], 40]
|
||||
Loading…
Add table
Add a link
Reference in a new issue