Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Derivation and Integration in MATLAB/SIMULINK

Status
Not open for further replies.

powersys

Advanced Member level 1
Joined
Nov 29, 2005
Messages
440
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Activity points
4,987
derive matlab

I try to implement derivator and integrator in MATLAB/SIMULINK as shown in Figure below. The input to the derivator or integrator is a sinewave. I found out an offset at the output of the integrator. How to remove the offset? The model uses default settings.

 

mowgli

Full Member level 2
Joined
Apr 5, 2002
Messages
149
Helped
34
Reputation
68
Reaction score
11
Trophy points
1,298
Activity points
1,348
matlab derive

Hello powersys,

what you see is due to the fact that mathematically the result of the integration is the calculation of the area (with sign) enclosed by the input curve: in your example the sin input starts with zero phase so the integral initially accumulates positive area for a half period then it decreases to 0 by subtracting the negative area enclosed by the sin wave in the following half period and so on.
If you start the sin with Π/2 offset you should obtain a balanced output from the integrator.

Regards
Mowgli
 

    powersys

    points: 2
    Helpful Answer Positive Rating

powersys

Advanced Member level 1
Joined
Nov 29, 2005
Messages
440
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Activity points
4,987
derivation in matlab

mowgli said:
what you see is due to the fact that mathematically the result of the integration is the calculation of the area (with sign) enclosed by the input curve: in your example the sin input starts with zero phase so the integral initially accumulates positive area for a half period then it decreases to 0 by subtracting the negative area enclosed by the sin wave in the following half period and so on.
If you start the sin with Π/2 offset you should obtain a balanced output from the integrator.
Thanks for your reply. Please help me to solve my problem in this post https://www.edaboard.com/viewtopic.php?t=266029
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top