Math Problem


Closed Thread
Results 1 to 7 of 7

Thread: Math Problem

  1. #1
    Join Date
    Oct 2005
    Posts
    74

    Question Math Problem

    Where am I going wrong on the following formula?

    Bosch has a formula stating...

    Lambda = (Xo2 / 3 + 1) / ( 1 - 4.76 * X02)

    Then they show the following as references....

    IP = 1.40
    Xo2 = 12.0
    Lambda = 2.42

    This does not work given the above formula using 12.0% Xo2 or I'm doing Math Wrong.

    Lambda = (Xo2 / 3 + 1) / ( 1 - 4.76 * Xo2)

    Xo2 = 12.0
    (12.0 / 3) + 1 = 5
    1 - (4.76 * 12) = -56.12
    5 / -56.12 = -0.089

    Where am I going wrong?

  2. #2
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Well if you're not using some kind of floating point software routine... the code you listed won't work. Picbasic only works with integers.
    HERE'S a good thread to read that speaks to the hardware side of why, and Here is a good reference as to get around the limitations of working with integer math. And finally, HERE is melabs solution.
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  3. #3
    Join Date
    Oct 2005
    Posts
    74


    Did you find this post helpful? Yes | No

    Default

    I'm trying to get it to work on a calculator first, then work out the details on the pic. I'm not having any luck at either. This is a published formula, but I tried it in every operator precedence that I know of and can't make it work.

    I posted here because of all the math gurus.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117


    Did you find this post helpful? Yes | No

    Default

    May be the 12% should be in your variable as 0.12 ?

    Ioannis

  5. #5
    jheissjr's Avatar
    jheissjr Guest


    Did you find this post helpful? Yes | No

    Default

    Where is IP used in the equation and where are you getting this information from?

  6. #6
    Join Date
    Oct 2005
    Posts
    74


    Did you find this post helpful? Yes | No

    Default

    IP was nothing more than a reference number to lookup 12% on a table. The actual .12 is the number used to calculate Lambda.

    This information, examples, and formula is from Page 10 of the Bosch LSU4 Datasheet.
    Last edited by rwskinner; - 1st March 2006 at 13:21.

  7. #7
    eoasap's Avatar
    eoasap Guest


    Did you find this post helpful? Yes | No

    Default

    Ionnas is right, you need to use 0.12 for your 12 percent.
    The reason is in the definition of 'percent'. for example,
    50% is 50 out of 100, which is 50/100 which is 1/2. 12% is
    12 out of 100 --> 12/100 = 0.12
    one hundred percent would be just 1.00
    one hundred and fifty percent would be 1.50

    assuming you haven't gotten this on your calculator yet,
    i took it step by step so you can see the order of operations.
    hope it helps!

    Lambda = (Xo2 / 3 + 1) / ( 1 - 4.76 * Xo2) (given equation)
    = (0.12/3 + 1) / (1 - 4.76 * 0.12) (equation with values put in)
    (perform division and multiplication inside parenthesis first)
    = (0.04 + 1) / (1 - 0.5712)
    (perform addition within parenthesis next)
    = (1.04) / (0.4288)
    (perform division of parenthesis last)
    = 2.4253731

    any modern calculator should be able to perform this if you enter it exactly
    as it is written. it knows the order of operations and applys them.

    (Xo2 / 3 + 1) / ( 1 - 4.76 * Xo2)
    on your calculator do this:
    ( 0.12/3 + 1 ) / ( 1 - 4.76 *0.12 )

    however, if you screw up the parenthesis, it'll give you wrong answer
    Last edited by eoasap; - 1st March 2006 at 13:08.

Similar Threads

  1. Line Graph, math problem...
    By TerdRatchett in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th May 2009, 04:20
  2. Math problem with string result
    By Lotondo in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 15th November 2006, 10:06
  3. PicBasic Pro Math Problem??
    By Glen65 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th March 2006, 04:36
  4. Math Formula / Variable Problem! Help!
    By bwarp in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th February 2006, 07:59
  5. Math problem...with picbasic pro
    By pcaccia in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th October 2005, 19:28

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts