Results 1 to 3 of 3

Thread: Change from exponent

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    23

    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

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    The result is imaginary.

    VB math doesn't do imaginary numbers.

    I'd suggest On Error Goto sub handling.

  3. #3
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    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
  •  



Click Here to Expand Forum to Full Width