Dear friends,
I simulated a full-bridge rectifier in EMTP-RV and the layout as well as current waveforms passing through diode 1 are as follows:
while when I wrote the code by using ACME.jl package in julia as follows :
using ACME
circ = @circuit begin
j_in = voltagesource()
l1=inductor(0.001)
d1 = diode(;is=1e-12, η = 1)
d2 = diode(;is=1e-12, η = 1)
d3 = diode(;is=1e-12, η = 1)
d4 = diode(;is=1e-12, η = 1)
c1 = capacitor(1e-3)
r1 = resistor(20)
i_out = currentprobe()
j_in[+] ⟷ l1[1]
j_in[-] ⟷ gnd
l1[2] ⟷ d1[+] ⟷ d4[-] ⟷ i_out[-]
gnd ⟷ d2[+] ⟷ d3[-]
d1[-] ⟷ d2[-] ⟷ r1[1] ⟷ c1[1] ⟷ i_out[+]
d4[+] ⟷ d3[+] ⟷ r1[2] ⟷ c1[2]
end
fs = 44100;
fsig = 1000;
Tsim = 1 ;
Tsim = round(Int, Tsim);
Nsamples = round(Int, Tsimfs) - 1
t = (0:Nsamples)'/fs
model = DiscreteModel(circ, 1/fs)
y = run!(model, 310sin.(2πfsig . t))
using Plots
plotly()
Plots.PlotlyBackend()
plot(t’, y’)
and the figure is as follows :
although the diodes paramters are approximately matched with simulation, what should I do to match the waveforms of current with simulation result. Is there a problem with freuqncy of sinus in my code or the package can’t solve the circuit???