Resistor mesh: Difference between revisions

m
→‎{{header|Tcl}}: Make a little easier to read
(→‎Tcl: Added implementation)
m (→‎{{header|Tcl}}: Make a little easier to read)
Line 370:
oo::class create ResistorMesh {
variable forcePoints V fixed w h
 
constructor {boundaryConditions} {
foreach {op condition} $boundaryConditions {
Line 418 ⟶ 419:
return $error
}
 
method FindCurrentFixpoint {epsilon} {
set dV [lrepeat $h [lrepeat $w 0.0]]
Line 449 ⟶ 451:
return [expr {([lindex $current 1] - [lindex $current 2]) / 2.0}]
}
 
# Public entry point
method solveForResistance {{epsilon 1e-24}} {
set voltageDifference [expr {
Anonymous user