12-18-2017 09:08 AM
I want to create an If esle structures that first evalutes the formula from the left block and if it is true than the formula of right above is done and if it is smaller the formula of right below is used? any suggestion
Solved! Go to Solution.
12-18-2017 09:33 AM
This is very basic. Have you looked in the comparison palette? Have you used a Case Structure before?
12-18-2017 10:34 AM
Calculate the right side. Compare to the left side. Send result to a case structure.
/Y
12-18-2017 10:35 AM
As crossrulz stated, the example equations in your post can easily be managed with comparison and a case structure.
If your decision tree is more complicated (or if you're dealing with more complicated equations) you can look into MathScripts. This can prevent your block diagram from becoming unruly.
http://www.ni.com/white-paper/7572/en/
http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmathmain/mathscript_syntax/
12-18-2017 03:00 PM - edited 12-19-2017 10:12 AM
Is the "far field" parameter one of the variables on the right side? Where does D, E, P come from?
Unless you have gigantic datasets, it might be simpler to just calculate both and use a select node to pick the result based on the comparison. All these calculations are very cheap and e.g. D² needs to be calculated always anyway. You can also pre-calcuate 1/377 and 1/(4pi), once before the loop, etc.
12-19-2017 07:12 AM
Thaks everyone I found a solution
12-19-2017 01:26 PM
@shivik89 wrote:
I want to create an If esle structures that first evalutes the formula from the left block and if it is true than the formula of right above is done and if it is smaller the formula of right below is used? any suggestion
You original question was solved, but IMHO your underlying physics is flawed.
The equation in the left block is a general equation to estimate at what distance the propagating wavefront surface emitted from a point source has constant phase. This equation assumes electrically large antennas (dishes, etc). "D" in this case is defined as the largest dimension of the source antenna. There are other equations for electrically small antennas that are usually based on the number of wavelengths (i.e., r >> 2*lambda).
The two equations on the right BOTH assume Far Field!! Neither equation will give you the correct results in the near field!!
The upper equation, E is the measured Electric Field intensity at the Receiving antenna. The Poynting Vector is S = E x H. In the Far Field, H = E divided by 377 ohms (for free space). Substituting, you get: S = E^2/377.
The lower equation, is derived from the Friis transmission equation and again valid ONLY in the Far Field: where P=transmit power, G=gain of transmit antenna and "D" is the distance between the transmit/receive antennas. Many textbooks use "R" for that parameter to avoid confusion between "D" and "R".
So... your case selector should instead be
if you know "E"
use first equation
else if you know the transmit power, anttenna gain, and range
use second equation
else if you are in the Near Field
Use Neither equation