Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Result of Derivative 2 times then integrator 2 times?

Subject: Result of Derivative 2 times then integrator 2 times?

From: Long

Date: 19 Jul, 2013 05:38:07

Message: 1 of 4

Hello. I have one simple problem with Matlab Simulink.

u --> derivative --> derivative --> integrator --> integrator --> output = u

If we take the derivative of an input signal 2 times and then take the integrator 2 times, we are supposed to get the original input signal.

But when I use a step signal as the input, in the Simulink scope, the output is not the step signal any more, instead, it has very large value. Maybe because the derivative of step signal has a very large value.

So how can I solve the problem? I mean in the Simulink simulation, that I can get output = step signal ??? Not the large value.

Thank you very much

Subject: Result of Derivative 2 times then integrator 2 times?

From: someone

Date: 19 Jul, 2013 13:37:10

Message: 2 of 4

"Long " <longluong_maybach@yahoo.com> wrote in message <ksajbv$4f3$1@newscl01ah.mathworks.com>...
> Hello. I have one simple problem with Matlab Simulink.
>
> u --> derivative --> derivative --> integrator --> integrator --> output = u
>
> If we take the derivative of an input signal 2 times and then take the integrator 2 times, we are supposed to get the original input signal.

Not necessarily. When you integrate a function you also get an "arbitrary" constant that needs to be evaluated from the initial conditions. If you don't account for this I'm guessing it gets really bad when you do it twice without taking into account the initial condition of the first integral.
>
> But when I use a step signal as the input, in the Simulink scope, the output is not the step signal any more, instead, it has very large value. Maybe because the derivative of step signal has a very large value.

As to how Simulink handles this, I'm not sure. (I don't have that toolbox.)
>
> So how can I solve the problem? I mean in the Simulink simulation, that I can get output = step signal ??? Not the large value.
>
> Thank you very much

Subject: Result of Derivative 2 times then integrator 2 times?

From: Phil Goddard

Date: 19 Jul, 2013 21:22:16

Message: 3 of 4


> If we take the derivative of an input signal 2 times and then take the integrator 2 times, we are supposed to get the original input signal.

That's only (possibly) true if the original signal is differentiable, which a step is not.

>
> So how can I solve the problem? I mean in the Simulink simulation, that I can get output = step signal ??? Not the large value.

This isn't a Simulink issue, it's a general mathematics issue.
Working backwards from your (desired) output, you need a signal which integrates to a step.
That would be a durac delta function.
Prior to that you are asking for a signal that integrates to get the durac delta function.
I'm not sure (mathematically) what that looks like.

So in effect you are asking for Simulink to do something that even writing down on paper isn't really well formulated.

You may have better success choosing an input signal that is better defined over the range of interest, such as a sine wave, but even then numerical issues (of taking the derivative) may arise.

Phil.

Subject: Result of Derivative 2 times then integrator 2 times?

From: Long

Date: 20 Jul, 2013 05:39:11

Message: 4 of 4

Thank you very much for giving me the answers, especially from Mr. Phil Goddard.

Because I am doing the simulation for Sliding Mode Control with Simulink and the input control "u" contains the derivative 2 times of desired output "x_desired".
Thus if I choose x_desired as the step signal, the result is not reasonable.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us