# I have the problem with frequency sampling

**URL:** <https://discourse.julialang.org/t/i-have-the-problem-with-frequency-sampling/62090>\
**Category:** Modelling & Simulations\
**Tags:** package, plotting\
**Created:** [May 30, 2021, 1:37pm UTC](https://discourse.julialang.org/t/i-have-the-problem-with-frequency-sampling/62090 "2021-05-30T13:37:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sajad\_ghassemi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sajad_ghassemi/32/25241_2.png) [@sajad\_ghassemi](https://discourse.julialang.org/u/sajad_ghassemi)\
**Post date:** [May 30, 2021, 1:37pm UTC](https://discourse.julialang.org/t/i-have-the-problem-with-frequency-sampling/62090/1 "2021-05-30T13:37:09Z")

</div>

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:  
 ![error2](https://global.discourse-cdn.com/julialang/original/3X/1/4/1415a2e894a59c98ebec1ede2f814dbfbd79bc5e.png)

 ![error](https://global.discourse-cdn.com/julialang/original/3X/1/f/1f79690c3703e8de6033342e6f2b0055088e6a09.png)  
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, Tsim_fs) - 1  
t = (0:Nsamples)'/fs  
model = DiscreteModel(circ, 1/fs)  
y = run!(model, 310_sin.(2π_fsig ._ t))  
using Plots  
plotly()  
Plots.PlotlyBackend()  
plot(t’, y’)  
and the figure is as follows :  
 ![error2](https://global.discourse-cdn.com/julialang/original/3X/3/9/395cc1efd16ce18151818c69073af104cbcc1ab5.png)

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???
