SpiceSharpGenerator 1.0.9

This package has a SemVer 2.0.0 package version: 1.0.9+HEAD.24c903c.
dotnet add package SpiceSharpGenerator --version 1.0.9                
NuGet\Install-Package SpiceSharpGenerator -Version 1.0.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SpiceSharpGenerator" Version="1.0.9">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SpiceSharpGenerator --version 1.0.9                
#r "nuget: SpiceSharpGenerator, 1.0.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SpiceSharpGenerator as a Cake Addin
#addin nuget:?package=SpiceSharpGenerator&version=1.0.9

// Install SpiceSharpGenerator as a Cake Tool
#tool nuget:?package=SpiceSharpGenerator&version=1.0.9                

<img src="https://spicesharp.github.io/SpiceSharp/api/images/logo_full.svg" width="45px" /> Spice# (SpiceSharp)

Spice# is a Spice circuit simulator written in C#. The framework is made to be compatible with the original Berkeley Spice simulator, but bugs have been squashed and features can and will probably will be added.

Documentation

You can find documentation at https://spicesharp.github.io/SpiceSharp/. There you can find a guide for getting started, as well as more information about:

  • Supported types of analysis.
  • The general structure of Spice#.
  • A tutorial on how to implement your own custom model equations (prerequisite knowledge needed).
  • An example of changing parameters during simulation.
  • etc.

Quickstart

Simulating a circuit is relatively straightforward. For example:

using System;
using SpiceSharp;
using SpiceSharp.Components;
using SpiceSharp.Simulations;

namespace SpiceSimulation
{
    class Program
    {
        static void Main(string[] args)
        {
            // Build the circuit
            var ckt = new Circuit(
                new VoltageSource("V1", "in", "0", 0.0),
                new Resistor("R1", "in", "out", 1.0e3),
                new Resistor("R2", "out", "0", 2.0e3)
                );

            // Create a DC sweep and register to the event for exporting simulation data
            var dc = new DC("dc", "V1", 0.0, 5.0, 0.001);

            // Run the simulation
            foreach (int exportType in dc.Run(ckt))
            {
                Console.WriteLine(dc.GetVoltage("out"))
            }
        }
    }
}

Most standard Spice-components are available, and building your own custom components is also possible!

Installation

Spice# is available as a NuGet Package.

NuGet Downloads

Current build status

Status
Windows Windows Tests
MacOS MacOS Tests
Linux/Ubuntu Linux Tests

Aim of Spice#?

Spice# aims to be:

  • A Library rather than a standalone piece of software like most simulators currently are.
  • Accessible for both the amateur and advanced electronics enthusiast (and perhaps professional designer). In order to decrease the hurdle, a Spice# parser is also being developed. This also includes it being cross-platform (.NET and Mono).
  • Compatible with the original Spice 3f5 software (without the bugs). There's a reason why this has become the industry standard.
  • Customizable with custom simulations, custom models, integration methods, solver, etc.
  • Performance, but still completely managed code. Nobody wants a slow simulator.

What Spice# is not

Having been implemented in the .NET framework does have some limitations:

  • Unmanaged C/C++ code can often be optimized more than managed code.
  • Spice# uses Reflection to give you a better experience. However if you decide to use reflection, you may feel some performance hit.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.9 58 12/4/2024
1.0.8 52 12/4/2024
1.0.7 816 7/17/2022
1.0.6 433 7/17/2022
1.0.5 602 5/24/2021
1.0.3 578 4/24/2021
1.0.2 369 4/24/2021
1.0.1 341 4/24/2021
1.0.0 357 4/24/2021

Refer to the GitHub release for release notes.