Page 1 of 3 123 LastLast
Results 1 to 15 of 31

Thread: Trying to calculate non linear count value based on azimuth value

  1. #1
    Newbie
    Joined
    Sep 2016
    From
    England
    Posts
    14

    Question Trying to calculate non linear count value based on azimuth value

    Hi,

    Ok so this is my first post so apologies if this is in the wrong place or doesn't even make sense...

    I am working with a satellite dish controller which operates and points the dish based on a 'counts' value. The range of counts is 31 - 10819 and the look angle range is 47 East to 47 West. I am trying to calculate the count value for a position in the arc but the controller is non-linear so working out the counts per angle value and multiplying that by the look angle doesn't work.

    I'm not sure if it is even possible to do the calculation but I have a few reference points in the arc and their count values if that helps:

    47E = 31 Counts
    42E = 344 Counts
    33E = 1022 Counts
    21E = 2158 Counts
    10E = 3563 Counts
    3E = 4496 Counts
    -8W = 6105 Counts
    -18W = 7554 Counts
    -27.5W = 8802 Counts
    -37.5W = 9877 Counts
    -47W = 10819 Counts

    If that makes enough sense for anyone to have any ideas or solutions then any help would be very gratefully received!

    Thank you!

    Tom
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Nov 2013
    From
    California
    Posts
    5,680
    Thanks
    2389

    Re: Trying to calculate non linear count value based on azimuth value

    it should be linear enough for this application

    Trying to calculate non linear count value based on azimuth value-clipboard01.jpg
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Sep 2016
    From
    England
    Posts
    14

    Re: Trying to calculate non linear count value based on azimuth value

    Ok, that looks promising... thank you. So what would the calculation be (this is beyond me!)

    Thanks,

    Tom
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Nov 2013
    From
    California
    Posts
    5,680
    Thanks
    2389

    Re: Trying to calculate non linear count value based on azimuth value

    Quote Originally Posted by tbow50 View Post
    Ok, that looks promising... thank you. So what would the calculation be (this is beyond me!)

    Thanks,

    Tom
    it's right there in the sheet where it says FittedModel
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    16,072
    Thanks
    3634

    Re: Trying to calculate non linear count value based on azimuth value

    sinusoidal regression ...
    Attached Thumbnails Attached Thumbnails Trying to calculate non linear count value based on azimuth value-sinusoid1.png   Trying to calculate non linear count value based on azimuth value-sinusoidal_reg_eq.png   Trying to calculate non linear count value based on azimuth value-sinusoid_window.png  
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Sep 2016
    From
    England
    Posts
    14

    Re: Trying to calculate non linear count value based on azimuth value

    Ok so I realise that maybe I'm being a bit of a dumb ass here but what I'm after is an equation based on the upper and lower limits so that I can calculate the count value for any angle within the range.

    For example I would be able to calculate that to go to 14E I need to move to x counts, or to go to -23W I would go to x counts. If someone could give me an example of that then I would be eternally grateful.

    Thank you so much for the help so far!

    Tom
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    16,072
    Thanks
    3634

    Re: Trying to calculate non linear count value based on azimuth value

    using the linear model provided by romsek ...

    x = angle, y = counts

    $y = 5177.17-120.992x$

    so, for 14E $\implies$ x = 14 ...

    $y = 5177.17-120.992(14) \approx 3483$


    using the sinusoidal equation I provided in post #5

    $y = 5948.356\sin(.024x - 3.004) + 5768.470$

    $y = 5948.356\sin[.024(14) - 3.004] + 5768.470 \approx 3056$


    I also performed a cubic regression shown in the attachments ...

    $y = 0.013x^3 + 0.218x^2 - 142.091x + 4959.825$

    $y = 0.013(14)^3 + 0.218(14)^2 - 142.091(14) + 4959.825 \approx 3049$


    if you want the count for -23W, use x = -23 in each model
    Attached Thumbnails Attached Thumbnails Trying to calculate non linear count value based on azimuth value-cubic1.png   Trying to calculate non linear count value based on azimuth value-cubic_reg_eq.png  
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Junior Member
    Joined
    Aug 2011
    Posts
    29

    Re: Trying to calculate non linear count value based on azimuth value

    Cubic splines will give a pretty good result.

    You can also use the generalized logistic function. For your data we have the following results.

    A=13858.62
    K=-1383.02
    Q=1.122
    B=0.04317
    v=1.403
    This actually gives a pretty good fit, the mean error is about 17 'counts' which amounts is a small fraction of a degree.
    Last edited by frustrated; Sep 30th 2016 at 04:10 AM.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Sep 2016
    From
    England
    Posts
    14

    Re: Trying to calculate non linear count value based on azimuth value

    Is there any chance someone could translate the equation(s) into an Excel Spreadsheet for me, I'm still struggling with making the math work for the examples in my original post.

    Again, thank you so much for the help!

    Tom
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Junior Member
    Joined
    Aug 2011
    Posts
    29

    Re: Trying to calculate non linear count value based on azimuth value

    Hi Tom,

    Any nonlinear problem can be solved in excel using the Generalized Reduced Gradient algorithm as implemented in the 'solver' add on, which is free and already there, but just needs to be activated.

    For cubic splines the easiest method is to download a third party add on, there are a few free ones available.
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Newbie
    Joined
    Sep 2016
    From
    England
    Posts
    14

    Re: Trying to calculate non linear count value based on azimuth value

    Ok so I have got the sinusoidal regression from post 5 working and pretty accurate so my last (hopefully) question is how were the a, b, c & d values calculated/generate from the original data?

    Cheers,

    Tom
    Follow Math Help Forum on Facebook and Google+

  12. #12
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    16,072
    Thanks
    3634

    Re: Trying to calculate non linear count value based on azimuth value

    Quote Originally Posted by tbow50 View Post
    Ok so I have got the sinusoidal regression from post 5 working and pretty accurate so my last (hopefully) question is how were the a, b, c & d values calculated/generate from the original data?
    I performed a sinusoidal regression on my TI-84 calculator ... the screen shot shows its calculation.
    Follow Math Help Forum on Facebook and Google+

  13. #13
    Junior Member
    Joined
    Aug 2011
    Posts
    29

    Re: Trying to calculate non linear count value based on azimuth value

    Quote Originally Posted by tbow50 View Post
    Ok so I have got the sinusoidal regression from post 5 working and pretty accurate so my last (hopefully) question is how were the a, b, c & d values calculated/generate from the original data?

    Cheers,

    Tom
    If you want to do it in excel,

    make a column (1) for x data (degrees)
    make a column (2) for y data (counts)
    make a column (3)for estimated y as derived from some arbitrary values for your variables
    make a column (4) for squared errors (estimated y - y)^2
    make a cell for the sum of squared errors (sum of the elements in (4))

    Now open the solver add on and make the target cell the sum of squared errors, set your regression variables as variables in the add on, and set it to minimize the target with no constraint that the variables be positive.

    The result will give the local optimum from your initial starting conditions. For sinusoidal regression the local optimum will be a global optima.
    Last edited by frustrated; Oct 4th 2016 at 06:02 AM.
    Follow Math Help Forum on Facebook and Google+

  14. #14
    Newbie
    Joined
    Sep 2016
    From
    England
    Posts
    14

    Re: Trying to calculate non linear count value based on azimuth value

    Thanks everyone. I am just trying to get this figured out and have a couple more questions...

    Skeeter, in post #5 how were the values in the third image generated, -56.4 etc? They are what I am having problems calculating at the moment.

    Frustrated, how did you generate the values in your post #8 based on the inital data?

    As always, the help is very much appreciated.

    Tom
    Follow Math Help Forum on Facebook and Google+

  15. #15
    Junior Member
    Joined
    Aug 2011
    Posts
    29

    Re: Trying to calculate non linear count value based on azimuth value

    Hi Tom,

    Use the instructions in my post above (for nonlinear regression) but use the generalized logistic function: https://en.wikipedia.org/wiki/Genera...istic_function, for the results I gave I set C=1, but you can try letting it be another free variable.
    Follow Math Help Forum on Facebook and Google+

Page 1 of 3 123 LastLast

Similar Math Help Forum Discussions

  1. Replies: 3
    Last Post: Feb 3rd 2015, 07:45 PM
  2. How to calculate X in a series based on 2 correlated arrays
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: Jan 28th 2013, 03:08 PM
  3. Replies: 1
    Last Post: Nov 5th 2012, 10:11 PM
  4. Calculate output power based on speed
    Posted in the Advanced Applied Math Forum
    Replies: 3
    Last Post: Dec 31st 2009, 08:55 AM

/mathhelpforum @mathhelpforum