cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Differentiation of a discontinuous, piecewise function

janclaeys
1-Newbie

Differentiation of a discontinuous, piecewise function

Dear all,

Is it possible to differentiate a discontinuous (sawtooth-like), piecewise defined function (displacement vs. time) twice so that I get an acceleration curve without spikes?

This question concerns the more recent Mathcad Prime incarnations (v3/3.1).

This could be a trigger for my boss to acquire a Mathcad license, since I am currently working in SMath (a free Mathcad-like prog). However, things in SMath don't evolve like I want...

I used to work in Mathcad 13-15, where I once performed Laplace transforms for integration of discontinuous functions, but I don't know if this approach also applies for differentiations?

Thanks in advance for any feedback!

Kind regards,

Jan

8 REPLIES 8
RichardJ
19-Tanzanite
(To:janclaeys)

If you have displacement vs time that is discontinuous then you clearly have infinite acceleration. The only kind of math that will not show you that is math that is wrong. The only way to avoid the spikes is either to not plot the differential functions at the discontinuous points, or make the displacement vs time function physically realistic (i.e. no discontinuities).

Hi.

The only one piecewise continuous functions that you can use for symbolic calculus is the heaviside step (F + Ctrl G).

The problem is that it's derivative isn't a function, it is a 'distribution'. The symbolic representation for it is Δ(x), but you must to provide your own numeric representation, because there are not only one, actually it is the limit for some succession of functions.

The second derivative of Heaviside step involves Δ(n,x), where n is the derivative degree of Δ, another distribution without an unique numeric funcional representation.

Those both function can be found in the help under "Symbolics and keywords/Symbolic functions".

Best regards.

Alvaro.

fig.gif

‌Thanks Alvaro!

However, I have a displacement function (using Heaviside to isolate a sine-like curve, piecewise defined to add dwell time) and will have to get rid of the vertical sections, as Richard suggests?

I need speed and acceleration curves to define corresponding functions for viscous friction and inertial force.

Jan

Hi.

This kind of a sine-like function?

Best regards.

Alvaro.

fig.gif

Is it possible to differentiate a discontinuous (sawtooth-like), piecewise defined function (displacement vs. time) twice so that I get an acceleration curve without spikes?

What exactly are you looking for?

Just plotting the derivatives, a numerical derivative, a symbolic solution? The latter, as was pointed out by Richard, would be incorrect w/o "spikes".

I look for derived functions, will try to add inclined ‌transition curves instead of vertical ones

Hi Jan

Attached shows how to use Heaviside step to implement a sawtooth displacement, and get the velocity and acceleration, which actually it's zero.

Best regards.

Alvaro.

fig.gif

-MFra-
21-Topaz II
(To:janclaeys)

Hi Jan,

What follows is my attempt to solve your problem, but deepening were born other.

As regards the second derivative, it will be formed by positive Dirac pulses (of unit area, and infinite amplitude) on the rising edges  and by negative pulses on the falling edges of the first derivative.

What to do to avoid the spikes?

sawsaw0.jpg

destructive impulses:

sawsaw2d.jpg

Top Tags