Now to program a sine divid by a sine function in Excel?

Click For Summary

Discussion Overview

The discussion revolves around programming a sine divided by a sine function in Excel, specifically in the context of simulating antenna field patterns. Participants are exploring how to handle a division by zero error when the variable x equals zero.

Discussion Character

  • Technical explanation, Homework-related

Main Points Raised

  • One participant describes the function AF=\frac {\sin\;Nx}{sin \;x} and notes that Excel returns a "DIV 0" error when x=0, seeking a solution to display AF=N instead.
  • Another participant suggests applying l'Hopital's Rule as x approaches 0 and testing the expression in Excel when x=0.
  • Some participants propose using an IF statement in Excel to handle the case when sin(x) equals 0, suggesting a formula that returns N in that scenario.

Areas of Agreement / Disagreement

Participants present multiple approaches to the problem, including the use of l'Hopital's Rule and IF statements, but there is no consensus on a single solution or method.

Contextual Notes

There may be limitations related to the assumptions about the behavior of the sine function near zero and how Excel handles mathematical expressions, which are not fully resolved in the discussion.

yungman
Messages
5,741
Reaction score
291
This is part of the simulation program in Antenna field pattern. One part involve finding the position of the peak where:

[tex]AF=\frac {\sin\;Nx}{sin \;x}\;\hbox { where N is an integer.}[/tex]

The peak is at x=0 and the AF=N. But excel do not accept this and call out as "DIV 0" error. Is there any way to program it so when x= 0, it will show AF=N?

THis is like sync function when x = 0. I don't know whether this is the right place to post, but this is the best I see fit.

Thanks
 
Physics news on Phys.org
Hint: apply l'Hopital's Rule as x approaches 0. Then in Excel, test when x = 0 and use the appropriate expression for AF.
 
I'm not sure of your context, but what about using the IF statement? For example, if you name one cell x and another cell N, something like this

=if(sin(x) = 0, N, sin(N*x)/sin(x))
 
LCKurtz said:
I'm not sure of your context, but what about using the IF statement? For example, if you name one cell x and another cell N, something like this

=if(sin(x) = 0, N, sin(N*x)/sin(x))

I'll check the excel program.

Thanks
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K