-1

edit: Proper values and equation:

R=(Tpow-T)*(1-exp((x**2*alfa*t)/k**2)*(1.0-erf(x*sqrt(alfa*t)/k)))
R = np.array([[24.7,46.12, 64.78, 81.12, 95.52],
       [ 108,119.6, 183, 183, 183],
       [129.7,138.77, 146.9, 154.3, 161],
       [167.06,172.6,177.7, 182.3, 186]])


T = np.array([[20,20,20,20,20],
       [20,20,20,20],
       [20,31,12,23,14],
       [15,11,37,28,19]])  

I calculate x in excel but only for T=20, correct values should be around:

x = np.array([[10,20,30,40,50],
       [60,70,80,90],
       [100,?,?,?,?],
       [?,?,?,?,?]])

let's look at random (implicit) equation:

R[i,j]=T[i,j]*exp(x*B)*x*A

where R,T - are 2D np.array, A,B - constant values and x is unknown value.

How to write right loops to get numerical result of that equation in new array. I would like to solve my equation independently for each:

R[1,1], T[1,1] = x[1,1]

R[2,2], T[2,2] = x[2,2]

and so on.

.

.

It's not so easy because of operating on implicit function

random values:

TR = np.array([[24,46, 64, 81, 95],
       [167,172,177, 182, 186]])

T1 = np.array([[22,10,6,52,12],
       [10,10,2,3,6]])

A = 20
B = 30




 X = np.array([[?,?,?,?,?],
              [?,?,?,?,?]])

As you suppose I'm beginner in programming so please try to explain to me as a kid.:)

I got help with equation with one array and implicit equation but I cannot implement it to this kind of problem: Solve non linear equation numpy

Duraa
  • 45
  • 1
  • 1
  • 7

1 Answers1

0

There is a lot of parameters, alpha, t , k..you should explain what's mean each an example with explicit value.

I don't know if you can do it by using only python, but I think if you have an equation like that:

R=beta*T*exp(alpha*X)*X

Supposing that alpha and beta are constant, the easy way is to check if T is a reversible matrix then you will get only this equation

reverse(T)*R=beta*exp(alpha*X)*X

and using this expression you will get a linear equation and then you can use np.linalg.solve to solve it

enter image description here

C.med
  • 581
  • 1
  • 5
  • 21
  • an interesting example https://stackoverflow.com/questions/19542801/solving-non-linear-equations-in-python – C.med Aug 22 '18 at 13:29