Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Question about the derivative of Abs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106120] Re: [mg106097] Question about the derivative of Abs
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Sat, 2 Jan 2010 05:04:03 -0500 (EST)
  • References: <201001011036.FAA05264@smc.vnet.net>

Hi,

PiecewiseExpand can do the trick. In your original post the Abs are
results from the Norm-function in ni[t_,a_,b_].
If you are sure the parameters there are Reals then the following is
Abs-free. To decide whether this is correct is your turn.

Clear["Global`*"]
Simp[a_, b_][expr_] := 
  Simplify[expr, 
   Assumptions -> a > 0 && a < Pi/2 && b > 0 && b < Pi/2];
FSimp[a_, b_][expr_] := 
  FullSimplify[expr, 
   Assumptions -> a > 0 && a < Pi/2 && b > 0 && b < Pi/2];

ComputeCs3D[zi_] := (ddt = Derivative[1, 0, 0];
  dd1 = Derivative[0, 1, 0];
  dd2 = Derivative[0, 0, 1];
  vi = ddt[zi];
  zialpha[t_, a_, b_] := {dd1[zi][t, a, b], dd2[zi][t, a, b]};
  salphabeta = 
   Dot[zialpha[#1, #2, #3], Transpose[zialpha[#1, #2, #3]]] &;
  sAlphaBeta = Inverse[salphabeta[#1, #2, #3]] &;
  ni[t_, a_, b_] := 
   Cross[zialpha[t, a, b][[1]], zialpha[t, a, b][[2]]]/
     Norm[Cross[zialpha[t, a, b][[1]], zialpha[t, a, b][[2]]]] /. 
    Abs[val__] :> PiecewiseExpand[Abs[val], Reals];
  c[t_, a_, b_] := Dot[ni[t, a, b], vi[t, a, b]] // FSimp[a, b];
  c1[t_, a_, b_] := 
   ddt[c][t, a, b] - 
     Dot[zialpha[t, a, b], vi[t, a, b], 
      sAlphaBeta[t, a, b], {dd1[c][t, a, b], dd2[c][t, a, b]}] // 
    Simp[a, b];
  c2[t_, a_, b_] := 
   ddt[c1][t, a, b] - 
     Dot[zialpha[t, a, b], vi[t, a, b], 
      sAlphaBeta[t, a, b], {dd1[c1][t, a, b], dd2[c1][t, a, b]}] // 
    Simp[a, b];
  {c[#1, #2, #3], c1[#1, #2, #3], c2[#1, #2, #3]} &)
zi[t_, theta_, phi_] := {(1 + \[Epsilon] t)*Sin[theta] Cos[phi], 
   Sin[theta] Sin[phi], Cos[theta]};
ComputeCs3D[zi][0, \[Theta], \[Phi]] // 
  FSimp[\[Theta], \[Phi]] // MatrixForm

Cheers
Patrick

On Fri, 2010-01-01 at 05:36 -0500, Sam Takoy wrote:
> Hi,
> 
> I kind of asked this question before, but in a more confusing context, 
> so now I would like to ask it by itself.
> 
> In the course of my computations, I get Abs' and Abs''. It is applied to 
> a positive number, so I think those values should be 1 and 0. However, 
> Mathematica fails to simplify it.
> 
> For example
> 
> In[34]:= Abs'[2.0]
> 
> Out[34]=
> \!\(\*SuperscriptBox["Abs", "\[Prime]",
> MultilineFunction->None]\)[2.]
> 
> 
> These expressions really mess up my answers. How do I get Mathematica to 
> do these simplifications?
> 
> Thanks
> 
> Sam
> 



  • Prev by Date: Re: Database Challenge
  • Next by Date: Re: Re: More /.{I->-1} craziness
  • Previous by thread: Re: Question about the derivative of Abs
  • Next by thread: Re: Question about the derivative of Abs