the formula is in the pic and i tried typing it:
b=5√(K*∛(0,01)+(1-e^x)^2 )
thank you!
b=5√(K*∛(0,01)+(1-e^x)^2 )
thank you!
please help me convert this formula via the math module
|
the formula is in the pic and i tried typing it:
b=5√(K*∛(0,01)+(1-e^x)^2 ) thank you!
Apr-10-2024, 12:51 AM
** is the power operator, not ^. You can also use the power operator for roots x ** (1/2) is square root and x ** (1/3) is cubed root. For Euler's number (e) you will need to look at the math library. You'll also find functions for ex (exp(x)), xy (pow(x, y). There is no function for roots, but you can use pow() with a fraction for the exponent.
https://docs.python.org/3/library/math.html
Jun-26-2024, 08:26 AM
(This post was last modified: Jun-26-2024, 08:28 AM by ebn852_pan.)
So you would write it in like that? And that would work or show the results of the function or definition when used or appropriate. example. But is this correct procedure in Python on writing out the math and Python programming? The formula would turn into h = e**2. Written on the screen the correct way or as seen on the attachment. Something like it.
h = input((exp(x)) print('you forgot + C for the formula')
Programs are like instructions or rules. Learning it gets us closer to a solution. Desired outcome. Computer talk.
Jun-26-2024, 09:19 PM
(This post was last modified: Jun-26-2024, 09:19 PM by ebn852_pan.)
My online compiler showed me this. But the class Image module which is in my chrome has an open method. So this is one thought to bring up when working with online compilers. The module will ask for one position argument to give. Then the output.
Programs are like instructions or rules. Learning it gets us closer to a solution. Desired outcome. Computer talk.
Jul-09-2024, 07:24 AM
I read it is better to use math.pow() than the Python x**num. The result will be more accurate.
I think this does what you want. import math # b=5√(K*∛(0,01)+(1-e^x)^2 ) K = 100 x = 2 # e to power 1 math.exp(1) b = 1 - math.exp(x) b = math.pow((1 - math.exp(x)), 2) b = math.pow(0.01, 1/3) + math.pow((1 - math.exp(x)), 2) b = K * math.pow(0.01, 1/3) + math.pow((1 - math.exp(x)), 2) b = math.pow(K * math.pow(0.01, 1/3) + math.pow((1 - math.exp(x)), 2), 0.2) # or like this c = 1 - math.exp(x) d = math.pow(c, 2) e = math.pow(0.01, 1/3) f = K * e + d g = math.pow(f, 0.2) |
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Math Module import | Jack_Sparrow | 3 | 7,500 |
Apr-30-2018, 01:41 PM Last Post: snippsat |