Code Monkey home page Code Monkey logo

admittancemodels.jl's People

Contributors

ajkeller34 avatar amellnik avatar mgscheer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

admittancemodels.jl's Issues

Input and output port matrices

I'm not sure why input and output port matrices are allowed to differ for both Blackbox and PSOModel if there is only one vector of port names. Perhaps am I missing some obvious reason to do this?

`cascade_and_unite` deserves an easier name to type

The name is good in that the functionality is self-evident if you have read the paper, but for such a common operation it is a drag to type that many characters.

I suggest connect to indicate that the operation amounts to connecting multiple admittance models (or circuits) at their shared ports.

Port types?

In discussing #11, Michael wrote:

After some thought, I agree that Cascade is not really necessary and given that things are generally more readable without it I'm in favor of making this change. I do like being able to specify what happens to the ports ahead of time though, as this would avoid some repeated code in the code for the paper. So if you have ideas for a better way to do that, that would be cool, though it's not that important.

To accomplish such functionality, it seems like a Port type would be necessary.

Model equality

AdmittanceModels are not considered equal if columns of the input/output port matrices are permuted, with port names correspondingly permuted. I think it should be safe to consider such models equal---the ordering is entirely arbitrary and not even tied to gauge choice. Columns of the port matrix are not indexed directly, rather only after looking up the column index using the port names vector. Likewise, I think Circuits should be considered equal if equal up to a permutation of the vertices.

Furthermore, I noticed there is an isapprox method defined for AdmittanceModels. It appears convenient for some tests but I am not sure how correct it is to implement this because the atol and rtol flags are inaccessible. atol and rtol would be most useful if they were able to be specified for each matrix separately in the case of a PSOModel (or Circuit, which is not an AdmittanceModel but has a method similarly defined). As implemented, the method does not work in general, because isapprox is not defined for arrays of String port names, for example. Finally, I think there is a sense in which one could speak of different kinds of models approximating each other but that's not allowed here.

function Base. ==(am1::AdmittanceModel, am2::AdmittanceModel)
t = typeof(am1)
if typeof(am2) != t
return false
end
return all([getfield(am1, name) == getfield(am2, name) for name in fieldnames(t)])
end
function Base.isapprox(am1::AdmittanceModel, am2::AdmittanceModel)
t = typeof(am1)
if typeof(am2) != t
return false
end
return all([getfield(am1, name) โ‰ˆ getfield(am2, name) for name in fieldnames(t)])
end

Port type parameter for circuit components

In src/circuit_components.jl, ports are assumed to be identified by Strings, but this not enforced elsewhere in the package. Probably the circuit components should have a type parameter for the port names.

See also #22; potentially one carefully thought out PR could address both issues.

API style consistency

The arguments of set_inductance!(c::Circuit, v0, v1, value) and related methods have an unfortunate ordering. Consider that for arrays, the syntax A[inds...] = X is lowered to setindex!(A, X, inds...), i.e. the set value precedes the indices.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.