求解指数方程

时间:2019-04-23 14:30:18

标签: python numpy scipy

下面有一个指数方程:

9254.315 = EXP(G1)+ EXP(G2)+ EXP(G3)

我需要计算(G1 + G2 + G3)的总和。

2 个答案:

答案 0 :(得分:1)

Your problem is not about programming, it's about maths.
[9254.315 = EXP(G1) + EXP(G2) + EXP(G3)]*ln
ln(9254.315) = ln*EXP(G1) + ln*EXP(G2) + ln*EXP(G3)
example : ln*exp(x) = x. So ln times exp of variable is the 
variable
So you have : 9.132 = G1 + G2 + G3

答案 1 :(得分:0)

If you ready know the values, you can use this function.

import numpy as np

def sumExpo(*nums):
    x = 0
    for num in nums:
        x += np.exp(num)
    print(x)

sumExpo(4,9,7)