## 45 Reputation

6 years, 297 days

## Hi,  I don't really understand your...

Hi,

I don't really understand your problem but I do have some practice in statistics. Maybe I could provide you some hint or advice but I'd like to have a more precidse idea of  the problem you have.
Could you detail it briefly ?

## OOPS !...

OOPS!
I forgot the SCALING(CONSTRAINED) inside the PLOT command

## My proposal >  resta...

My proposal

 > restart: # 1/ define N+1 points from 0 to 1 by 1/N on sodes AB, BC and CA # #     B #    / \ #   /   \ #  A-----C # N := 10: SideAB := [ seq([k/2, k*sqrt(3.)/2], k in [seq(0..1, 1/evalf(N))]) ]: SideBC := [ seq([1/2+k/2, (1-k)*sqrt(3.)/2], k in [seq(0..1, 1/evalf(N))]) ]: SideCA := [ seq([1-k, 0], k in [seq(0..1, 1/evalf(N))]) ]: # 2.1/ join points in AB to points in CA # 2.2/ join points in BC to points in CA # 2.3/ join points in AB to points in BC # 2.4/ remove axis # 2.5/ write labels alond AB # 2.6/ write labels alond BC # 2.7/ write labels alond CA PLOT(   seq(CURVES([SideAB[k], SideCA[(N+2)-k]], COLOR(RGB, 1, 0, 0)), k = 1..N+1),   seq(CURVES([SideBC[k], SideCA[(N+2)-k]], COLOR(RGB, 0, 1, 0)), k = 1..N+1),   seq(CURVES([SideAB[k], SideBC[(N+2)-k]], COLOR(RGB, 0, 0, 1)), k = 1..N+1),   AXESSTYLE(NONE),   seq(TEXT(SideAB[k] +~ [-0.05,  0   ], sprintf("%3.1f", evalf((k-1)/N))), k = 1..N+1),   seq(TEXT(SideBC[k] +~ [+0.05,  0   ], sprintf("%3.1f", evalf((k-1)/N))), k = 1..N+1),   seq(TEXT(SideCA[k] +~ [ 0   , -0.05], sprintf("%3.1f", evalf((k-1)/N))), k = 1..N+1) )
 >

## @Allan Wittkopf    Even if the...

Even if the dicussion lives its own life without me I still keep a close eye to what is said.

Without trying to interfere between you and Tom, I woukd like to give you some elements and ask you a question.

1/ Elements :

• The system I presented is biuid by Maple, not by me.
More precisely : in the Maple application I develop, users define the geometrival and physical properties of the system to simulate through a set of Maplets. The symbolic ODE system is automatically derived from these informations during a complex process

• The symbolic ODE system is then randomly instanciated (it depends on 20 to 80 parameters where some of them are deterministic quantities, while others are (formally) declared [in a specific maplet] as random variables) according to different strategies : many designs of experiments, Monte-Carlo sampling ...(also specified by the user).

• The goals may be :
• Relaiability Analysis : assess the probability of occurrence of specific events (for example : "the displacement of the mass equals 0.006")
• Sensitivity Analysis : determine, for a given quantity of interest (for example : "the displacement of the mass equals 0.006") and for the chosen statistical distributions of the so-called "random variables", the one of them that are the most responsible of the variation of this quantity of interest.

• Considering the whole process, from the maplet interface to the final probabilistic results and its statistical analysis, the dsolve procedure appears as a very small part of it. So I do not have much time to spent on it ... even if it is a very critical component.
So the temptation to use ODE solvers in a rather blind way : look to the possibilities offered by Maple, do some test s for different systems (formal ODE systems) and different instanciations ; identify promising solvers and use them as "default" in the whole application.

• My first choices were rkf45, ck45 (which seems to have, for the tests I did, the same performances and litations than rkf45) and rosenbrock. This choice was mainly motivated by the possibility to manage, or capture, "events" these solvers propose.

• You have seen that the rhs are piecewise functions (C0 but not C1 in their arguments) and that the solution (at least the one I provided you) alternates "flat" situations and "non flat" ones.
This behaviour has physical explanations and an elegant solution of the instanciated ODE system would be to solve over the whole time range of interest in a piecewise way : identify times when the solution change from "flat" to "non flat" regimes,  use ad hoc ODE solvers over each of them, agregate these pieces of solution to make the global solution. All this rest on the possibility to capture transition times : this is possible (and even quite simply) for transition to "flt" to "non flat" (not for the opposite transition)
For the ODE resolution is just a tiny part of the whole application (clearly one instruction among ten thousands), and probably becasuse I was too lazzy or overconfident in the hability of Maple to provide me a solution without too many endeavor, I choosed to not implement the piecewise strategy sketched above

• Unfortunately appeared that the three previous solvers failed for some formal systems, or some specific instanciations. Lucky I am when at least one of them succeed ; but sometimes all of them fail fior different reasons : they can be errors ("error ... maybe a singularity", or the maximum number of events evaluation is exceeded ...)  or simply the cpu time is prohibitive (remember I do a lot of simulations to assess statistics).

• Very early I have thought to use lsode for it compared favorably to rkf45 or rosenbrock in many published benchmarks. But I was reluctant to do this becaus it does not handle events and because it has a great number of parameters to fix.
This may be a good point for it, but also a drawback : because of the variety of ODEs I have to solve I need a robust solver, not a super efficient which requires the tuning of tens of parameters.
Nevertheless I did some tests (the "no events" limitation can be overpassed)
On the case I gave here, lsode finds the solution in 0.06 sec, rkf45 in 3 sec and rosenbrock in about 450 sec
... an then I encountered this problem of point estimation of sol(t)

• Today I have implemented the "piecewise+agregation" strategy with rkf45C in the "non flat" regimes.
It prooves to be very robust (no failure situation encountered over 250 test cases) and faster (0.7 sec on the test case published) than "global" rkf45

2/ Question :

You write

`sol := dsolve(MC, numeric, method=rosenbrock, compile=true);`

Did you try the "compile = true" option ? If yes, what is the version of Maple you have used (2016 ?)

The problem is that the compile option works only (Maple 18 and 2015) if the system contains only one equation.

## @Carl Love    Help pages for d...

Help pages for dsolve[lsode] are effectively very well documented. And losde has a very large number of parameters (lsode[advanced]). In some sense it was a reason I was afraid of using it and turned to simpler and more classical algorithms (rk or rosenbrock).

As I already said I develop a whole application in Maple, not because I know it for a long time and for its numerical capabilities, but because I need symbolic capabilities. In the many lines I wrote I have only two of them devoted to numeric computations : fsolve and this dsolve.

So, in some sense, "dsolve" is not, or would not have be, my primary concern. But it became.

Using numerical procedures in Maple (not Maple) is quite new for me. Generally I use Fortran or Matlab or Scilab for fast prototyping. It is not paradoxical to be a Maple user since the end of the eighties (I begin with reduce and macsyma) and a numerical analys who developed numerical scheme for solving PDEs.
If I was "provocateur" when I titled my first question, I was not when I said I was a numerical analyst that used Maple since a long time.

As it is not incompatible to say that my main interest today is in statistics and  that I use R for numerics instead of Maple, and Maple for symbolic calculs over Random Variables.

## @tomleslie  I am going to provide y...

I am going to provide you a disorderly answer :

1/ The version I used is Maple 2015 (Maple 18 behaves the same way) ; for Windows XP, 7, (64 bits), Mac El Capitan and Linux (not a PC) the same behaviour is found.
The fact you catch an error with Maple 2016 is very interesting because I am about to use it.

2/ I guess maxfun=-1 in Maple 2016 is intended to be the equivalent of maxfun=0 in Maple 15 (?) : it authorizes  an unlimited number og function evaluations ... Is that it ?

3/ Skip to the second par of your answer. I too observed that reversing the order of point evaluation (her back from 8.3s to 7.8s) changes the results ... and (I am not sure always) retrieve the ones corresponding to the odeplot

4/ back to your first claim (I apologize for this messy answer) "The fundamental problem is the default stepSize/error control which is being used." : I would me puzzled if the command "sol := dsolve(...)" ende in some error because of a bad time step or tolerance, or an insufficient amount of maxfun (see the test with rkf 45 where the default "maxfun=30000" has been set to 500.000 to obtain a full range solution [I did not check for sol('numfun') to see the real number of evaluations rkf45 did]).
I often face these kind of difficulties (which is the reason why I test different solvers before using one for a specific kind of problems)

It seems reasonable to think that if the dsolve procedure ends without error and reaches the highest time of interest (say here 10s) ; and the odeplot is (seems) correct ... than I expect a point evaluation is correct.

5/ "Basically always order your points in term of "distance" from your initial value" : that is a good advice, not always relevant (with all due respect).
Why do I compute sol(8.0) ???
As I already answered to someone here, I want to determine the time T where some "stroke" S is reached by the moving mass ; more precisely : "find T such that X(T)=S"

For what I know, it is not possible (at least I did not succeed) to write T := solve(sol(t), ...). So I wrote a fixed point method to find this value of T. The search range is [0, 10] (for the cas presented here) and, within it, I repeatedly eval sol(t) for different values of t.

I use the same method with a solver (ie rkf45) that handle events (it would be the event [[X(t)-S, none]]), because the processe of events capturing dramatically increases the computational time if many events are stated.

## An answer that raises a lot of questions...

Great thanks Doug for your enlightning talk.

• First it seems to me that only a few person know exactly how an instruction like sol(0.782) really operates : that is very disturbing for someone like me who, as a numerical analyst by training, implemented a lot of numerical algorithms (Fortran) or used to use numerical librairies such that IMSL. So, to quote myself "Can we trust Maple" I would say that my blind confidence in it is somewhat shaken.
Maybe I am little bit old fashioned or too "analytical" (a typically french bias)  but I believe that one should trust only what we clearly understand.

• Next, your analysis does not explain why rkf45 (or ck45 or rosenbrock) have a complete different behaviour than lsode : why does sol(0.728) give the correct answer for rkf45 and the wrong with lsode ?
Your four proposals for the meaning of sol(0.728 are very interesting. You probably know that the "ouput=procedure" is the default output for dsolve. The reason of this is not clear for me because (reminisence of may past activities) an array seems the most natural output of a numerical procedure. But if you have ever used this kind of ouput, you must have noticed that the plot of the solution is very slow compared to the time odeplot takes.
Which seems to suggest different evaluation strategies ... and not to plead for your fourth proposal (?)

To answer your question "Do you do anything to limit the stepsize in a manner that ensures that entire pieces of the RHS are not completely skipped?" : No.

I tried to handle the problem in a quite radical way : In an initial step I determine the transition times between the different regimes (the mass stays still or moves), next I compute numerically pieces of the solution (with rkf45 because of the facilities it offers in events managing) and finally I agregate the different pieces in a global solution.
It is conceptually more statisfactory than using "blindly" the same solver over the whole time range ; It was an old idea of mine but I was to lazzy to code it.

Concerning the help pages about dsolve : they contain a lot of useful informations ... but they are also among the most confuse (specially the ones concerning the events).

Happily books always exist and the Sundials library (LLNL), probably the one Maple incorporates, is very well documented.

So thank again for your contribution.

The way odeplot, for example, proceeds is quite mysterious for me : it is fast, very fast in fact, much faster than

## THANKS...

@tomleslie

P.S.  thanks for the cleaning you did in diffEqProd.mw !

## @tomleslie    Does scotch real...

Does scotch really help to sleep ?

By the way thanks to working so late.

Personnally get up and I wait for my coffe.
The worksheet can be load from the link below  (of course change the path of the MC.m file)

https://www.dropbox.com/s/qdxbh793n2seztt/LSODE_test.mw?dl=0

## @Markiyan Hirnyk    Yes , and ...

Yes , and as Matlab file too.

## Apologies...

My apologies for having hit you !

The mechanical  systems I simulate (even if saying that is very restrictive because more than 99% of the application I develop performs symbilic calculus and the "dsolve" is practically the only numerical operation I do) are always of the same type (even if some may have many moving masses).

Generally the system are formally complex because

1/ The RHS of the dV/dt equation is often a sum of many piecewise (linear or not) functions.

2/  Tricks for managing the different regimes (yet other piecewise functions) are introduced as multiplicative factors of the already complex RHSs (look also to my last reply to Carl)

Now, I agree, as myself a numerical analyst by training : it is not unusual at all to have methods that sometimes work well and sometimes not, even for slight modifications in the inputs. properties such that stability, consistency and so on are generally established in "ideal" situations sometimes quite far from the realistic ones.

But I do not believe it is the point here.

Mainly because odeplot gives the correct solution ... and what does odeplot do if not repeatedly evaluating the solution ("sol") for different times  ?

What really bother me is that the single evaluation sol(t) does not give the same answer odeplot returns !

Think to that :plot(sin(x), x=0..2*Pi) returns the correct graph, but sin(Pi)=1 ... that is this kind of disturbing situation I describe here.

Maybe the guilty is not Maple (maybe, at the end, some of you will find it's me ?), maybe it is the C or C++ implementation of lsode, or the communication between the worksheet level and some compiled code.

## @Christopher2222    As I said ...

As I said to Preben my question was voluntarily provocative ...
There is no hidden agenda here : no comparisons to Mahematica and no purpose to discredit Maple
(all the more so I am a Maple user since a long time).

For years I browse the questions/answers here and this is the first time I ask one.

Usually I can handle  the problems I face. But I develop  currently a very big Maple based application (about 10 000 lines of code) which , I think, is quite unusual in the Maple community.

So new problems appear and the answer, even from the hotline, is sometimes "unsatisfactory". I think the problem I submit here is one of them

So, YES, in maple we trust

## @tomleslie    Hi again, the "M...

Hi again, the "MC.m" file can be accessed here

https://www.dropbox.com/s/j862agxoubdag4z/MC.m?dl=0

## @Markiyan Hirnyk    Carl just ...

Carl just got to offer me a solution
Thought there was some specific repository in MaplePrimes

You can access the ".m" file here (unzipped)

https://www.dropbox.com/s/j862agxoubdag4z/MC.m?dl=0

P.S. the name of the system is "MC". To visualize it jusr type

> eval(MC);

## @Carl Love  Of course, how supid I ...

Of course, how supid I am !

Thanks Carl

> eval(MC);
{.2345666667*(diff(V[1](t), t)) =
(-5.860656250-193.7500000*X[1](t)+(1/2)*(PIECEWISE([-2521.739130*X[1](t)-.508347
8261, 0.300000e-4 <= X[1](t) and X[1](t) < 0.760000e-4], [0,
otherwise]))+(1/2)*(PIECEWISE([-19466.66667*X[1](t), 0. <= X[1](t) and X[1](t) <
0.300000e-4], [0,
otherwise]))+(1/2)*(PIECEWISE([1305.263158*X[1](t)-8.623684211, 0.659000e-2 <=
X[1](t) and X[1](t) <= 0.668500e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2205.882353*X[1](t)-14.55876471, 0.652200e-2 <=
X[1](t) and X[1](t) <= 0.659000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-5181.818182*X[1](t)+33.62381818, 0.651100e-2 <=
X[1](t) and X[1](t) <= 0.652200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([121.9512195*X[1](t)-.9090243902, 0.647000e-2 <=
X[1](t) and X[1](t) <= 0.651100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([1000.000000*X[1](t)-6.590000000, 0.644200e-2 <=
X[1](t) and X[1](t) <= 0.647000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-106.0606061*X[1](t)+.5352424245, 0.637600e-2 <=
X[1](t) and X[1](t) <= 0.644200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-7400.000000*X[1](t)+47.04140000, 0.636600e-2 <=
X[1](t) and X[1](t) <= 0.637600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-1364.285714*X[1](t)+8.618042855, 0.622600e-2 <=
X[1](t) and X[1](t) <= 0.636600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-1560.000000*X[1](t)+9.836560000, 0.615100e-2 <=
X[1](t) and X[1](t) <= 0.622600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-2242.424242*X[1](t)+14.03415151, 0.605200e-2 <=
X[1](t) and X[1](t) <= 0.615100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-2613.636364*X[1](t)+16.28072727, 0.600800e-2 <=
X[1](t) and X[1](t) <= 0.605200e-2], [0, otherwise]))-.2108934567*(PIECEWISE([0,
t < 0], [-367.8000000*t, t < 0.500000e-1], [-17.02230769-27.35384615*t, t <
.700000], [-29.01250000-10.22500000*t, t < 1.90000],
[-95.08500000+24.55000000*t, t < 2.10000], [-1459.770000+674.4000000*t, t <
2.15000], [-9.81000, t < 3.00000], [20.27142858-10.02714286*t, t < 10.0000], [0,
10.0000 <=
t]))+(PIECEWISE([60.2235333525032*abs(V[1](t))+11322.0119180134*abs(V[1](t))*X[1
](t)+2211.80145999893*abs(V[1](t))^(3/2)+133745.673287464*abs(V[1](t))^(3/2)*X[1
](t)+268619.007660551*abs(V[1](t))^2-2061016.30853200*abs(V[1](t))^2*X[1](t)+150
751.035327351*abs(V[1](t))^(5/2)+9360854.91199159*abs(V[1](t))^(5/2)*X[1](t),
V[1](t) < 0],
[-93.2093363318623*abs(V[1](t))-17119.3992260773*abs(V[1](t))*X[1](t)-527.919951
282059*abs(V[1](t))^(3/2)+132509.093439568*abs(V[1](t))^(3/2)*X[1](t)-295176.087
800302*abs(V[1](t))^2-1808560.92210368*abs(V[1](t))^2*X[1](t)-67565.7931654421*a
bs(V[1](t))^(5/2)+8702690.48304019*abs(V[1](t))^(5/2)*X[1](t),
otherwise]))+(1/2)*(PIECEWISE([2925.531915*X[1](t)-21.68861702, 0.689400e-2 <=
X[1](t) and X[1](t) < 0.708200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2574.162679*X[1](t)-19.26627751, 0.668500e-2 <=
X[1](t) and X[1](t) < 0.689400e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([1305.263158*X[1](t)-10.78368421, 0.659000e-2 <=
X[1](t) and X[1](t) < 0.668500e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2205.882353*X[1](t)-16.71876471, 0.652200e-2 <=
X[1](t) and X[1](t) < 0.659000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-5181.818182*X[1](t)+31.46381818, 0.651100e-2 <=
X[1](t) and X[1](t) < 0.652200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([121.9512195*X[1](t)-3.069024390, 0.647000e-2 <=
X[1](t) and X[1](t) < 0.651100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([1000.000000*X[1](t)-8.750000000, 0.644200e-2 <=
X[1](t) and X[1](t) < 0.647000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-106.0606061*X[1](t)-1.624757576, 0.637600e-2 <=
X[1](t) and X[1](t) < 0.644200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-7400.000000*X[1](t)+44.88140000, 0.636600e-2 <=
X[1](t) and X[1](t) < 0.637600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-1364.285714*X[1](t)+6.458042855, 0.622600e-2 <=
X[1](t) and X[1](t) < 0.636600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-1560.000000*X[1](t)+7.676560000, 0.615100e-2 <=
X[1](t) and X[1](t) < 0.622600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2574.162679*X[1](t)-17.10627751, 0.668500e-2 <=
X[1](t) and X[1](t) <= 0.689400e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-2242.424242*X[1](t)+11.87415151, 0.605200e-2 <=
X[1](t) and X[1](t) < 0.615100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-2613.636364*X[1](t)+14.12072727, 0.600800e-2 <=
X[1](t) and X[1](t) < 0.605200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-10636.36364*X[1](t)+62.32127275, 0.598600e-2 <=
X[1](t) and X[1](t) < 0.600800e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-3891.891892*X[1](t)+21.94886487, 0.594900e-2 <=
X[1](t) and X[1](t) < 0.598600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-953.8461538*X[1](t)+4.470430769, 0.581900e-2 <=
X[1](t) and X[1](t) < 0.594900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-16.83324566*X[1](t)-.9820473435, 0.391800e-2 <=
X[1](t) and X[1](t) < 0.581900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-39.57946815*X[1](t)-.8929276438, 0.230100e-2 <=
X[1](t) and X[1](t) < 0.391800e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-49.21579232*X[1](t)-.8707544619, 0.452000e-3 <=
X[1](t) and X[1](t) < 0.230100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-513.2978723*X[1](t)-.6609893617, 0.760000e-4 <=
X[1](t) and X[1](t) < 0.452000e-3], [0,
otherwise]))+(1/2)*(PIECEWISE([39.57946815*X[1](t)+.8929276438, 0.230100e-2 <=
X[1](t) and X[1](t) <= 0.391800e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([11516.66667*X[1](t)-83.40405002, 0.747300e-2 <=
X[1](t) and X[1](t) <= 0.753300e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([59000.00000*X[1](t)-438.2470000, 0.746900e-2 <=
X[1](t) and X[1](t) <= 0.747300e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([49.21579232*X[1](t)+.8707544619, 0.452000e-3 <=
X[1](t) and X[1](t) <= 0.230100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([300.0000000*X[1](t)+.183300000, 0.743900e-2 <=
X[1](t) and X[1](t) <= 0.746900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([513.2978723*X[1](t)+.6609893617, 0.760000e-4 <=
X[1](t) and X[1](t) <= 0.452000e-3], [0,
otherwise]))+(1/2)*(PIECEWISE([4263.374486*X[1](t)-29.30024280, 0.719600e-2 <=
X[1](t) and X[1](t) <= 0.743900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2521.739130*X[1](t)+.5083478261, 0.300000e-4 <=
X[1](t) and X[1](t) <= 0.760000e-4], [0,
otherwise]))+(1/2)*(PIECEWISE([1778.846154*X[1](t)-11.42157692, 0.709200e-2 <=
X[1](t) and X[1](t) <= 0.719600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([19466.66667*X[1](t), 0. <= X[1](t) and X[1](t) <=
0.300000e-4], [0,
otherwise]))+(1/2)*(PIECEWISE([400.0000000*X[1](t)-1.642800000, 0.708200e-2 <=
X[1](t) and X[1](t) <= 0.709200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([722000.0000*X[1](t)-5465.681000, 0.757900e-2 <=
X[1](t) and X[1](t) < 0.758000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([187714.2857*X[1](t)-1416.329571, 0.757200e-2 <=
X[1](t) and X[1](t) < 0.757900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([38225.80645*X[1](t)-284.4028064, 0.754100e-2 <=
X[1](t) and X[1](t) < 0.757200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([333375.0000*X[1](t)-2510.122875, 0.753300e-2 <=
X[1](t) and X[1](t) < 0.754100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([11516.66667*X[1](t)-85.56405002, 0.747300e-2 <=
X[1](t) and X[1](t) < 0.753300e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([59000.00000*X[1](t)-440.4070000, 0.746900e-2 <=
X[1](t) and X[1](t) < 0.747300e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([300.0000000*X[1](t)-1.976700000, 0.743900e-2 <=
X[1](t) and X[1](t) < 0.746900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([4263.374486*X[1](t)-31.46024280, 0.719600e-2 <=
X[1](t) and X[1](t) < 0.743900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([1778.846154*X[1](t)-13.58157692, 0.709200e-2 <=
X[1](t) and X[1](t) < 0.719600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([400.0000000*X[1](t)-3.802800000, 0.708200e-2 <=
X[1](t) and X[1](t) < 0.709200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2925.531915*X[1](t)-19.52861702, 0.689400e-2 <=
X[1](t) and X[1](t) <= 0.708200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-10636.36364*X[1](t)+64.48127275, 0.598600e-2 <=
X[1](t) and X[1](t) <= 0.600800e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([722000.0000*X[1](t)-5463.521000, 0.757900e-2 <=
X[1](t) and X[1](t) <= 0.758000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-3891.891892*X[1](t)+24.10886487, 0.594900e-2 <=
X[1](t) and X[1](t) <= 0.598600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([187714.2857*X[1](t)-1414.169571, 0.757200e-2 <=
X[1](t) and X[1](t) <= 0.757900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-953.8461538*X[1](t)+6.630430769, 0.581900e-2 <=
X[1](t) and X[1](t) <= 0.594900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([38225.80645*X[1](t)-282.2428064, 0.754100e-2 <=
X[1](t) and X[1](t) <= 0.757200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([16.83324566*X[1](t)+.9820473435, 0.391800e-2 <=
X[1](t) and X[1](t) <= 0.581900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([333375.0000*X[1](t)-2507.962875, 0.753300e-2 <=
X[1](t) and X[1](t) <= 0.754100e-2], [0,
otherwise]))+(1/2)*((PIECEWISE([-2521.739130*X[1](t)-.5083478261, 0.300000e-4 <=
X[1](t) and X[1](t) < 0.760000e-4], [0,
otherwise]))+(PIECEWISE([-19466.66667*X[1](t), 0. <= X[1](t) and X[1](t) <
0.300000e-4], [0, otherwise]))-(PIECEWISE([1305.263158*X[1](t)-8.623684211,
0.659000e-2 <= X[1](t) and X[1](t) <= 0.668500e-2], [0,
otherwise]))-(PIECEWISE([2205.882353*X[1](t)-14.55876471, 0.652200e-2 <= X[1](t)
and X[1](t) <= 0.659000e-2], [0,
otherwise]))-(PIECEWISE([-5181.818182*X[1](t)+33.62381818, 0.651100e-2 <=
X[1](t) and X[1](t) <= 0.652200e-2], [0,
otherwise]))-(PIECEWISE([121.9512195*X[1](t)-.9090243902, 0.647000e-2 <= X[1](t)
and X[1](t) <= 0.651100e-2], [0,
otherwise]))-(PIECEWISE([1000.000000*X[1](t)-6.590000000, 0.644200e-2 <= X[1](t)
and X[1](t) <= 0.647000e-2], [0,
otherwise]))-(PIECEWISE([-106.0606061*X[1](t)+.5352424245, 0.637600e-2 <=
X[1](t) and X[1](t) <= 0.644200e-2], [0,
otherwise]))-(PIECEWISE([-7400.000000*X[1](t)+47.04140000, 0.636600e-2 <=
X[1](t) and X[1](t) <= 0.637600e-2], [0,
otherwise]))-(PIECEWISE([-1364.285714*X[1](t)+8.618042855, 0.622600e-2 <=
X[1](t) and X[1](t) <= 0.636600e-2], [0,
otherwise]))-(PIECEWISE([-1560.000000*X[1](t)+9.836560000, 0.615100e-2 <=
X[1](t) and X[1](t) <= 0.622600e-2], [0,
otherwise]))-(PIECEWISE([-2242.424242*X[1](t)+14.03415151, 0.605200e-2 <=
X[1](t) and X[1](t) <= 0.615100e-2], [0,
otherwise]))-(PIECEWISE([-2613.636364*X[1](t)+16.28072727, 0.600800e-2 <=
X[1](t) and X[1](t) <= 0.605200e-2], [0,
otherwise]))+(PIECEWISE([2925.531915*X[1](t)-21.68861702, 0.689400e-2 <= X[1](t)
and X[1](t) < 0.708200e-2], [0,
otherwise]))+(PIECEWISE([2574.162679*X[1](t)-19.26627751, 0.668500e-2 <= X[1](t)
and X[1](t) < 0.689400e-2], [0,
otherwise]))+(PIECEWISE([1305.263158*X[1](t)-10.78368421, 0.659000e-2 <= X[1](t)
and X[1](t) < 0.668500e-2], [0,
otherwise]))+(PIECEWISE([2205.882353*X[1](t)-16.71876471, 0.652200e-2 <= X[1](t)
and X[1](t) < 0.659000e-2], [0,
otherwise]))+(PIECEWISE([-5181.818182*X[1](t)+31.46381818, 0.651100e-2 <=
X[1](t) and X[1](t) < 0.652200e-2], [0,
otherwise]))+(PIECEWISE([121.9512195*X[1](t)-3.069024390, 0.647000e-2 <= X[1](t)
and X[1](t) < 0.651100e-2], [0,
otherwise]))+(PIECEWISE([1000.000000*X[1](t)-8.750000000, 0.644200e-2 <= X[1](t)
and X[1](t) < 0.647000e-2], [0,
otherwise]))+(PIECEWISE([-106.0606061*X[1](t)-1.624757576, 0.637600e-2 <=
X[1](t) and X[1](t) < 0.644200e-2], [0,
otherwise]))+(PIECEWISE([-7400.000000*X[1](t)+44.88140000, 0.636600e-2 <=
X[1](t) and X[1](t) < 0.637600e-2], [0,
otherwise]))+(PIECEWISE([-1364.285714*X[1](t)+6.458042855, 0.622600e-2 <=
X[1](t) and X[1](t) < 0.636600e-2], [0,
otherwise]))+(PIECEWISE([-1560.000000*X[1](t)+7.676560000, 0.615100e-2 <=
X[1](t) and X[1](t) < 0.622600e-2], [0,
otherwise]))-(PIECEWISE([2574.162679*X[1](t)-17.10627751, 0.668500e-2 <= X[1](t)
and X[1](t) <= 0.689400e-2], [0,
otherwise]))+(PIECEWISE([-2242.424242*X[1](t)+11.87415151, 0.605200e-2 <=
X[1](t) and X[1](t) < 0.615100e-2], [0,
otherwise]))+(PIECEWISE([-2613.636364*X[1](t)+14.12072727, 0.600800e-2 <=
X[1](t) and X[1](t) < 0.605200e-2], [0,
otherwise]))+(PIECEWISE([-10636.36364*X[1](t)+62.32127275, 0.598600e-2 <=
X[1](t) and X[1](t) < 0.600800e-2], [0,
otherwise]))+(PIECEWISE([-3891.891892*X[1](t)+21.94886487, 0.594900e-2 <=
X[1](t) and X[1](t) < 0.598600e-2], [0,
otherwise]))+(PIECEWISE([-953.8461538*X[1](t)+4.470430769, 0.581900e-2 <=
X[1](t) and X[1](t) < 0.594900e-2], [0,
otherwise]))+(PIECEWISE([-16.83324566*X[1](t)-.9820473435, 0.391800e-2 <=
X[1](t) and X[1](t) < 0.581900e-2], [0,
otherwise]))+(PIECEWISE([-39.57946815*X[1](t)-.8929276438, 0.230100e-2 <=
X[1](t) and X[1](t) < 0.391800e-2], [0,
otherwise]))+(PIECEWISE([-49.21579232*X[1](t)-.8707544619, 0.452000e-3 <=
X[1](t) and X[1](t) < 0.230100e-2], [0,
otherwise]))+(PIECEWISE([-513.2978723*X[1](t)-.6609893617, 0.760000e-4 <=
X[1](t) and X[1](t) < 0.452000e-3], [0,
otherwise]))-(PIECEWISE([39.57946815*X[1](t)+.8929276438, 0.230100e-2 <= X[1](t)
and X[1](t) <= 0.391800e-2], [0,
otherwise]))-(PIECEWISE([11516.66667*X[1](t)-83.40405002, 0.747300e-2 <= X[1](t)
and X[1](t) <= 0.753300e-2], [0,
otherwise]))-(PIECEWISE([59000.00000*X[1](t)-438.2470000, 0.746900e-2 <= X[1](t)
and X[1](t) <= 0.747300e-2], [0,
otherwise]))-(PIECEWISE([49.21579232*X[1](t)+.8707544619, 0.452000e-3 <= X[1](t)
and X[1](t) <= 0.230100e-2], [0,
otherwise]))-(PIECEWISE([300.0000000*X[1](t)+.183300000, 0.743900e-2 <= X[1](t)
and X[1](t) <= 0.746900e-2], [0,
otherwise]))-(PIECEWISE([513.2978723*X[1](t)+.6609893617, 0.760000e-4 <= X[1](t)
and X[1](t) <= 0.452000e-3], [0,
otherwise]))-(PIECEWISE([4263.374486*X[1](t)-29.30024280, 0.719600e-2 <= X[1](t)
and X[1](t) <= 0.743900e-2], [0,
otherwise]))-(PIECEWISE([2521.739130*X[1](t)+.5083478261, 0.300000e-4 <= X[1](t)
and X[1](t) <= 0.760000e-4], [0,
otherwise]))-(PIECEWISE([1778.846154*X[1](t)-11.42157692, 0.709200e-2 <= X[1](t)
and X[1](t) <= 0.719600e-2], [0, otherwise]))-(PIECEWISE([19466.66667*X[1](t),
0. <= X[1](t) and X[1](t) <= 0.300000e-4], [0,
otherwise]))-(PIECEWISE([400.0000000*X[1](t)-1.642800000, 0.708200e-2 <= X[1](t)
and X[1](t) <= 0.709200e-2], [0,
otherwise]))+(PIECEWISE([722000.0000*X[1](t)-5465.681000, 0.757900e-2 <= X[1](t)
and X[1](t) < 0.758000e-2], [0,
otherwise]))+(PIECEWISE([187714.2857*X[1](t)-1416.329571, 0.757200e-2 <= X[1](t)
and X[1](t) < 0.757900e-2], [0,
otherwise]))+(PIECEWISE([38225.80645*X[1](t)-284.4028064, 0.754100e-2 <= X[1](t)
and X[1](t) < 0.757200e-2], [0,
otherwise]))+(PIECEWISE([333375.0000*X[1](t)-2510.122875, 0.753300e-2 <= X[1](t)
and X[1](t) < 0.754100e-2], [0,
otherwise]))+(PIECEWISE([11516.66667*X[1](t)-85.56405002, 0.747300e-2 <= X[1](t)
and X[1](t) < 0.753300e-2], [0,
otherwise]))+(PIECEWISE([59000.00000*X[1](t)-440.4070000, 0.746900e-2 <= X[1](t)
and X[1](t) < 0.747300e-2], [0,
otherwise]))+(PIECEWISE([300.0000000*X[1](t)-1.976700000, 0.743900e-2 <= X[1](t)
and X[1](t) < 0.746900e-2], [0,
otherwise]))+(PIECEWISE([4263.374486*X[1](t)-31.46024280, 0.719600e-2 <= X[1](t)
and X[1](t) < 0.743900e-2], [0,
otherwise]))+(PIECEWISE([1778.846154*X[1](t)-13.58157692, 0.709200e-2 <= X[1](t)
and X[1](t) < 0.719600e-2], [0,
otherwise]))+(PIECEWISE([400.0000000*X[1](t)-3.802800000, 0.708200e-2 <= X[1](t)
and X[1](t) < 0.709200e-2], [0,
otherwise]))-(PIECEWISE([2925.531915*X[1](t)-19.52861702, 0.689400e-2 <= X[1](t)
and X[1](t) <= 0.708200e-2], [0,
otherwise]))-(PIECEWISE([-10636.36364*X[1](t)+64.48127275, 0.598600e-2 <=
X[1](t) and X[1](t) <= 0.600800e-2], [0,
otherwise]))-(PIECEWISE([722000.0000*X[1](t)-5463.521000, 0.757900e-2 <= X[1](t)
and X[1](t) <= 0.758000e-2], [0,
otherwise]))-(PIECEWISE([-3891.891892*X[1](t)+24.10886487, 0.594900e-2 <=
X[1](t) and X[1](t) <= 0.598600e-2], [0,
otherwise]))-(PIECEWISE([187714.2857*X[1](t)-1414.169571, 0.757200e-2 <= X[1](t)
and X[1](t) <= 0.757900e-2], [0,
otherwise]))-(PIECEWISE([-953.8461538*X[1](t)+6.630430769, 0.581900e-2 <=
X[1](t) and X[1](t) <= 0.594900e-2], [0,
otherwise]))-(PIECEWISE([38225.80645*X[1](t)-282.2428064, 0.754100e-2 <= X[1](t)
and X[1](t) <= 0.757200e-2], [0,
otherwise]))-(PIECEWISE([16.83324566*X[1](t)+.9820473435, 0.391800e-2 <= X[1](t)
and X[1](t) <= 0.581900e-2], [0,
otherwise]))-(PIECEWISE([333375.0000*X[1](t)-2507.962875, 0.753300e-2 <= X[1](t)
and X[1](t) <= 0.754100e-2], [0,
otherwise])))*tanh(26466.52412*V[1](t)))*(PIECEWISE([PIECEWISE([0, X[1](t) <=
0.987586956215446e-3], [1, otherwise]),
-193.7500000*X[1](t)+(1/2)*(PIECEWISE([-2521.739130*X[1](t)-.5083478261,
0.300000e-4 <= X[1](t) and X[1](t) < 0.760000e-4], [0,
otherwise]))+(1/2)*(PIECEWISE([-19466.66667*X[1](t), 0. <= X[1](t) and X[1](t) <
0.300000e-4], [0,
otherwise]))+(1/2)*(PIECEWISE([1305.263158*X[1](t)-8.623684211, 0.659000e-2 <=
X[1](t) and X[1](t) <= 0.668500e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2205.882353*X[1](t)-14.55876471, 0.652200e-2 <=
X[1](t) and X[1](t) <= 0.659000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-5181.818182*X[1](t)+33.62381818, 0.651100e-2 <=
X[1](t) and X[1](t) <= 0.652200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([121.9512195*X[1](t)-.9090243902, 0.647000e-2 <=
X[1](t) and X[1](t) <= 0.651100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([1000.000000*X[1](t)-6.590000000, 0.644200e-2 <=
X[1](t) and X[1](t) <= 0.647000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-106.0606061*X[1](t)+.5352424245, 0.637600e-2 <=
X[1](t) and X[1](t) <= 0.644200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-7400.000000*X[1](t)+47.04140000, 0.636600e-2 <=
X[1](t) and X[1](t) <= 0.637600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-1364.285714*X[1](t)+8.618042855, 0.622600e-2 <=
X[1](t) and X[1](t) <= 0.636600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-1560.000000*X[1](t)+9.836560000, 0.615100e-2 <=
X[1](t) and X[1](t) <= 0.622600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-2242.424242*X[1](t)+14.03415151, 0.605200e-2 <=
X[1](t) and X[1](t) <= 0.615100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-2613.636364*X[1](t)+16.28072727, 0.600800e-2 <=
X[1](t) and X[1](t) <= 0.605200e-2], [0, otherwise]))-.2108934567*(PIECEWISE([0,
t < 0], [-367.8000000*t, t < 0.500000e-1], [-17.02230769-27.35384615*t, t <
.700000], [-29.01250000-10.22500000*t, t < 1.90000],
[-95.08500000+24.55000000*t, t < 2.10000], [-1459.770000+674.4000000*t, t <
2.15000], [-9.81000, t < 3.00000], [20.27142858-10.02714286*t, t < 10.0000], [0,
10.0000 <=
t]))+(PIECEWISE([60.2235333525032*abs(V[1](t))+11322.0119180134*abs(V[1](t))*X[1
](t)+2211.80145999893*abs(V[1](t))^(3/2)+133745.673287464*abs(V[1](t))^(3/2)*X[1
](t)+268619.007660551*abs(V[1](t))^2-2061016.30853200*abs(V[1](t))^2*X[1](t)+150
751.035327351*abs(V[1](t))^(5/2)+9360854.91199159*abs(V[1](t))^(5/2)*X[1](t),
V[1](t) < 0],
[-93.2093363318623*abs(V[1](t))-17119.3992260773*abs(V[1](t))*X[1](t)-527.919951
282059*abs(V[1](t))^(3/2)+132509.093439568*abs(V[1](t))^(3/2)*X[1](t)-295176.087
800302*abs(V[1](t))^2-1808560.92210368*abs(V[1](t))^2*X[1](t)-67565.7931654421*a
bs(V[1](t))^(5/2)+8702690.48304019*abs(V[1](t))^(5/2)*X[1](t),
otherwise]))+(1/2)*(PIECEWISE([2925.531915*X[1](t)-21.68861702, 0.689400e-2 <=
X[1](t) and X[1](t) < 0.708200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2574.162679*X[1](t)-19.26627751, 0.668500e-2 <=
X[1](t) and X[1](t) < 0.689400e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([1305.263158*X[1](t)-10.78368421, 0.659000e-2 <=
X[1](t) and X[1](t) < 0.668500e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2205.882353*X[1](t)-16.71876471, 0.652200e-2 <=
X[1](t) and X[1](t) < 0.659000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-5181.818182*X[1](t)+31.46381818, 0.651100e-2 <=
X[1](t) and X[1](t) < 0.652200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([121.9512195*X[1](t)-3.069024390, 0.647000e-2 <=
X[1](t) and X[1](t) < 0.651100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([1000.000000*X[1](t)-8.750000000, 0.644200e-2 <=
X[1](t) and X[1](t) < 0.647000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-106.0606061*X[1](t)-1.624757576, 0.637600e-2 <=
X[1](t) and X[1](t) < 0.644200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-7400.000000*X[1](t)+44.88140000, 0.636600e-2 <=
X[1](t) and X[1](t) < 0.637600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-1364.285714*X[1](t)+6.458042855, 0.622600e-2 <=
X[1](t) and X[1](t) < 0.636600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-1560.000000*X[1](t)+7.676560000, 0.615100e-2 <=
X[1](t) and X[1](t) < 0.622600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2574.162679*X[1](t)-17.10627751, 0.668500e-2 <=
X[1](t) and X[1](t) <= 0.689400e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-2242.424242*X[1](t)+11.87415151, 0.605200e-2 <=
X[1](t) and X[1](t) < 0.615100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-2613.636364*X[1](t)+14.12072727, 0.600800e-2 <=
X[1](t) and X[1](t) < 0.605200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-10636.36364*X[1](t)+62.32127275, 0.598600e-2 <=
X[1](t) and X[1](t) < 0.600800e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-3891.891892*X[1](t)+21.94886487, 0.594900e-2 <=
X[1](t) and X[1](t) < 0.598600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-953.8461538*X[1](t)+4.470430769, 0.581900e-2 <=
X[1](t) and X[1](t) < 0.594900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-16.83324566*X[1](t)-.9820473435, 0.391800e-2 <=
X[1](t) and X[1](t) < 0.581900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-39.57946815*X[1](t)-.8929276438, 0.230100e-2 <=
X[1](t) and X[1](t) < 0.391800e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-49.21579232*X[1](t)-.8707544619, 0.452000e-3 <=
X[1](t) and X[1](t) < 0.230100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-513.2978723*X[1](t)-.6609893617, 0.760000e-4 <=
X[1](t) and X[1](t) < 0.452000e-3], [0,
otherwise]))+(1/2)*(PIECEWISE([39.57946815*X[1](t)+.8929276438, 0.230100e-2 <=
X[1](t) and X[1](t) <= 0.391800e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([11516.66667*X[1](t)-83.40405002, 0.747300e-2 <=
X[1](t) and X[1](t) <= 0.753300e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([59000.00000*X[1](t)-438.2470000, 0.746900e-2 <=
X[1](t) and X[1](t) <= 0.747300e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([49.21579232*X[1](t)+.8707544619, 0.452000e-3 <=
X[1](t) and X[1](t) <= 0.230100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([300.0000000*X[1](t)+.183300000, 0.743900e-2 <=
X[1](t) and X[1](t) <= 0.746900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([513.2978723*X[1](t)+.6609893617, 0.760000e-4 <=
X[1](t) and X[1](t) <= 0.452000e-3], [0,
otherwise]))+(1/2)*(PIECEWISE([4263.374486*X[1](t)-29.30024280, 0.719600e-2 <=
X[1](t) and X[1](t) <= 0.743900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2521.739130*X[1](t)+.5083478261, 0.300000e-4 <=
X[1](t) and X[1](t) <= 0.760000e-4], [0,
otherwise]))+(1/2)*(PIECEWISE([1778.846154*X[1](t)-11.42157692, 0.709200e-2 <=
X[1](t) and X[1](t) <= 0.719600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([19466.66667*X[1](t), 0. <= X[1](t) and X[1](t) <=
0.300000e-4], [0,
otherwise]))+(1/2)*(PIECEWISE([400.0000000*X[1](t)-1.642800000, 0.708200e-2 <=
X[1](t) and X[1](t) <= 0.709200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([722000.0000*X[1](t)-5465.681000, 0.757900e-2 <=
X[1](t) and X[1](t) < 0.758000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([187714.2857*X[1](t)-1416.329571, 0.757200e-2 <=
X[1](t) and X[1](t) < 0.757900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([38225.80645*X[1](t)-284.4028064, 0.754100e-2 <=
X[1](t) and X[1](t) < 0.757200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([333375.0000*X[1](t)-2510.122875, 0.753300e-2 <=
X[1](t) and X[1](t) < 0.754100e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([11516.66667*X[1](t)-85.56405002, 0.747300e-2 <=
X[1](t) and X[1](t) < 0.753300e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([59000.00000*X[1](t)-440.4070000, 0.746900e-2 <=
X[1](t) and X[1](t) < 0.747300e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([300.0000000*X[1](t)-1.976700000, 0.743900e-2 <=
X[1](t) and X[1](t) < 0.746900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([4263.374486*X[1](t)-31.46024280, 0.719600e-2 <=
X[1](t) and X[1](t) < 0.743900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([1778.846154*X[1](t)-13.58157692, 0.709200e-2 <=
X[1](t) and X[1](t) < 0.719600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([400.0000000*X[1](t)-3.802800000, 0.708200e-2 <=
X[1](t) and X[1](t) < 0.709200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([2925.531915*X[1](t)-19.52861702, 0.689400e-2 <=
X[1](t) and X[1](t) <= 0.708200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-10636.36364*X[1](t)+64.48127275, 0.598600e-2 <=
X[1](t) and X[1](t) <= 0.600800e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([722000.0000*X[1](t)-5463.521000, 0.757900e-2 <=
X[1](t) and X[1](t) <= 0.758000e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-3891.891892*X[1](t)+24.10886487, 0.594900e-2 <=
X[1](t) and X[1](t) <= 0.598600e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([187714.2857*X[1](t)-1414.169571, 0.757200e-2 <=
X[1](t) and X[1](t) <= 0.757900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([-953.8461538*X[1](t)+6.630430769, 0.581900e-2 <=
X[1](t) and X[1](t) <= 0.594900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([38225.80645*X[1](t)-282.2428064, 0.754100e-2 <=
X[1](t) and X[1](t) <= 0.757200e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([16.83324566*X[1](t)+.9820473435, 0.391800e-2 <=
X[1](t) and X[1](t) <= 0.581900e-2], [0,
otherwise]))+(1/2)*(PIECEWISE([333375.0000*X[1](t)-2507.962875, 0.753300e-2 <=
X[1](t) and X[1](t) <= 0.754100e-2], [0,
otherwise]))+(1/2)*((PIECEWISE([-2521.739130*X[1](t)-.5083478261, 0.300000e-4 <=
X[1](t) and X[1](t) < 0.760000e-4], [0,
otherwise]))+(PIECEWISE([-19466.66667*X[1](t), 0. <= X[1](t) and X[1](t) <
0.300000e-4], [0, otherwise]))-(PIECEWISE([1305.263158*X[1](t)-8.623684211,
0.659000e-2 <= X[1](t) and X[1](t) <= 0.668500e-2], [0,
otherwise]))-(PIECEWISE([2205.882353*X[1](t)-14.55876471, 0.652200e-2 <= X[1](t)
and X[1](t) <= 0.659000e-2], [0,
otherwise]))-(PIECEWISE([-5181.818182*X[1](t)+33.62381818, 0.651100e-2 <=
X[1](t) and X[1](t) <= 0.652200e-2], [0,
otherwise]))-(PIECEWISE([121.9512195*X[1](t)-.9090243902, 0.647000e-2 <= X[1](t)
and X[1](t) <= 0.651100e-2], [0,
otherwise]))-(PIECEWISE([1000.000000*X[1](t)-6.590000000, 0.644200e-2 <= X[1](t)
and X[1](t) <= 0.647000e-2], [0,
otherwise]))-(PIECEWISE([-106.0606061*X[1](t)+.5352424245, 0.637600e-2 <=
X[1](t) and X[1](t) <= 0.644200e-2], [0,
otherwise]))-(PIECEWISE([-7400.000000*X[1](t)+47.04140000, 0.636600e-2 <=
X[1](t) and X[1](t) <= 0.637600e-2], [0,
otherwise]))-(PIECEWISE([-1364.285714*X[1](t)+8.618042855, 0.622600e-2 <=
X[1](t) and X[1](t) <= 0.636600e-2], [0,
otherwise]))-(PIECEWISE([-1560.000000*X[1](t)+9.836560000, 0.615100e-2 <=
X[1](t) and X[1](t) <= 0.622600e-2], [0,
otherwise]))-(PIECEWISE([-2242.424242*X[1](t)+14.03415151, 0.605200e-2 <=
X[1](t) and X[1](t) <= 0.615100e-2], [0,
otherwise]))-(PIECEWISE([-2613.636364*X[1](t)+16.28072727, 0.600800e-2 <=
X[1](t) and X[1](t) <= 0.605200e-2], [0,
otherwise]))+(PIECEWISE([2925.531915*X[1](t)-21.68861702, 0.689400e-2 <= X[1](t)
and X[1](t) < 0.708200e-2], [0,
otherwise]))+(PIECEWISE([2574.162679*X[1](t)-19.26627751, 0.668500e-2 <= X[1](t)
and X[1](t) < 0.689400e-2], [0,
otherwise]))+(PIECEWISE([1305.263158*X[1](t)-10.78368421, 0.659000e-2 <= X[1](t)
and X[1](t) < 0.668500e-2], [0,
otherwise]))+(PIECEWISE([2205.882353*X[1](t)-16.71876471, 0.652200e-2 <= X[1](t)
and X[1](t) < 0.659000e-2], [0,
otherwise]))+(PIECEWISE([-5181.818182*X[1](t)+31.46381818, 0.651100e-2 <=
X[1](t) and X[1](t) < 0.652200e-2], [0,
otherwise]))+(PIECEWISE([121.9512195*X[1](t)-3.069024390, 0.647000e-2 <= X[1](t)
and X[1](t) < 0.651100e-2], [0,
otherwise]))+(PIECEWISE([1000.000000*X[1](t)-8.750000000, 0.644200e-2 <= X[1](t)
and X[1](t) < 0.647000e-2], [0,
otherwise]))+(PIECEWISE([-106.0606061*X[1](t)-1.624757576, 0.637600e-2 <=
X[1](t) and X[1](t) < 0.644200e-2], [0,
otherwise]))+(PIECEWISE([-7400.000000*X[1](t)+44.88140000, 0.636600e-2 <=
X[1](t) and X[1](t) < 0.637600e-2], [0,
otherwise]))+(PIECEWISE([-1364.285714*X[1](t)+6.458042855, 0.622600e-2 <=
X[1](t) and X[1](t) < 0.636600e-2], [0,
otherwise]))+(PIECEWISE([-1560.000000*X[1](t)+7.676560000, 0.615100e-2 <=
X[1](t) and X[1](t) < 0.622600e-2], [0,
otherwise]))-(PIECEWISE([2574.162679*X[1](t)-17.10627751, 0.668500e-2 <= X[1](t)
and X[1](t) <= 0.689400e-2], [0,
otherwise]))+(PIECEWISE([-2242.424242*X[1](t)+11.87415151, 0.605200e-2 <=
X[1](t) and X[1](t) < 0.615100e-2], [0,
otherwise]))+(PIECEWISE([-2613.636364*X[1](t)+14.12072727, 0.600800e-2 <=
X[1](t) and X[1](t) < 0.605200e-2], [0,
otherwise]))+(PIECEWISE([-10636.36364*X[1](t)+62.32127275, 0.598600e-2 <=
X[1](t) and X[1](t) < 0.600800e-2], [0,
otherwise]))+(PIECEWISE([-3891.891892*X[1](t)+21.94886487, 0.594900e-2 <=
X[1](t) and X[1](t) < 0.598600e-2], [0,
otherwise]))+(PIECEWISE([-953.8461538*X[1](t)+4.470430769, 0.581900e-2 <=
X[1](t) and X[1](t) < 0.594900e-2], [0,
otherwise]))+(PIECEWISE([-16.83324566*X[1](t)-.9820473435, 0.391800e-2 <=
X[1](t) and X[1](t) < 0.581900e-2], [0,
otherwise]))+(PIECEWISE([-39.57946815*X[1](t)-.8929276438, 0.230100e-2 <=
X[1](t) and X[1](t) < 0.391800e-2], [0,
otherwise]))+(PIECEWISE([-49.21579232*X[1](t)-.8707544619, 0.452000e-3 <=
X[1](t) and X[1](t) < 0.230100e-2], [0,
otherwise]))+(PIECEWISE([-513.2978723*X[1](t)-.6609893617, 0.760000e-4 <=
X[1](t) and X[1](t) < 0.452000e-3], [0,
otherwise]))-(PIECEWISE([39.57946815*X[1](t)+.8929276438, 0.230100e-2 <= X[1](t)
and X[1](t) <= 0.391800e-2], [0,
otherwise]))-(PIECEWISE([11516.66667*X[1](t)-83.40405002, 0.747300e-2 <= X[1](t)
and X[1](t) <= 0.753300e-2], [0,
otherwise]))-(PIECEWISE([59000.00000*X[1](t)-438.2470000, 0.746900e-2 <= X[1](t)
and X[1](t) <= 0.747300e-2], [0,
otherwise]))-(PIECEWISE([49.21579232*X[1](t)+.8707544619, 0.452000e-3 <= X[1](t)
and X[1](t) <= 0.230100e-2], [0,
otherwise]))-(PIECEWISE([300.0000000*X[1](t)+.183300000, 0.743900e-2 <= X[1](t)
and X[1](t) <= 0.746900e-2], [0,
otherwise]))-(PIECEWISE([513.2978723*X[1](t)+.6609893617, 0.760000e-4 <= X[1](t)
and X[1](t) <= 0.452000e-3], [0,
otherwise]))-(PIECEWISE([4263.374486*X[1](t)-29.30024280, 0.719600e-2 <= X[1](t)
and X[1](t) <= 0.743900e-2], [0,
otherwise]))-(PIECEWISE([2521.739130*X[1](t)+.5083478261, 0.300000e-4 <= X[1](t)
and X[1](t) <= 0.760000e-4], [0,
otherwise]))-(PIECEWISE([1778.846154*X[1](t)-11.42157692, 0.709200e-2 <= X[1](t)
and X[1](t) <= 0.719600e-2], [0, otherwise]))-(PIECEWISE([19466.66667*X[1](t),
0. <= X[1](t) and X[1](t) <= 0.300000e-4], [0,
otherwise]))-(PIECEWISE([400.0000000*X[1](t)-1.642800000, 0.708200e-2 <= X[1](t)
and X[1](t) <= 0.709200e-2], [0,
otherwise]))+(PIECEWISE([722000.0000*X[1](t)-5465.681000, 0.757900e-2 <= X[1](t)
and X[1](t) < 0.758000e-2], [0,
otherwise]))+(PIECEWISE([187714.2857*X[1](t)-1416.329571, 0.757200e-2 <= X[1](t)
and X[1](t) < 0.757900e-2], [0,
otherwise]))+(PIECEWISE([38225.80645*X[1](t)-284.4028064, 0.754100e-2 <= X[1](t)
and X[1](t) < 0.757200e-2], [0,
otherwise]))+(PIECEWISE([333375.0000*X[1](t)-2510.122875, 0.753300e-2 <= X[1](t)
and X[1](t) < 0.754100e-2], [0,
otherwise]))+(PIECEWISE([11516.66667*X[1](t)-85.56405002, 0.747300e-2 <= X[1](t)
and X[1](t) < 0.753300e-2], [0,
otherwise]))+(PIECEWISE([59000.00000*X[1](t)-440.4070000, 0.746900e-2 <= X[1](t)
and X[1](t) < 0.747300e-2], [0,
otherwise]))+(PIECEWISE([300.0000000*X[1](t)-1.976700000, 0.743900e-2 <= X[1](t)
and X[1](t) < 0.746900e-2], [0,
otherwise]))+(PIECEWISE([4263.374486*X[1](t)-31.46024280, 0.719600e-2 <= X[1](t)
and X[1](t) < 0.743900e-2], [0,
otherwise]))+(PIECEWISE([1778.846154*X[1](t)-13.58157692, 0.709200e-2 <= X[1](t)
and X[1](t) < 0.719600e-2], [0,
otherwise]))+(PIECEWISE([400.0000000*X[1](t)-3.802800000, 0.708200e-2 <= X[1](t)
and X[1](t) < 0.709200e-2], [0,
otherwise]))-(PIECEWISE([2925.531915*X[1](t)-19.52861702, 0.689400e-2 <= X[1](t)
and X[1](t) <= 0.708200e-2], [0,
otherwise]))-(PIECEWISE([-10636.36364*X[1](t)+64.48127275, 0.598600e-2 <=
X[1](t) and X[1](t) <= 0.600800e-2], [0,
otherwise]))-(PIECEWISE([722000.0000*X[1](t)-5463.521000, 0.757900e-2 <= X[1](t)
and X[1](t) <= 0.758000e-2], [0,
otherwise]))-(PIECEWISE([-3891.891892*X[1](t)+24.10886487, 0.594900e-2 <=
X[1](t) and X[1](t) <= 0.598600e-2], [0,
otherwise]))-(PIECEWISE([187714.2857*X[1](t)-1414.169571, 0.757200e-2 <= X[1](t)
and X[1](t) <= 0.757900e-2], [0,
otherwise]))-(PIECEWISE([-953.8461538*X[1](t)+6.630430769, 0.581900e-2 <=
X[1](t) and X[1](t) <= 0.594900e-2], [0,
otherwise]))-(PIECEWISE([38225.80645*X[1](t)-282.2428064, 0.754100e-2 <= X[1](t)
and X[1](t) <= 0.757200e-2], [0,
otherwise]))-(PIECEWISE([16.83324566*X[1](t)+.9820473435, 0.391800e-2 <= X[1](t)
and X[1](t) <= 0.581900e-2], [0,
otherwise]))-(PIECEWISE([333375.0000*X[1](t)-2507.962875, 0.753300e-2 <= X[1](t)
and X[1](t) <= 0.754100e-2], [0, otherwise])))*tanh(26466.52412*V[1](t)) <=
5.860656250], [1, otherwise]))+(PIECEWISE([1, abs(X[1](t)-0.987586956215446e-3)
< 1/1000000 and V[1](t) <= -1/100000000], [0, otherwise])), diff(X[1](t), t) =
V[1](t)*(PIECEWISE([PIECEWISE([0, X[1](t) <= 0.987586956215446e-3], [1,
otherwise]), V[1](t) <= 0], [1, otherwise])), V[1](0) = 0., X[1](0) =
0.987586956215446e-3}
>

I owe you an explanation of the the structure of the system
It codes first Newton's law applied to a single moving mass :  dX/dt = V and M*dY/dt = F
where F writes Acc(t) - R(X(t), V(t))
1/   Acc is the acceleration (driven) component
2    R(...) is a force that opposes to the displacement of the mass

The initial position of the mass is X(0) = A and V(0)=0 and further positions of it mus be strictly >= A
Think to abscissa X=A as a rigid wall (here A = 0.00987...)

The behaviour of the mass is given in my original sending.
While the sign of F is negative the mass does not move ; as soon as F >0 (or equivalently, as soon as the acceleration Acc(t) is sufficiently high to balance R(...) the mass begins to take off and leave the wall.
It may happen that the drop of the acceleration may forvce the mass to hit the wall again : in this case, as soon as the mass hits the wall, it stays here and waits for the next increase of Acc(t)
To picture that think to the bouncing ball toy problem with a shock restitution coefficient equal to 0

To handle this situation I transformed the former system by writting

1/   dX/dt    = V * P
2/  M*dV/dt = F * Q

where : P = piecewise(`and`(X=A, V<0), 0, 1)
and      Q = piecewise(`and`(X=A, F<0), 0, 1)

This new system guarantees X never takes values less than A, and the mass acceleration dV/dt is 0 when the mass stays on the wall
I need to introduce a last modification to force the velovity of the mass to be 0 in this situation.

To do this I modufy the equation  M*dV/dt = F * Q  by introducing some kind of "Dirac" D at the contact time :
I thus write M*dV/dt = F * Q + D with :
D = 1 if |X-A| < epsilon and V > eta    (epsilon and eta "small")
D = 0 otherwise

(this is the las term of the first ODE)

Feel free to ask me any further information you need