MathGroup Archive 2014

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Result to DEQ with WA versus Step-by-Step Yields

  • To: mathgroup at
  • Subject: [mg132293] Re: Result to DEQ with WA versus Step-by-Step Yields
  • From: Itai Seggev <itais at>
  • Date: Sat, 1 Feb 2014 23:55:16 -0500 (EST)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <>

On Sat, Feb 01, 2014 at 12:54:16AM -0500, amzoti wrote:
> When you solve this DEW using WA, you get a result.
> However, when you click step-by-step, the result is different.
> Is this a bug?
> v'' + 10 v' + 125 v = 250 unitstep(t), v(0) = 0, v'(0) = 25

Yes and no, but I think mostly no in this case. 

The initial answer given by W|A is computed algorithmically, for example by
DSolve.  In contrast, the step-by-step answer is computed in manner which
attempts to simulate how a person might do it.  There's no guarantee that these
will be produce identical forms for the answer.  If they forms are different
but the answers agreen, then that's certainly not a bug.

Now, let's compare the two answers (v is the step-by-step answer, w the
algorithmic answer):

In[29]:= FullSimplify[w[t]-v[t]]
Out[29]= \[Piecewise]	-2+(2 Cos[10 t]+Sin[10 t])/E^(5 t)	t<0
	 		0	     	       			True

So they are the same for t>=0, but not for negative times.  Now, looking at the
step-by-step solution, it uses the Laplace transform method--a very reasonable
choice, because the discontinuity in the forcing function limits the number of
methods which will work.  (Of methods typically covered in an introductory
course, this is probably the only one which will work).  However, a Laplace
transform is only defined for t>=0.  Which likely means that both answers are
right for t>=0, but that only w is correct for negative t.  Indeed, if put the
v back into the original equation we find:

In[39]:= (v^\[Prime]\[Prime])[t] + 10 Derivative[1][v][t] + 
   125 v[t] == 250 UnitStep[t] // Simplify

Out[39]= t >= 0

So v only obeys the ODE for t>=0.  On the other hand, when is w plugged into
the DE you see: 

In[40]:= (w^\[Prime]\[Prime])[t] + 10 Derivative[1][w][t] + 
   125 w[t] == 250 UnitStep[t] // Simplify

Out[40]= Indeterminate == 0 || t != 0

The Indeterminate == 0 comes from the fact that Mathematica can't compute the
second derivative at t == 0 as w only has 1 continuous derivative.  (Indeed,
since the forcing function is discontinuous you're not actually guaranteed
unique solutions, but this is the sort of system which typically does have
them.)  But for all other times, w is the correct solution to the ODE.

So the discrepency comes from choice of method in step-by-step, except under
the circumstances I think it's an entirely reasonable choice.  If you disagree,
you can certainly provide feedback (the plus sign in the bottom right corner of
the == output), which will be forwarded to the relevant developers.

Itai Seggev
Mathematica Algorithms R&D

  • Prev by Date: Re: Learning to Program in Mathematica
  • Next by Date: Solving special exponential integral
  • Previous by thread: Re: Result to DEQ with WA versus Step-by-Step Yields
  • Next by thread: Re: Result to DEQ with WA versus Step-by-Step Yields