A fun math problem


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default

    Oh, I see.

    There is no PC connected to the unit, so there is no way to compute this. The PIC has to do all the work, and transmit the converted MB to Meters or Feet....

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Lightbulb

    Maybe I can try to translate from Canadian to English. (Just kidding Steve)

    Steve's idea is to pre-calculate every value before hand using the PC. It could be done with VB or you could do it in excel if you wanted. Those values are then stored in an external eeprom as one great big look-up table.

    Then later when the pic is running, when it needs to convert the numbers, it doesn't have to do any calculations. Just look up the answer from the eeprom. The PC doesn't need to be hooked up to the PIC during normal operation.

    Assuming you wanted a range of 600-1100 milibars with 1 decimal place, you could store the whole thing in a 16kbyte eeprom. If you needed 2 decimals it would take a 128kbyte eeprom (yikes).

    To calculate the given formula in real time, you would need at least 48-bit math (due to the decimals requested) so there really aren't many other options.

    I even tried a 3rd order Power Polynomial formula to try to approximate the numbers, and it came up with an error of +/- 100 feet at the high and low ends. (Not too good)

    HTH,
       Darrel
    Last edited by Darrel Taylor; - 13th June 2005 at 06:22.

  3. #3
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default

    Now I get it!

    Thanks folks for helping me see the options here. Since the number of feet between 0 and 30,000 would require me to store 30,000 locations, this does not seem feasable on a PIC.

    I now understand how it would work however, and options might be to store 3000 locations and increment every 10, etc. However, for this application I think I will chalk it up to 'not in scope'..

    Thanks,

    Tom

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Not quite yet.

    You would be storing them according to millibars not feet.

    With a range of 600.0 to 1100.0 there are 5000 locations. Each value uses 2 bytes' for a total of 10,000 bytes.

    If the range is 2 decimals 600.00 to 1100.00 there are 50,000 locations that would require 100kbytes.

    Definately "Within Scope".

    Don't give up yet.

    Darrel

  5. #5
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    Hi Tom,

    Ihelped a guy named Steve Turner once, he had the same problem. Since he made a pretty good job of explaining his project on his site, i will not do it again. Just follow this link .....

    http://www.steveonweb.com/alt.php

    /Ingvar

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. PicBasic Pro Math Problem??
    By Glen65 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th March 2006, 04:36
  3. Math Problem
    By rwskinner in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st March 2006, 13:01
  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