8
f(w,t)=sin(wt)/w. Help make defined at w = 0.
(discuss.tchncs.de)
General community for all things mathematics on @lemmy.world
Submit link and text posts about anything at all related to mathematics.
Questions about mathematical topics are allowed, but NO HOMEWORK HELP. Communities for general math and homework help should be firmly delineated just as they were on reddit.
People are being kind of rude, sorry about that.
I also think they aren't understanding your problem. You have a function f(w,t) = sin(wt)/w which is well defined everywhere (in the sense of limits at w=0 ), but for which the naive implementation (compute sin(wt), then divide by w) gives the "wrong" output for w=0 (an error instead of t).
Note that the function sin(x)/x has a name, sinc(x). Using this to rewrite your function gives f(w,t) = sin(wt)/w = tsin(wt)/(wt) = tsinc(wt).
Now you just need to find a quality implementation of sinc from a math library.
Yes, when w->o, sin(wt)/w -> 1
(and hopefully sinc(0)=1 in any math library),
but also when t->0, sin(wt)/w -> 0.
I know that 0x1=0, but it's not true that there's a continuous function from the plane to the reals based on sin(wt)/w and OP has an interesting problem trying to decide what to do there.
Your answer gives much more accurate answers near zero and is absolutely the best practical solution, but the question of actual zero is interesting and might need context to decide what's best.