npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@alexanderdefuria/circuit-solver-algorithms

v0.1.21

Published

## SEG 4105 *Note that this repository is concurrently being evaluated as a part of SEG 4105 Project Mangement. \ As such it will house all project management artifacts throughout the term. \ All project management is done through GitHub issues.*

Downloads

49

Readme

Circuit Solver Algorithms

SEG 4105

Note that this repository is concurrently being evaluated as a part of SEG 4105 Project Mangement.
As such it will house all project management artifacts throughout the term. \ All project management is done through GitHub issues.

Alexander De Furia - Student Number: 300190815

Description

This is the repository for the core circuit solver algorithm and supporting calculations. The main concept is to create a circuit solver that can be used in a variety of applications for elementary circuit analysis. This API Conceptualizes a literal circuit as a container of elements and tools. Elements being the physical components of the circuit and tools being the conceptual components of the circuit.

A user can provide a container of elements and tools and the API will solve the circuit and return the results.

Container Rework

This project has aspects that are not ideal and should be reworked. There are pitfalls in the integration between the solver and container modules. The container module should be reworked to be more of a data structure and less of a solver. The solver module should be reworked to be more of a solver and less of a data structure. There is no mutability of the container contents from the solver module. This is a problem because the solver module is the only module that is intended to be called by the user. It should handle all of the solving and by times this involves updating the values of the container contents (elements and tools). This is not possible with the current implementation.

WASM API

The bulk of the API is defined within interfaces.rs.

Load Container

  • load_wasm_container(container_object) -> Result<String, StatusError>
  • This can be used as a test to see if the container is being loaded in properly.
  • It should follow the predefined conventions for the container shape and structure.
  • If there are errors it will return said errors.

Solve

  • Note this is untested and may not work.
  • solve_wasm_container(matrix_bool, nodal_bool, container_object) -> Result<String, StatusError>
  • This will solve the container and return the results as a string.
  • This will be the main interface for the WASM API.
  • Subject to rapid change, should not be relied on as of now

Matrix

  • return_solved_matrix_example() -> String
  • This returns a constant string of a solved step example.
  • Should return latex(?) string of the matrix. (To Confirm).
  • This is a constant string for testing purposes.
  • This should be removed in the future.

Nodal

  • return_solved_nodal_example() -> String
  • This returns a constant string of a solved step example.
  • Should return latex(?) string of the nodal. (To Confirm).
  • This is the same as the matrix example but for nodal.
  • This is a constant string for testing purposes.
  • This should be removed in the future.

WASM Data Structures

There is slight variation between the front and backend due to the restrictions of WASM. Most notably for our purposes one cannot pass a struct from the front end to the backend. This is due to the fact that vector types are not supported in WASM. This means that the container object must be passed as a JSON string

General Overview

Containers

The container.rs file contains the implementation of the Container struct, which represents a collection of Elements and Tools used to solve a circuit. The Container struct has a number of methods for adding and removing elements and tools, as well as for solving the circuit. The Container struct also has a ground field, which represents the index of the ground element in the elements vector. The Container struct is used extensively throughout the rest of the crate to represent the circuit being solved.

Elements

An Element represents a physical component of the circuit, such as a resistor or capacitor. It has a set of properties, such as its resistance or capacitance, and can be connected to other elements to form a circuit.

Tools

A Tool represents a virtual component of the circuit, such as a node or mesh. It is used as conceptual tool to help solve the circuit, and is not a physical component of the circuit. It has a set of properties, such as its voltage or current, and contains elements and potentially other tools.

Validation

There are several validation rules for circuits in this crate of which multiple can be noted for a particular circuit. Here are a few examples:

  • All elements must have unique names.
  • All nodes must be connected to at least one other node.
  • The circuit must have exactly one ground element.
  • The circuit must not contain any loops.
  • The circuit must not contain any short circuits.
  • The circuit must not contain any open circuits.

The full list of validation rules can be found in the validation.rs file as well as within respective areas of the code. There are inevitably going to be more rules added as the project progresses.

Testing Fixtures

create_basic_container() img.png

create_basic_supernode_container() img.png

create_basic_supermesh_container() img.png

create_mna_container() img.png