Way OT : Any java experts here ?

daba

Lifetime Supporting Member
Join Date
Jul 2004
Location
uk
Posts
5,401
I hate it when I can't figure something out, but this has me stumped...

This online Helical Antenna Design Calculator has an error in it - it gives an incorrect answer for the wire length required.

I looked at the page source, and saw that the calculations are done with a javascript, I found the error quite easily. I decided to use the java formulae in an excel spreadsheet so I could get correct results.

After doing the excel equivalent of the java calculations, I spotted that my excel sheet gives a different answer for the antenna Gain than the answer given by the javascript.

The javascript formula is ...

G= 10.8 + 10*log( CL*CL*N*SL )/LN10;

Given that C = lambda, and CL = C/lambda, CL is always going to be 1.

N is the number of turns (10), and SL is an input value, typically 0.25

So the javascript returns 14.8 dB gain

My excel formula for G is ...

=10.8 + 10*LOG(CL * CL * N * SL)/LN(10)

... which gives 12.5 dB gain

CL is 1.00000
N is 10
and SL is 0.25

The two formulas look to be equivalent to me, but they give different answers, and I can't figure out why... It's been driving me crazy for a few days. Can anyone shed any light on it ?? I'm starting to think that the java isn't handling the LN10 division correctly, but I've got nothing to test it with.

I have attached the full javascript from the web-page, and my excel file...



 
Log called like that in Javascript is not Log10, It is LogE.

The javascript would need to specifiy the formula as such to work like Excel.

G= 10.8 + 10*log10( CL*CL*N*SL )/LN10;
 
Ahhhh !!! Got it :)

The Math.log() function returns the natural logarithm (base e) of a number

Corrected my spreadsheet formula to...

=10.8 + 10*LN(CL * CL * N * SL)/LN(10)

and all is well... Thanks all

Thanks for the heads-up on that online javascript tool... !
 

Similar Topics

Does anyone know what version of java is needed to view the webpages of EthernetIP Safety I/O blocks from Rockwell; I can't find any mention of...
Replies
1
Views
1,599
motion view application for our kineticx 300 does not launch automatically.java latest version 8only installed in our VM ware system . I...
Replies
1
Views
2,602
Hi everyone, I'm looking to get into Ignition, so I downloaded the latest and greatest installer from their site. (v7.9.10) When trying to...
Replies
10
Views
3,206
For those using Ignition, this is a must read from Inductive Automation regarding Oracles decision to require commercial licensing for java in...
Replies
1
Views
2,074
Has anyone had any luck getting the JAVA interface for the Kinetix300 drives working with windows 10?
Replies
2
Views
3,102
Back
Top Bottom