|
-
Dec 11th, 2002, 12:54 PM
#1
Thread Starter
Junior Member
Change from exponent
Hey
I need to change this equasion around so that it doesnt use the exponent function. i know you can do it, i just how. Any suggestions, in desperate need of help. An example of what values my be in the variables are:
Best_A = 22.164
Best_B = 2.813
Best_h0 = 1.008
Y = 0.4
Code:
X = Best_A * (Y - Best_H0) ^ Best_B
Thanks
-
Dec 11th, 2002, 01:57 PM
#2
So Unbanned
The result is imaginary.
VB math doesn't do imaginary numbers.
I'd suggest On Error Goto sub handling.
-
Dec 30th, 2002, 09:15 AM
#3
Re: Change from exponent
Originally posted by CanucksRule
Best_A = 22.164
Best_B = 2.813
Best_h0 = 1.008
Y = 0.4
Code:
X = Best_A * (Y - Best_H0) ^ Best_B
You still can operate with imaginary numbers as long as you stick to the rules. For example, (Y - Best_H0) ^ Best_B could be expressed as:
(0.4 - 1.008)2.813 = (-0.608)2.813 = (-1)2.813 * (0.608)2.813 = (-1)2.813 * 0.247 (approx.)
Call x the first (imaginary) term and compute it as:
x = (-1)2.813
ln(x) = 2.813 ln(-1) = 2.813*i*Pi (because -1 = exp(i*Pi))
where i=Sqr(-1)
so:
x = exp(2.813*i*Pi) = cos(2.813*Pi) + i*sin(2.813*Pi) = 0.988 + i*0.154
And finally you get:
(0.988 + i*0.154)*0.247 = 0.244 + i*0.038 (approx.)
(and now multiply this by Best_A)
Last edited by krtxmrtz; Dec 31st, 2002 at 03:51 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|