SpiceSharp 3.2.2
See the version list below for details.
dotnet add package SpiceSharp --version 3.2.2
NuGet\Install-Package SpiceSharp -Version 3.2.2
<PackageReference Include="SpiceSharp" Version="3.2.2" />
paket add SpiceSharp --version 3.2.2
#r "nuget: SpiceSharp, 3.2.2"
// Install SpiceSharp as a Cake Addin #addin nuget:?package=SpiceSharp&version=3.2.2 // Install SpiceSharp as a Cake Tool #tool nuget:?package=SpiceSharp&version=3.2.2
<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.
Current build status
Status | |
---|---|
Windows | |
MacOS | |
Linux/Ubuntu |
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.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on SpiceSharp:
Package | Downloads |
---|---|
SpiceSharp-Parser
SPICE netlists parser for .NET |
|
SpiceSharpBehavioral
Spice# is a circuit simulator based on and improved from Spice 3f5 by Berkeley. The framework allows custom components and simulations to be added. |
|
SpiceSharpBSIM
Spice#.BSIM is a library for Spice# that contains the BSIM models. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.2.3 | 638 | 10/11/2024 |
3.2.2 | 82 | 10/1/2024 |
3.2.1 | 179 | 9/18/2024 |
3.2.0 | 121 | 8/31/2024 |
3.1.9 | 639 | 5/16/2024 |
3.1.8 | 622 | 1/31/2024 |
3.1.7 | 637 | 9/1/2023 |
3.1.6 | 496 | 8/27/2023 |
3.1.5 | 5,770 | 6/26/2021 |
3.1.4 | 853 | 6/5/2021 |
3.1.3 | 1,609 | 5/24/2021 |
3.1.2 | 1,550 | 5/8/2021 |
3.1.1 | 3,573 | 4/25/2021 |
3.1.0 | 908 | 4/24/2021 |
3.0.5 | 4,128 | 3/21/2021 |
3.0.4 | 1,240 | 1/24/2021 |
3.0.3 | 1,028 | 11/19/2020 |
3.0.2 | 900 | 11/7/2020 |
3.0.1 | 1,032 | 8/3/2020 |
3.0.0 | 1,159 | 8/2/2020 |
2.8.0 | 13,792 | 8/20/2019 |
2.7.7 | 952 | 8/14/2019 |
2.7.6 | 1,842 | 7/28/2019 |
2.7.5 | 986 | 7/27/2019 |
2.7.4 | 962 | 7/18/2019 |
2.7.3 | 2,618 | 7/11/2019 |
2.7.2 | 964 | 7/10/2019 |
2.7.1 | 1,879 | 7/4/2019 |
2.7.0 | 997 | 6/23/2019 |
2.6.1 | 2,638 | 3/28/2019 |
2.6.0 | 1,061 | 3/25/2019 |
2.5.9 | 1,143 | 2/3/2019 |
2.5.8 | 1,100 | 1/25/2019 |
2.5.7 | 4,011 | 12/5/2018 |
2.5.6 | 3,984 | 11/27/2018 |
2.5.5 | 2,664 | 11/20/2018 |
2.5.4 | 8,585 | 11/4/2018 |
2.5.3 | 2,018 | 11/2/2018 |
2.5.2 | 1,178 | 10/31/2018 |
2.5.1 | 1,127 | 10/29/2018 |
2.5.0 | 4,215 | 10/7/2018 |
2.4.0 | 2,778 | 9/26/2018 |
2.3.0 | 2,877 | 9/7/2018 |
2.2.0 | 3,488 | 8/8/2018 |
2.1.6 | 5,392 | 7/17/2018 |
2.1.5 | 1,396 | 7/16/2018 |
2.1.4 | 2,962 | 6/6/2018 |
2.1.3 | 1,317 | 6/5/2018 |
2.1.2 | 3,210 | 5/16/2018 |
2.1.1 | 1,450 | 5/14/2018 |
2.1.0 | 4,624 | 5/8/2018 |
2.0.1 | 1,494 | 3/27/2018 |
1.1.0 | 1,351 | 10/5/2017 |
1.0.1 | 1,345 | 9/6/2017 |
1.0.0 | 1,415 | 9/5/2017 |
Refer to the GitHub release for release notes.