GithubHelp home page GithubHelp logo

tomcl / addie Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 3.0 94.53 MB

License: GNU General Public License v3.0

Batchfile 0.01% F# 82.05% Shell 0.02% HTML 0.12% JavaScript 0.44% CSS 16.02% SCSS 0.30% Verilog 1.04%

addie's People

Contributors

0x6770 avatar adidesh20 avatar apantelopoulos avatar as5322 avatar aswarnakar04 avatar ccrownhill avatar dependabot[bot] avatar ed13santi avatar edstott avatar jemerrick avatar jpnock avatar jzzheng22 avatar marcoselvatici avatar ms8817 avatar shmew avatar shuyuan-liu avatar theogam02 avatar tomcl avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

addie's Issues

Fast Value/Type change of Voltage Source

Is your feature request related to a problem? Please describe.

The DC value of a voltage source cannot be changed from the Properties tab. If a different value is required, the Voltage Source has to be deleted and re-added.

Describe the solution you'd like
Voltage Sources should support instant value/type change from the Properties tab, as all other components do.

Describe alternatives you've considered
N/A

Additional context

Screenshot:
image

Capacitor doesn't work with op-amp

The simulator does not work with a simple integrator circuit. An integrator contains 1 capacitor, 1 op-amp and 1 resistor. The error message says there is an unknown error in the circuit.

The simulator can normally support 1 capacitor/inductor/diode. I don't see why this circuit breaks it.

image

There is an op-amp in there so that might be the problem. When replacing the capacitor with an inductor or a diode, the transient analysis works. Only the capacitor seems to break the simulator in this case.

  • OS: MacOs 13.2
  • Version 1.0.0

Higher Precision Frequency Response

Frequency Response currently works by calculating the magnitude and phase at 20 points per decade (equally spaced in the log axis) starting from $\omega=1$ up to $\omega=10^7$. This covers all the common scenarios and offers relatively good precision.

However, the following two improvements would significantly improve the frequency response offered by ADDIE:

  • More points around corner frequencies by inspecting the phase.
  • Variable start and end frequency to cover only the regions of interest

Explanations:

  1. Phase remains constant in the regions far from the corner frequencies, and changes abruptly near them. This is a characteristic that can be exploited for the purposes of AC Analysis, in order to apply an adaptive step size, instead of a constant one (20 points per decade). Specifically, the algorithm will start again from 1 rad/s with the existing step size (20 points per decade), and then when a change of more than $1^\circ$ is detected between the two previous frequency points, the step size will become 2-10 times smaller (depending on the precision needs). Of course, in order to be able to detect the end of the region of interest, the specified difference between two points that the algorithm looks for will have to be reduced an equal amount of times (2-10). Then, when the difference between the last two points is larger than the updated difference, the step size will be set back to 20 points per decade.
  2. Large corner frequencies ($\omega>10^7$) would not be depicted using the current algorithm. Also, if a circuit has only one corner frequency at $\omega=10^6$, seeing the constant magnitude and phase for small frequencies $\omega<10^3$ does not provide any useful information.

Better Error Checking Function

ADDIE's error messages currently originate from a simple error-checking function that checks for the most common errors in circuits, such as the absence of ground, short-circuits, parallel Voltage Sources, etc.

This could be improved by adding a function that analyzes the nullspace of the MNA matrix, and is able to deduct from there which nodes and/or voltage sources make the circuit not solvable. Then, it should give this information to the users using an informative notification.

Opamps with Positive or No Feedback

Something crucial that is currently not appropriately handled is checking that the opamps are used with negative feedback. Opamps with positive or no feedback can cause erroneous results when used with the current MNA algorithm.

This should be checked by the error-checking function and give appropriate warnings to the users.

Support more non-linear components

Currently, ADDIE supports only diodes when it comes to non-linear components. This is done using the iterative Newton-Raphson method along with Modified Nodal Analysis. More information on the algorithm can be found in the Addie Wiki. The function performing the simulation of non-linear components is called newtonRaphson and is in Simulation.fs.

This issue aims in ADDIE supporting other non-linear components such as MOSFETs and transistors in a similar way as it is done for diodes (using the linear companion models). A good starting point for the linear companion models of MOSFETS and transistors is this paper.

Before implementation, the newton-raphson with MNA method would have to be further evaluated to guarantee that a solution can always be obtained, or explore what should happen when a solution cannot be obtained. Also, a more
advanced problem that will be encountered when dealing with more complex circuits, is finding all
the operating points (DC Solutions) of a non-linear circuit. This is a fundamental problem in the
computer-aided design of analog circuits, and this paper presents a SPICE-Oriented Method for Finding Multiple DC Solutions in Nonlinear Circuits using a deflation-based technique .

Transient Analysis Improvements

PENDING

  1. Allow not-zero initial steady-state
  2. Transient analysis should explain more clearly how it works โ€“ e.g. input voltage is always given a transient 0 -> 1 and is assumed steady-state 0 before that

Blank output of transient analysis without warning/error meassage.

There is a type of circuit that will not give you any warning messages when trying to do transient analysis, but the output is blank.

image

If this is due to the simulator not supporting this type of circuit, there should be some sort of error message.

I tried circuits with 1 diode or 1 capacitor and the analysis works. It seems to break down when both a capacitor and a diode are used in a circuit.

When trying a diode and an inductor, I got an error message:

image

As stated in the error message "Time Simulation currently supports a maximum of one Voltage Source and one Capacitor or Inductor". This circuit has an inductor and a diode and it generates that error message.

I believe that more than one capacitor/inductor/diode or any combination of those will break the simulator. The error message appears in some of those cases but it does not appear in some others (like the one in the first picture).

  • OS: MacOs 13.2
  • Version 1.0.0

Toolbar moves to the right and can go off screen.

When creating a sheet with a long enough name, the toolbar will move to the right enough to get some buttons off screen. I discovered this while making an opamp circuit sheet.

image

Here, the ground component is missing from the toolbar.

As a demo of this point, I tried with a longer name...

image

As seen here, almost all components are off the screen.

The components can still be found in the catalogue on the right hand side, but the ease of the toolbar is lost.

  • OS: MacOs 13.2
  • Version 1.0.0

Improve Transient Analysis Graph Area

In the graph area, when a transient simulation is run, the input and output are labeled as x and y.

This should be changed so that the legend contains the voltage source label (for inputs) and node number (for outputs).

More DC Testcases (+AC/Transient)

ADDIE should have proper tests that check all of the supported features to ensure that the correctness of the algorithms doesn't break when making changes or improvements. Given that the simulation requires the use of NodeJS packages, the tests cannot run on the .NET environment (as done in ISSIE).

The interface to run the tests is already set up and this is done via the Tests tab on the RHS pane which appears only when ADDIE runs in dev mode (i.e. does not appear when published as a desktop app).

An example of a test exists in Simulator/Tests.fs. To add a test, follow a similar pattern to testCase1 in Simulator/Tests.fs.

Fix and Improve the Slider

The slider used to fast-change the values of components from the Properties tab does not work properly when it is used with very small values (e.g. 40nF for a capacitor). This should be fixed.

Also, the usability of the slider could be improved by:

  1. When the slider is used, the value in the box gets changed as well (currently only the on-canvas value changes)
  2. The slider should start from the midpoint with its original value and can then go (linear) from 0X to 2X this or maybe (log) 1/10X to 10X.

Allow build on macOS

The current build scripts do not work on macOS.

./build.sh exits with error message:

Script is not valid:
        unknown (1,0)-(1,0): Error FS0193: The specified file name or path is too long, or a component of the specified path is too long.

build.log

The existing build scripts can be updated as in ISSIE to allow build on macOS, i.e. use dotnet fsi build.fsi instead of dotnet fake.

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.