Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6020913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:38:13+00:00 2026-05-23T03:38:13+00:00

I need to model an electric rectifier and to plot both in and out

  • 0

I need to model an electric rectifier and to plot both in and out signals with MATLAB. The rectifier is made of a RC circuit which charge as fast as the voltage increases but discharges way slower so the out signal is more or less flat. It’s supposed to look like that:

rectifier from wikipedia.

I tried to code it on MATLAB and I got this (my circuit rectifies negative voltage but same principle):
my figure.

To get the same figure as the one from wikipedia I tried to compute the intersection between the downing exp curve (red) and the rising sinus curve (blue) so I just had to add a sin curve and a downing exp curve at right intervals to get the out signal.
Here is my code:

f=@(x)sin(2*pi*250000*x+pi/2);%oscillateur de référence
f1=@(x)sin(2*pi*250000*x);
g=@(x)exp(-x*10^4);%décharge du détecteur de crête
h=@(x)f(x)-g(x);%intersection des deux fonctions

format long;
inter=fzero(h,[3.82*10^-6,3.90*10^-6]);

y1=g(0:10^-12:inter);
y2=f(inter:10^-12:4*10^-6);
y3=sin(2*pi*250000*(0:10^-12:1*10^-6));

y=-[y3 y1 y2 y1 y2];

y4=-f1(linspace(0,8*10^-6,length(y)));

x=linspace(0,10*10^-6,length(y));%abscisse

plot(x,y,x,y4);

But why is there a gap between the curves on my figure ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:38:14+00:00Added an answer on May 23, 2026 at 3:38 am

    You really don’t need to find the intersection points. You can reproduce the same curve with a series of nested max() calls and logical operations. Here’s an example:

    f=@(x)sin(2*pi*250000*x);
    discharge=1e-6; %# quarter period when discharge begins
    g=@(x)exp(-rem(x-discharge,(1e-5)/2.5)*10^5); %#modulo over the period to repeat. 
    h=@(x)max(f(x).*(x<discharge),max(f(x),g(x)).*(x>=discharge)); %# the rectified signal
    
    y=linspace(0,1e-5,1e4);
    plot(y,f(y),y,h(y))
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a need for a model(?) on my app which basically contains a
Both my Rails model and controller code need to write files to the file
Im currently working on a small project in which I need to model the
I need to model an idea which can be broken down and thought of
I'm working on a Web service in Django, and I need to model a
i have very simple problem. I need to create model, that represent element of
I need to load a model, existing of +/- 20 tables from the database
I need to create a 3D model of a cube with a circular hole
I need to store some data in a Django model. These data are not
I have a prototype model where I need to include the following extension methods

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.