MathGroup Archive 2002

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

Search the Archive

RE: silly newbie questions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34396] RE: [mg34385] silly newbie questions
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sat, 18 May 2002 03:50:57 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Tom,

There are two things that would be very helpful when submitting questions to
MathGroup. One is to use a Subject title that reflects the nature of the
question. This helps other users to search the archives. And, anyway, your
question is not so silly. A subject like "Piecewise Differential Equation
Question" might be more appropriate. Secondly, it is helpful to provide a
specific example, instead of just asking a generic question. Otherwise the
responder has to spend time making up a case and maybe it's nothing like you
had in mind.

The Mathematica Book tends to lead new users into using multiple conditional
definitions for piecewise functions. But the best way to represent them is
with UnitStep functions. That is because Mathematica will do many things
with UnitStep functions that it won't do with multiple conditional
definitions. One of these things is solving differential equations. So, here
is an example.

s[t_] := 3(UnitStep[t] - UnitStep[t - 1])

Plot[s[t], {t, -1, 3}];

asol = DSolve[{a'[t] == s[t] - 2a[t], a[0] == 10}, a, t]
a -> Function[{t},
   ((-(1/2))*(-20 - 3*E^2*UnitStep[-1 + t] +
      3*E^(2*t)*UnitStep[-1 + t] + 3*UnitStep[t] -
      3*E^(2*t)*UnitStep[t]))/E^(2*t)]

f[t_] = a[t] /. asol
((-(1/2))*(-20 - 3*E^2*UnitStep[-1 + t] +
    3*E^(2*t)*UnitStep[-1 + t] + 3*UnitStep[t] -
    3*E^(2*t)*UnitStep[t]))/E^(2*t)

Plot[f[t], {t, 0, 5}];

fLP[s_] = LaplaceTransform[f[t], t, s]
(1/2)*(3/s - 3/(E^s*s) + 17/(2 + s) + 3/(E^s*(2 + s)))

Plot[fLP[s], {s, -5, 5}];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


> From: theiman [mailto:heimantj at celera.com]
To: mathgroup at smc.vnet.net
>
>
> Hi,
>
> I have two questions:
>
> (1)  I have an equation:
>
>           eqn = A'[t] = S - (ln(2)/hl)*A[t]
>
> and I am trying to find the time at which the discontinuity occurs (t1
> and t2) and I have sampled at time t.  The constraints for the system
> are:
>
>  S(t)=S if t1<t<t2
>  S(t)=0 otherwise
>
> The question is: How do I use these constraints with Dsolve?
>
> (2) After I find the solution to the equation in question 1 I would
> like to take the laplace transform of the equation (and since it is a
> step function I need to use the heaviside (formula/equation?)) and
> solve the result.  Any ideas on how to do this?
>
> I would really appreciate any help or suggestions!!!!
>
> Thankyou!!
>
> Sincerely,
>
> Tom
>
>



  • Prev by Date: RE: silly newbie questions
  • Next by Date: Mathematica's color limitations
  • Previous by thread: RE: silly newbie questions
  • Next by thread: Re: silly newbie questions