MathGroup Archive 1999

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

Search the Archive

RE: Re: Function evaluation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17613] RE: [mg17605] Re: [mg17550] Function evaluation
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Tue, 18 May 1999 02:45:17 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

I thought Bob would have done better.  The following is much simpler, and
more efficient.
Regards,
Ted Ersek
--------------------

f[0,_]=0;

f[s_,n_]:=BesselK[0,n*(1-s)]-BesselK[0,n]*BesselI[0,n*(1-s)]/BesselI[0,n];

--------------------

>I have a function defined as
>
>f[s_,n_]:=BesselK[0,n*(1-s)]-BesselK[0,n]*BesselI[0,n*(1-s)]/BesselI[0,n]
>
>We can see that at s=0, f is zero. but mathematica returns a small number,
>i think it is the workingprecision. I have tried to change the working
>precision, but that does not help. the function still evaluates to a
>10^-16 number. I am using this function to define other functions. Ccan
>someone help me find a way to evaluate this function correctly.
>


Bob Hnlon's solutionn was:
---------------

Handle the case for s==0 separately:

f[s_/; s==0,n_]:=0;

f[s_,n_]:=BesselK[0,n*(1-s)]-BesselK[0,n]*BesselI[0,n*(1-s)]/BesselI[0,n];


  • Prev by Date: Re: Re: Is it a bug?
  • Next by Date: Looking for Partner who has access to mathematica and Time Series
  • Previous by thread: Re: Function evaluation
  • Next by thread: Re: Function evaluation