Message Boards Message Boards

Proper syntax for function precision (MMA 12)?

Posted 5 years ago

I just recently updated from version 11.2 -> 12...there apparently are quite a few changes since 11.2....

One being how version >11.3 deal with numbers that approach zero.

I have been using the "bump" equation that is demonstrated in the Inverse Pendulum example for a while now to simulate a push or bump in many projects. However once updating to version 12, the Overflow/underflow has been changed when dealing with the exp. function that approaches zero and now it's effectively broken all of my projects causing errors in many things such as plots or when using NDSolve, causing a 'stiffness' that in version 11.2 never appeared,

The function in question:

bump[t_] := 7 E^(-10 (t - 3)^2) - 3/2 E^(-10 (t - 6)^2) + 3 E^(-10 (t - 9)^2)

error

So my question is, how can I write this function or functions in general with the proper syntax, (increasing working precision, or what-have-you) in order to continue using this function in MMA 11.3 or higher?

Or equally, Is anyone aware of an equally useful function to simulate a pushing/poking force at user defined specific intervals that does not have issues when approaching zero causing Overflow/underflow problems?

As an example I've considered:

bumper[t_] :=  0.5 UnitBox[1.5 (t + -3)] - 0.5 UnitBox[1.5 (t + -6)] + 0.3 UnitBox[1.5 (t + -9)]

and plotting:

working example

However this isn't representative of the reality compared to the bump[t] function I've been using since v11.2

Thanks for the help!

POSTED BY: Mor Bo
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract