二极管线不工作,我不知道如何运行,请帮忙,我真的很想知道如何初始化二极管部分,一切正常,只有这部分当我添加它时它说找不到 ISimulation 模型
using System;
using SpiceSharp;
using SpiceSharp.Components;
using SpiceSharp.Simulations;
using System.Threading;
namespace SpiceSimulation
{
class Program
{
static void Main(string[] args)
{
var ckt = new Circuit(
new VoltageSource("V0", "in1", "0", 0.0),//ground
new VoltageSource("V1", "in", "in1", 12.0),//voltage source 12 volt
new Resistor("R1", "out", "in", 1.0e3),//resistor 1k
new Diode("M1", "out", "d", "ISimulation"),//here is my problem
new Resistor("R2", "0", "d", 2.0e3)//resistor 2k
);
// Create a DC sweep and register to the event for exporting simulation data
var dc = new DC("dc", "V0", 0.0, 0.0, 0.001);//ground voltage
dc.ExportSimulationData += (sender, exportDataEventArgs) =>
{
Console.WriteLine(exportDataEventArgs.GetVoltage("out"));//get the voltage at this point
};
// Run the simulation
dc.Run(ckt);//it will run the circuit
}
}
}