Natural Log (ln) calculation on BS2e
DocNasty
Posts: 1
Hi.· I'm working on a senior design project·for Tulane's EECS department, and I've run into a big hangup right in the home stretch.
I'm trying to convert frequency back into voltage by using the PULSIN command.· I've done a very smooth job of creating a very clean, high pulse
that's representative of one full wavelength.· I'm getting steady results for frequency, however I'm having trouble converting it back.
x = frequency
y = voltage
I've come up with an equation, and I know how to handle the negatives and decimal points.· The problem is the natural log.· Is there a trick in PBasic to do ln?·
y = -6.4836Ln(x) + 44.361
Please help!
-Michael
I'm trying to convert frequency back into voltage by using the PULSIN command.· I've done a very smooth job of creating a very clean, high pulse
that's representative of one full wavelength.· I'm getting steady results for frequency, however I'm having trouble converting it back.
x = frequency
y = voltage
I've come up with an equation, and I know how to handle the negatives and decimal points.· The problem is the natural log.· Is there a trick in PBasic to do ln?·
y = -6.4836Ln(x) + 44.361
Please help!
-Michael
Comments
www.emesys.com/BS2math3.htm#Logcalc
The hard part is always the scaling.
Here's an example using the formula to calculate dewpoint from %RH and temperature, which requires the logarithm of the saturation vapor pressure over water at temperature:
www.emesys.com/programs/dewpoint.bsx
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com