将线性比例转换为对数 [英] Convert Linear scale to Logarithmic

查看:235
本文介绍了将线性比例转换为对数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个线性刻度,范围从0.1到10,变化增量为0.1:
   | ---------- [] ---------- |
0.1      5.0

但是,输出确实需要是:
   | ---------- [] ---------- |
0.1的比例尺(对数)0.1

我正在尝试找出将5(例如)转换为1.0所需的公式. 因此,如果刻度盘在1.0到10之间移动一半(线性刻度的实际值为7.5),对数值将是多少?考虑了好几个小时,但是我已经有好几年没有使用这种数学了,所以我真的迷失了.我了解log 10 X = 10 y 的基本概念,但仅此而已.

5.0的伪值将变为10(或10 1 ),而10的伪值将是10 10 .那么,如何计算7.5的伪值的对数值?

让我知道是否需要添加信息.

感谢您提供的任何帮助;这打败了我.

解决方案

符号

按照数学和编程中的惯例,"log"函数被视为base-e. "exp"功能是指数功能.请记住,这些函数是逆函数,我们将这些函数取为:

exp:ℝ→ℝ +

log:ℝ + →ℝ.

解决方案

您只是在这里解决一个简单的方程式:

y =一个exp bx

通过点x = 0.1,y = 0.1和x = 10,y = 10求解 a b .

观察到比率y 1 /y 2 的计算公式为:

y 1 /y 2 =(exp bx 1 )/(exp bx 2 ) = exp b(x 1 -x 2 )

哪个可以解决 b

b =日志(y 1 /y 2 )/(x 1 -x 2 )

其余的很容易.

b =对数(10/0.1)/(10-0.1)= 20/99对数10≈0.46516870565536284

a = y 1 /exp bx 1 ≈0.09545484566618341

更多关于符号的信息

在您的职业生涯中,您会发现人们习惯使用log函数使用e,10和2的约定.这并不意味着任何人是对还是错.只是一个符号约定,每个人都可以自由使用他们喜欢的符号约定.

在数学和计算机编程中,常规都是使用e底的对数,在这种情况下使用e底会简化表示法,这就是我选择它的原因.它与Google和您的TI-84等计算器所使用的惯例不同,但是,计算器又适用于工程师,工程师使用的符号不同于数学家和程序员.

以下编程语言在标准库中包含base-e日志功能.

事实上,我想不出 single 编程语言,其中log()是除e底的对数以外的任何东西.我确定存在这样的编程语言.

I have a linear scale that ranges form 0.1 to 10 with increments of change at 0.1:
  |----------[]----------|
0.1         5.0         10

However, the output really needs to be:
  |----------[]----------|
0.1         1.0         10 (logarithmic scale)

I'm trying to figure out the formula needed to convert the 5 (for example) to 1.0. Consequently, if the dial was shifted halfway between 1.0 and 10 (real value on linear scale being 7.5), what would the resulting logarithmic value be? Been thinking about this for hours, but I have not worked with this type of math in quite a few years, so I am really lost. I understand the basic concept of log10X = 10y, but that's pretty much it.

The psuedo-value of 5.0 would become 10 (or 101) while the psuedo-value of 10 would be 1010. So how to figure the pseudo-value and resulting logarithmic value of, let's say, the 7.5?

Let me know if addition information is needed.

Thanks for any help provided; this has beaten me.

解决方案

Notation

As is the convention both in mathematics and programming, the "log" function is taken to be base-e. The "exp" function is the exponential function. Remember that these functions are inverses we take the functions as:

exp : ℝ → ℝ+, and

log : ℝ+ → ℝ.

Solution

You're just solving a simple equation here:

y = a exp bx

Solve for a and b passing through the points x=0.1, y=0.1 and x=10, y=10.

Observe that the ratio y1/y2 is given by:

y1/y2 = (a exp bx1) / (a exp bx2) = exp b(x1-x2)

Which allows you to solve for b

b = log (y1/y2) / (x1-x2)

The rest is easy.

b = log (10 / 0.1) / (10 - 0.1) = 20/99 log 10 ≈ 0.46516870565536284

a = y1 / exp bx1 ≈ 0.09545484566618341

More About Notation

In your career you will find people who use the convention that the log function uses base e, base 10, and even base 2. This does not mean that anybody is right or wrong. It is simply a notational convention and everybody is free to use the notational convention that they prefer.

The convention in both mathematics and computer programming is to use base e logarithm, and using base e simplifies notation in this case, which is why I chose it. It is not the same as the convention used by calculators such as the one provided by Google and your TI-84, but then again, calculators are for engineers, and engineers use different notation than mathematicians and programmers.

The following programming languages include a base-e log function in the standard library.

In fact, I cannot think of a single programming language where log() is anything other than the base-e logarithm. I'm sure such a programming language exists.

这篇关于将线性比例转换为对数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆