Re: Division by zero, despite strong hint
- To: mathgroup at smc.vnet.net
- Subject: [mg96590] Re: [mg96542] Division by zero, despite strong hint
- From: Curtis Osterhoudt <cfo at lanl.gov>
- Date: Mon, 16 Feb 2009 16:41:31 -0500 (EST)
- Organization: LANL
- References: <200902161155.GAA03397@smc.vnet.net>
- Reply-to: cfo at lanl.gov
Hi, David, Just a missing comma between the arguments to Piecewise! Try g3[x_] := Piecewise[{{Sin[1/x], x != 0}, {0, x == 0}}] Regards, C.O. On Monday 16 February 2009 04:55:40 am dch888 wrote: > Hi, > > I'm trying to plot the Sin[1/x] curve with the curve being defined as > 0 at 0 like this: > > g3[x_] := Piecewise[{{Sin[1/x], x != 0} {0, x == 0}}] > > Invoking Plot produced a flat graph; puzzled I asked for g3[0] and > got: > > Power::infy Infinite expression 1/0 encountered >> > > { > {Indeterminate, False True}, > {0, \!\(\* > TagBox["True", > "PiecewiseDefault", > AutoDelete->False, > DeletionWarning->True]\)} > } > > Hmmm... what's the trick here to stop Mathematica evaluating all the branches > of the piecewise fn? There's nothing in the documentation that I can > see to stop this in Piecewise... perhaps I need to use a different Mathematica > function? > > Thanks, > David. > > -- ========================================================== Curtis Osterhoudt cfo at remove_this.lanl.and_this.gov PGP Key ID: 0x4DCA2A10 Please avoid sending me Word or PowerPoint attachments See http://www.gnu.org/philosophy/no-word-attachments.html ==========================================================
- References:
- Division by zero, despite strong hint
- From: dch888 <dch888@googlemail.com>
- Division by zero, despite strong hint