Piecewise equations

Is it possible to solve piecewise equations in maple? All I get is 'warning, solutions may have been lost'.

solve((piecewise(x<0,x,x>=0,x^2)=0));

Thanks.

 

Which version of Maple are you using?

Your code gave me an answer of  "0, 0" with Maple 11on 64 bit Linux.  Which seems OK, but not perfect.

 

What version of Maple are you using?

Version 11.

Version 11.

Solved

I've found the problem - something in my worksheet was conflicting with the equation. I restarted and now it works.

Thanks for your reply.

Another problem

I still can't solve this equation:

solve(PIECEWISE([-.4900000000e-1*t-.2450000000*exp(-.2000000000*t)+4.245000000, t < td],[-.7000000000e-2*t+.3000000000e-1*exp(1.400000000*td-1.400000000*t)-.3500000000e-1*exp(1.200000000*td-1.400000000*t)-.4200000000e-1*td+4.215000000-.2100000000*exp(-.2000000000*td), td <= t])=0)

I want to find t in terms of td.

JacquesC's picture

You need to say so

The format for solve is best given as solve({eqns}, {vars});. You are skipping telling Maple which variable(s) to solve for. Also, unless you have no choice, you are much better off using exact rationals than floating point numbers when calling solve.

Thanks but maple still can't

Thanks but maple still can't solve it if I use exact rationals and in the form you suggested.

Here is the updated code:

solve({piecewise(t=td,-.007*t+.03*exp(1.4*td-1.4*t)-.035*exp(1.2*td-1.4*t)-.042*td+4.215-.21*exp(-.2*td))},{t,td});

Still maple says 'warning, solutions may have been lost'. I have tried different variations of the above but I still get the same message.

Anyone have any ideas?

JacquesC's picture

Typos?

For one, you still have floats, not rationals in there.  Plus, the piecewise you gave is most certainly "backwards", since it is 0 everywhere *except* on the line t=td.  Is that really what you want?  I would have expected the opposite!  Additionally, if you want t in terms of td, you should have

solve(..., {t});

otherwise it will solve for both variables.

Note the following:

> p := convert(piecewise(t=td,-.007*t+.03*exp(1.4*td-1.4*t)-.035*exp(1.2*td-1.4*t)-.042*td+4.215-.21*exp(-.2*td)), rational):
> solve({p},{t}, AllSolutions) assuming t=td;

                  td
  {t = -30 exp(- ----) + 5/7 LambertW(_NN1~,
                  5

        /             td  \     49 td                   td
        |6 - 7 exp(- ----)| exp(----- - 843 + 42 exp(- ----))) - 6 td
        \             5   /       5                     5

         + 4215/7}

Robert Israel's picture

Exact rationals

That's not what Jacques meant by exact rationals.  Any number with a decimal point in it is a float, not an exact rational.  -7/1000 would be an exact rational, -.007 is not.

Secondly, you gave solve one equation to solve for two variables.  That will almost never work.  You need to give it one variable to solve for.

 

Sorry that's meant to

Sorry that's meant to be:

solve({piecewise(t<td,-.049*t-.245*exp(-.2*t)+4.245, t>=td,-.007*t+.03*exp(1.4*td-1.4*t)-.035*exp(1.2*td-1.4*t)-.042*td+4.215-.21*exp(-.2*td))},{t,td});

 

JacquesC's picture

Maple cannot represent the answer

This is interesting.  Maple knows exactly what the answer is, but has no mechanism for wiriting down the answer, so throws it out!  If p denotes your piecewise, then

> solve({op(2,p)},{t}, AllSolutions);

                                          -849     4245
              {t = 5 LambertW(_NN1~, -exp(----)) + ----}
                                           49       49

> solve({op(4,p)},{t}, AllSolutions);

                  td
  {t = -30 exp(- ----) + 5/7 LambertW(_NN2~,
                  5

        /             td  \     49 td                   td
        |6 - 7 exp(- ----)| exp(----- - 843 + 42 exp(- ----))) - 6 td
        \             5   /       5                     5

         + 4215/7}

The issue is that Maple does not seem to want to represent piecewise-defined answers. This is not entirely surprising, as I am not sure anyone has ever really worked out the theory for that.  It doesn't mean that that is necessarily difficult, it just might not have been done yet.

Robert Israel's picture

The solution

You might note that your piecewise expression can be written as f(t, min(t, td)) where

f(t,s) = -.7e-2*t+.3e-1*exp(1.4*s-1.4*t)-.35e-1*exp(1.2*s-1.4*t)-.42e-1*s+4.215-.21*exp(-.2*s)

The solution to f(t,s) = 0 is

t=-30.*exp(-.2000000000*s)+602.1428571+.7142857143*LambertW((-7.*exp(-.2000000000*s)+6.)*exp(9.800000000*s-843.+42.*exp(-.2000000000*s)))-6.*s

Call the right side tsol(s).

t=tsol(s) is the only real solution if s >.7707533992; for -15.80957686 < s < .7707533992 there is also a solution using the -1 branch of LambertW, and for s < -15.80957686 there is no real solution.  I'll assume you're interested in the case s > .7707533992.

 The solution to f(s,s) = 0 in this interval is s = 86.63265291.  For .7707533992 < td < 86.63265291 we have tsol(td) > td, so t = tsol(td) is the solution of your equation.  For td > 86.63265291, tsol(td) < td, so the solution you want is t = 86.63265291.

 

 

My worksheet

Thank you to everyone who has helped so far.

Ok - I think there is probably an easier way to go about my problem.

Here is my worksheet:

Download 7999_Graph plotter.mws
View file details

It's a basic model of a parachute jump. td is the time at which the parachute opens. x0, k1 and k2 are fixed constants.

I'm trying to find the velocity of impact in terms of td. The way I did it was probably the long way round and ended up with the equation above. Can someone suggest an easier method?

 

Doug Meade's picture

parachute

Look at the graph in your worksheet. The velocity has been (essentially) constant for more than 3 minutes. Unless you deploy the parachute so late that impact occurs before terminal velocity is reached, the impact velocity is essentially independent of the deployment time.

But first, are you sure the skydiver is not torn to pieces long before impact?

Compute the force on the skydiver at the instant of deployment. This can be done without solving a differential equation, just compute the force before and after deployment (position and velocity are continuous here, but not acceleration). I find the jerk is 6G. Not as bad as most textbook problems from a decade ago.

I did some modeling of this problem about 10 years ago. Here are two entries from my list of publications:

Back to your original question: This is a difficult problem for Maple to solve. You really need an exact solution (which is not difficult to write) and then some messy manipulations. Before I invest too much time in this, why do you want to know this relationship? Maybe there is another way to get this from the problem.

Doug

---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208 E-mail: mailto:meade@math.sc.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu/~meade/

giga jerk

You state that the jerk is 6G.  What is the G?  Giga?  As in giga*m/s^3? 

The "proper" pronunciation of giga is with a leading soft g (jiga), which sounds much nicer than what I usually hear. My wife gives me a hard time when I pronounce it that way.

acer's picture

gravity

I suspect that he was referring to g the acceleration due to gravity, or a force on a body of mass m under such acceleration.

acer

Doug Meade's picture

G = force of gravity

Acer is correct. When I wrote 6G I was saying the force jumped by 6 times the force of gravity. That's more than 1000 lbs for an average adult male (don't forget the equipment contributes to the overall mass of the skydiver). When I did this work I found some textbook examples with truly unsurvivable situations (instantaneous forces in excess of 10G).

Doug

---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/

Wow - i've actually been

Wow - i've actually been using the first article you mentioned to help me with my project. I never thought i'd cyber-meet the man in person!

Your second article will be very useful to me - thank you.

The project i'm doing is focused more on the safety of parachute jumping and how to minimilize risk.
I wanted to find the minimum time before impact that the parachutist must deploy his parachute.

I'm not sure if working out the jerk will help me in my project unless there's a way of decreasing it?

Any feedback that you can give me will be greatly appreciated.

Doug Meade's picture

jerks don't jump

I thought the code, and graphs, in your worksheet looked pretty familiar. I'm glad you are finding them useful.

The way I addressed this issue was to model the deployment over a short time interval. To keep the jerk continuous I used a cubic function. In the end, this has very little affect on the final landing time or velocity - it just gets you through the deployment without being torn apart.

I believe I did solve the problem of finding the latest time to deploy the chute while keeping the impact velocity below a certain threshold. I believe I did this iteratively. You might be able to do something with a shooting method.

Because the ODEs are autonomous and the velocity at deployment is essentially terminal velocity, I believe you can work out the minimal time needed to bring the velocity from (pre-deployment) terminal velocity your threshold, then work backwards from here. This will get you close; a couple iterations should lead to a good estimate.

That was a fun project. I still like to talk about it.

Let me know if I can be of further help.

Doug

---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/

A new approach

After reading through the part of your article about the threshold velocity and time of chute deployment, i've realised that I won't be able to write about it in my report.

The report i'm doing is meant to be a short piece on the safety of parachuting. As much as I would like to write about the threshold velocity, I don't have the space or time to do it (i'm limited to ten pages unfortunately).

I think i'll just include different graphs to show the effect of varying td.

What i'm meant to do is start with a basic model and then add one improvement.

Is there any way the basic model can be improved (simply)  to decrease the impact velocity to make the landing safe? I thought about using the fact that 'g' varies depending on the altitude but I don't know how much this would effect the impact velocity.

My report is all about safety and the problem I have been having is finding a variable which decreases the impact velocity and that won't take too much explaining in a report - not an easy challenge!

 

acer's picture

coefficients of air resistance

There were two coefficients of air resistance given: one for before deployment and one for after.

If you could alter the first, then the (terminal) velocity prior to deployment could be lower. If you could alter the latter, then the rate of change in velocity following deployment would be greater, and also the steady descent rate would be less.

Skydivers keep the former coefficient near optimal by falling spead-eagle instead of with knees tucked up in cannonball position. After deployment, the size of the parachute is the big factor in air resistance. Maybe you could show graphs of k1 and/or k2 versus impact velocity (if, say, the rip cord is pulled after terminal velocity were attained).

acer

Thanks

Great idea - thank you very much for that.

I'm sorry for taking this thread off topic (this is a maple forum). I think I've probably got enough material to complete my report now.

Thank you to everyone who has helped me.

Doug Meade's picture

another idea for safety

If you are interested in safety, why not think about the backup chute. It is smaller, and so will have a smaller k, but still larger than the initial free-fall resistance. You can figure out the latest time (lowest altitude) that the backup can be deployed to bring your landing velocity below some threshold. But, when do you have to attempt to open the primary chute so that you have time to deploy the backup chute in the case it is needed. As I recall, the general guidelines in the Air Force manual (reference in my papers), which are stated in terms of times after leaving the plane (at always the same altitude), match up very nicely with this. I cannot believe this is coincidence. Take a look for yourself.

Doug

---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}