Skip to content

Question regarding resistive distance calculation #434

@vboussange

Description

@vboussange

Hey there, I really appreciate all the work and tricks put into this nice package! :)

I have two questions regarding the implementation of the resistive distance:

  1. The Laplacian matrix of the graph associated with the electrical circuit is singular; this is why the resistive distance is usually defined with the Moore-Penrose pseudo inverse of the Laplacian. But you use another trick to be able to calculate the voltages when injecting one amp into the system, possibly related to
    matrix.nzval .+= eps(eltype(matrix)) * norm(matrix.nzval)
    Can you justify what is this line doing?
  2. I am also confused with these two lines:

    Circuitscape.jl/src/core.jl

    Lines 218 to 221 in 4b6dbee

    v .= v .- v[comp_i]
    # Calculate resistance
    r = v[comp_j] - v[comp_i]
    Why would r = v[comp_j] - 2 * v[comp_i] instead of r = v[comp_j] - v[comp_i]?

Thanks a lot in advance for your answers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions