+ Reply to Thread
Results 1 to 52 of 52

Finding the smoothest, flattest curve from a combination of various site values.

  1. #1
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Question Finding the smoothest, flattest curve from a combination of various site values.

    Hi all,

    I have a list of sites listed 1 to 57 each with y values corresponding to x-values. I am trying to find the best sum of y-values, which gives the smoothest cumulative curve, corresponding the the x-values. In order to this there will have to be only certain sites chosen. Is there a conventional way of doing this?

    I have attached the file:
    https://drive.google.com/open?id=0B9...UE4WXRNNXhJbFU

    Thanks in advance!

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Off the top of my head, I cannot immediately think of a good algorithm. Something like this seems the most obvious approach, though it seems to be a sort of "brute force" approach:

    1) Compute cumulative curve for each site. I'm not exactly sure how you intend to compute this. Will it be a simple "running sum" that can be computed with a SUM() function, or is there more to this quantity?
    2) Compute "smoothness" and/or "flatness" score for the cumulative curve for each site. Again, I am not sure exactly what constitutes "smooth" and "flat", or how best to measure that. Perhaps come up with a curve that is "perfectly flat" (as best fits the scenario you are trying to understand here), then measure how different your actual data is from this "perfect" curve.
    3) Rank the resulting "smoothness or flatness" scores.

    You might spend some time with how you want to measure "smoothness" and "flatness". Once one understands how these are to be measured, it might be possible to avoid step 1, and infer those scores directly from the raw data.

    I know that this is a rather generic and broad overview. Perhaps with a better, more detailed explanation of how you want to perform these calculations, we can better help provide specific suggestions.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Question Re: Finding the smoothest, flattest curve from a combination of various site values.

    Hi Mr. Shorty, thanks for your reply. Firstly, when it's the cumulative sum of sites that I'm trying to find the smoothest curve from. I'm trying to determine which ones to use in order to give the smoothest profile out of all the different types of SUM combinations I could choose from.
    Each site has sinusoidal features you see, so making the overall curve fluctuate as little as possible is what I am after, without obviously changing the data. Finding the combination that gives the lowest average gradient is another way of saying this, but again I wouldn't know how to do this.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    In terms of the cells and their values, how do you calculate "smoothness".

    I'm guessing that row 1 is your site numbers and that column A is time (in days)
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Question Re: Finding the smoothest, flattest curve from a combination of various site values.

    Row A is the time in days, then Row B is the values corresponding to each X value in A, and so forth... labelled 1-> 57 at the top.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    I still do not understand exactly what you want to do. Making some assumptions:

    0) I deleted all but three data sets. If we can understand how you want to analyze these three, and choose the smoothest, then we should be able to figure out how to extend it to more data sets.
    1) I computed simple running summations =sum(b$2:b2) copied down and across. These cumulative sums are plotted in the chart.
    2) I have no idea how you want to measure "smoothness". Looking at the original data, perhaps something measuring "amplitude" (difference between max and min), but I don't really know what you are wanting to do here.
    3) This should be fairly straightforward once 1 and 2 are figured out.

    Limiting to these three data sets, how would you rank these three?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Question Re: Finding the smoothest, flattest curve from a combination of various site values.

    I'll give an example. If I chose sites 1, 2 and 4, for the value of x = 0, the y value for this point would be =SUM(B2,C2,E2). The value for the y value for the second point of x would be =SUM(B3,C3,E3), and so forth until reaching 29.53.
    It's the choice of sites within the SUM that I need to figure out. The sites being the Rows B (site 1) to Row BF (site 57). I forgot to mention that the sites that are orange cannot be included.
    In terms of measuring the smoothness. I think finding measuring smoothness, by the the graph with the smallest difference between minimum and maximum points of y is the best way of doing so.

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Now I think I am getting a clearer understanding of what you want to do. Here's the basic "brute force" algorithm that I am seeing:

    1) Compute sums for all possible combinations.
    1a) This starts with a combinatorial generator for generating combinations 1,2,3 -- 1,2,4 -- 1,2,5 and so on
    1b) Sum for each combination for each point.
    2) Measure smoothness.
    2a) extract max and min for each combination, take difference.
    3) Identify which combination has the smallest difference, ignoring those combinations that should not be considered.

    I have illustrated this on a smaller subset of your data set. Study the formulas so you can see how I am implementing each step described above. Then apply the same steps to your larger data set. I have left step 3 undone, as it should be a simple min and lookup function.
    I will emphasize that this is a simple brute force algorithm. As one understands the nature of the problem, there me be a more efficient algorithm that does not require generating every possible combination.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Question Re: Finding the smoothest, flattest curve from a combination of various site values.

    Yes that's almost it, except it's for any number of sites combined, and sites 1 and 2 don't necessarily have to be used. The other thing is that sites after 30 have very low values, and even though they fluctuate loads, will have much smaller differences between minimum and maximum on their own, rather than combining sites.
    I think the best way of measuring smoothness is to find the maximum gradient across all combinations, and whichever one is the lowest is the smoothest. Alternatively, finding the gradient between adjacent points, from 0>29.53, then finding the average, and whichever one is the lowest can be counted as the smoothest. The only problem I would have is finding a quick way to this. There are 53 or so sites (when excluding the ones in orange) so there's 1000s of different combinations. And even then finding the gradient across all of these site combinations will take days, if not months.

    I apologize, this is really difficutl to try to explain over the computer, but if you get the excel spreadsheet I attached up, you should hopefully get what I mean.

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Yes that's almost it, except it's for any number of sites combined, and sites 1 and 2 don't necessarily have to be used.
    The spreadsheet I uploaded, when expanded, should not be limited to 1,2,x combinations only. It should apply to all combinations, if you expand the formulas until they generate other combinations. I kept the spreadsheet small so that you could see how the procedure basically works. I was kind of leaving it up to you to expand it beyond the example conditions I have listed.

    I think the best way of measuring smoothness is to find the maximum gradient across all combinations, and whichever one is the lowest is the smoothest.
    I am not exactly clear on what you mean by 'gradient', but, if the basic idea seems right to you, then it seems right to me as well. I would probably still use the same basic "layout"/algorithm -- generate all possible combinations across the top, compute "gradient" for each combination, identify which "gradient" is smallest.

    The only problem I would have is finding a quick way to this.
    Without a better understanding of the properties of the problem, all I can think of is the "brute force" algorithm. We have some very clever people on this forum as far as Excel programming goes. If you explain an algorithm to us, we can usually help you implement that algorithm in Excel. I do not know how many people who are good at the more generic "algorithm development" part of these problems. I will ask around, but do some research to help us out. It would probably help if you upload a "small" sample that easily illustrates the properties of the system you are studying. A smaller sample will allow someone who wanted to explore the behavior of the problem something manageable to test and try different approaches. Perhaps someone can come up with an algorithm that will be more efficient than "brute force".

  11. #11
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Yes, with combinations not being just 3, could be any number. I'll explain what I mean by gradients:
    So you have one of the combinations, find the gradient between adjacent points. So the gradient between x values of 0 and 0.035, then 0.035 and 0.075, then so forth. With this maybe finding the average of all gradient of all these points for each site? and whichever combination has the lowest average can be classed as the smoothest profile?

  12. #12
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    es20g13 I'll have a look through the thread but it would help if you could explain why you want to do this. ie what is the purpose of the calculation. It helps me to get my mind round the problem.


    click on the * Add Reputation if this was useful or entertaining.

  13. #13
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Hi Tony, Basically the y-axis of each site is for free-stream power production across a lunar month. Due to the intermittent nature of tides, other generators, in particular coal and gas, need to be dialled up or down in correspondence to fluctuations in generation from tides in order to match power demand, as the total generation always has to match the total power demand. What I'm trying to do is produce the flat and stable profile. If you make a scatter graph with curve trend lines of site1 with site with the x values, you will see it fluctuates loads.
    the other graph I had to produce were the sum of all every y value for a particular point in x added together for that x value.

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    From Mr. Shorty's three curves it appears that the lowest curve must also be the smoothest
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  15. #15
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    But the y-values. For each site chosen, the y-values must correspond to the x-values.

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    But the curves are apparently waves and sinusoidal

  17. #17
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    So you have one of the combinations, find the gradient between adjacent points. So the gradient between x values of 0 and 0.035, then 0.035 and 0.075, then so forth. With this maybe finding the average of all gradient of all these points for each site? and whichevhat er combination has the lowest average can be classed as the smoothest profile?
    Recognizing that some of this could be difference in terminology from across the pond -- are you using "gradient" the way I use the word "slope"? m=(y2-y1)/(x2-x1)?

    If so, I would assume that "average gradient/slope" should be the same as "slope between final and starting point", would it not? Or, when you say "average gradient/slope" are you thinking of taking the average of the absolute value of the slopes/gradients so that positive and negative don't just cancel each other out?

    Due to the intermittent nature of tides, other generators, in particular coal and gas, need to be dialled up or down in correspondence to fluctuations in generation from tides in order to match power demand, as the total generation always has to match the total power demand. What I'm trying to do is produce the flat and stable profile.
    Seeing this as a "power demand" problem where you are using tides to generate power helps put the problem in context. As an engineer, I would wonder how other power companies and their engineers have solved this problem, as I find it a little difficult to believe that this is the first time that engineers have had to consider how to smooth out the fluctuations in tidal generation (or other power sources that are not consistent like wind).

    Sorry, I don't have much more to add at this point. It looks like an interesting problem. I might ask if this is a real world problem, or if you are a student studying this problem in an academic setting. In either case, I would probably be asking myself how other engineers solve these problems, and see if that provides insight into my problem.

  18. #18
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Question Re: Finding the smoothest, flattest curve from a combination of various site values.

    So the lower the gradient the smoother the line lets say? But with these graphs, point to point there are many lines, so we would need to work out the gradient between 0.035 and 0, 0.075, 0.035, and so forth, calculate the average of all the values for this combination to get an average gradient. Smoothness is the lowest gradient yes? But if you look make a power-time graph of any one of the sites, there are multiple trendlines, joining 1 point the the next and so forth. So surely working out the mean gradient of all these trend lines for each combination would determine the overall smoothness.
    I could easily do this, but there's 1000's of site combinations.

    So what I essentially require is to find a way of firstly generating the different combinations, which I explained how to do earlier, as it would take months to do manually. Secondly, I would need to find a way of working out the gradients for each point of each of these site combinations, then thirdly working out the average gradient for each of these site combinations.


    I'm doing this for my dissertation, and I agree with you! I've been through Engineering village, Science Direct and my University faculty, and it seems like this is one of the first attempts. It's really interesting, but I have no clue if my modelling is completely wrong .

    I've had to model it through Excel though. I attempted to do it through Matlab, but adding up each site is a lot more complicated when you've got to consider the phase difference from site to site. This isn't a worry anymore as i've taken this into account already on excel.

  19. #19
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    You could get the regression line for each and compare the maximum displacement from point to line for each and the lowest maximum translates to the smoothest series

  20. #20
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    As common as solar and wind are around here, I am surprised that no one has published anything on this kind of problem, yet. Breaking new ground, I guess.

    As I have thought about it, I wonder if a good starting place for developing this algorithm would be one of the "find which combinations of numbers in a list add up to a constant" problems that are so common in accounting. It seems like that would be the smoothest possible output for the tidal generators -- a constant output. I recognize that this result may technically be impossible, but I wonder if it would make a good starting point for the algorithm you are looking for. I might suggest researching the algorithms used for that sort of problem, then see how you might adapt those algorithms to this problem. Of course, this is a common question on this forum, so you might run through this site's search engine.

    Most of the "find the combination that adds up to k" problems in Excel are approached using Excel's Solver utility. I find it to be somewhat inefficient, so it may not work well for your problem. You may need to look deeper into the algorithms to see exactly how they work. If you are not careful, this may take you into concepts of "linear programming". This may be a good opportunity to find someone in the Computer Science department and discuss algorithms for solving those kinds of problems. It seems unlikely that someone in the computer science department will want to use a spreadsheet for this. He/She will want to use a different programming language, but it would seem that the choice of programming language is not important at this point. Developing the algorithm is what is important.

  21. #21
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Quote Originally Posted by es20g13 View Post
    There are 53 or so sites (when excluding the ones in orange) so there's 1000s of different combinations.
    If there are 53 signals, then there are 2^53 ways to combine them -- a number well beyond astronomical. Even limiting the selection to 3 gives 23,000-odd possibilities.

    At a glance, the numbers all appear to be rectified sinusoids (absolutes of tidal gradients, right?).

    If they are are all the same frequency (I didn't check), and ignoring the envelope modulation, then each can be characterized by a single number: its phase. And if that's true, the problem reduces to picking equally-spaced phases (e.g., 0, 120, and 240 degrees), no?
    Last edited by shg; 04-09-2016 at 12:50 PM.
    Entia non sunt multiplicanda sine necessitate

  22. #22
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Data Range
    J
    K
    L
    M
    N
    O
    P
    Q
    23
    1
    2
    3
    1
    2
    3
    24
    Gradient
    0.023
    0.016
    0.012
    43.7
    31.1
    22.8
    25
    26
    27
    Exp
    0.46
    0.32
    0.24
    20 days
    874
    622
    456
    28
    Obs
    0.173828
    0.123609
    0.090501
    942.32
    670.0835
    490.6055
    29
    ¥
    0.286172
    0.196391
    0.149499
    68.32002
    48.0835
    34.60547
    30
    31
    Exp
    0.23
    0.16
    0.12
    10 days
    437
    311
    228
    32
    Obs
    0.102726
    0.073049
    0.053483
    375.2263
    266.8233
    195.3562
    33
    ¥
    0.127274
    0.086951
    0.066517
    61.77375
    44.17672
    32.6438

    To get the gradient I used:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  23. #23
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    They are all indeed the same frequency (a period of 12:39:10), and they all have the same phase of triangular envelope modulation. I see that you also have them ranked left to right descending by total energy (RMS value).

    Alas, the most energetic have the same phase:

    Signal
    Energy
    Phase [deg]
    1
    0.552
    84.6
    2
    0.392
    84.6
    3
    0.287
    84.6
    4
    0.227
    84.6
    5
    0.215
    84.6
    6
    0.195
    84.6
    7
    0.187
    136.4
    8
    0.163
    84.6
    9
    0.118
    110.5
    10
    0.110
    84.6
    11
    0.068
    110.5
    12
    0.052
    110.5

  24. #24
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    A comment: These are surely calculated values; there is way too much precision to be measurements.
    Last edited by shg; 04-09-2016 at 03:04 PM.

  25. #25
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    These are all in fact calculations. I was about to post up a list of the offsets. I'm very impressed you managed to work that out!
    Last edited by es20g13; 04-09-2016 at 06:49 PM.

  26. #26
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Quote Originally Posted by es20g13 View Post
    These are all in fact measurements.
    What instrument gives 15-digit measurements?

    EDIT: The first several signals (the few that I checked) are exactly the same data with different scaling, e.g., signal2 = signal1 * 0.711099718021. How likely is that?
    Last edited by shg; 04-09-2016 at 03:14 PM.

  27. #27
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Nothing that exists yet! Here's the file to the offsets https://drive.google.com/open?id=0B9...nE3YzNSeUlFVkE

  28. #28
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    The frequency is 11.9150473184764

  29. #29
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    So they are not measurements, not real data, and this is just an exercise in ... what?

  30. #30
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Okay, seeing as there are 50 sites, excluding the ones in orange, I think it would be fair enough to say that at least half of the sites can be used, so lets say a minimum of 25 sites has to be used.

    The way I modeled these was that from the offset of each site, to the first quarter + offset (lunar cycle is 29.53 days, so quarter is 7.3825 days), the power fluctuation decreased linearly by a gradient m (where the magnitude of m differs from each site), then from the first quarter + offset to the second quarter + offset power fluctuation increased linearly by a gradient m, then third quarter + offset decreased by a gradient m, and so forth, then stopped when x = 29.53. I don't know if this helps, a diagram is attached. diagram f.jpg

  31. #31
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    For my dissertation, 1 of the scenarios I have to choose for tidal sites, is finding the most constant power generation profile from tidal power. This is because it's so intermittent, that it's quite inconvenient having all the same generation from 1 region; when the tides are low, the generation is low.

  32. #32
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    I was wondering how they could all have the same nodes

  33. #33
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    If you had posted actual data, as you could have found in published tide tables, rather than a rectal extraction with no relation to reality, someone might have offered useful assistance. You should be more creative in manufacturing data for your dissertation.

  34. #34
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    It isn't any just any data, I've had to model the power production using values of from energy resource assessments. This is what was suggested I do, and I did so as best I could using the resource.

  35. #35
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    I have spent all year modelling this carefully and as best I can using many assumptions suggested to me by specialists in tidal power.

  36. #36
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Quote Originally Posted by es20g13 View Post
    ... using many assumptions suggested to me by specialists in tidal power.
    I would put that statement in the same bin as this one:

    These are all in fact measurements.

  37. #37
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    I do apologise, I did not realise I said that, and meant to in fact say calculations, I edited it now, I'm only after help shg .

  38. #38
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Thank you for that.

    My suggestion is unchanged from post #21; select components based on spreading out the phases, with approximately equal power for each phase. But for that purpose, your data is useless, because it doesn't begin to resemble actual tides. If you ran down some real data, this could actually be an interesting exercise. As it is, it's just a waste of time.

    There are tide gauges all over Britain, and surely both logs and prediction data for every one of them. It would make your paper a lot more credible and interesting if you got one or the other.
    Last edited by shg; 04-09-2016 at 07:32 PM.

  39. #39
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    I understand that there are existing model for tidal power production. However, the data I'm using, which is for some of the highest free-stream tidal power sites in the UK, accounts for limiting factors known as significant impact factors, which these models do not consider.

    I had the neap and spring velocity values, mean power output over a lunar month, and phase difference (which was when their spring tides occurred relative to HR Dover) given to me in an energy resource assessment. I worked out peak power (spring tide), and I worked out minimum power (at a neap tide). From this I could work out the gradient m (mentioned in earlier), by which the power fluctuation changes linearly over the lunar month quarters.

    After this, I modelled each site, starting from a spring tide, using equations, where the power output between 0<=x 0<=7.38 = (Pmax - m*x)cos(11.915..*x). For 7.38<=x<=14.77, I would simply reverse the values for the first quarter. Then for 14.77<x<22.15 I would use the values for from the first equation, and for 22.15<x<29.53 I would flip the values again. This is because I've assumed symmetry.

    Once this was done for all sites, I dragged the entire set of values for each site, down or up, to account for their phase difference, and y values missing to correspond to x-values I would just add from the values that weren't in between 0>29.53. So for example the first site had a phase difference of -3 hours, which was -0.125 (-0.13 to 2 d.p). Because I dragged this up there were 13 values missing for the last values of x up to 29.53. So I took those values and stuck them at the end. I did this because tides repeat themselves. Screen Shot 2016-04-10 at 00.15.20.png

    I have made the assumption that both spring tides in the lunar month are the same magnitude. This is because there isn't enough information to model one greater than the other like they should. In addition i've assumed constant frequency & no other tidal constituents as this would require a harmonic analysis of each site which is far beyond the scope of my dissertation.

  40. #40
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    This is what I was doing:


    TideWoes.PNG


    Please Login or Register  to view this content.
    Last edited by xladept; 04-09-2016 at 07:48 PM.

  41. #41
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    shg these sites have been measured using Marine Energy Atlas and the Admiralty Chart data. The power values were deduced using the Farm Method which accounts for arrays of tidal stream devices all extracting equal amounts of energy from incoming flux.

  42. #42
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Hi Xladept, do you mind explaining what you've done here?

  43. #43
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Then post some real data instead of manufactured data.

  44. #44
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    What difference would it make if my data was manufactured or measured if it's still in the same excel sheet format I initially attached? I also need the intervals of 0.01 so I wouldn't be able to use real data either.
    Last edited by es20g13; 04-09-2016 at 08:35 PM.

  45. #45
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Hi ES,

    I was looking for the midpoint between nodes - from them I would get the amplitudes, although I hadn't worked out how many minutes to advance or retard the observed values. I found nodes at 7.62,13.82,23.75 and 27.15 days (approxomately) and I was testing with 18.79 and 25.46 day values.

    Data Range
    K
    L
    M
    N
    O
    P
    Q
    23
    1
    2
    3
    1
    2
    3
    24
    0.023
    0.016
    0.012
    43.7
    31.1
    22.8
    25
    26
    27
    0.58558
    0.40736
    0.30552
    25.46
    1112.602
    791.806
    580.488
    28
    0.63174
    0.44923
    0.328906
    1060.013
    753.7746
    551.8804
    29
    0.04616
    0.04187
    0.023386
    52.58947
    38.03139
    28.6076
    30
    31
    0.43217
    0.30064
    0.22548
    18.79
    821.123
    584.369
    428.412
    32
    0.477354
    0.339446
    0.248528
    900.3122
    640.2117
    468.7347
    33
    0.045184
    0.038806
    0.023048
    79.18915
    55.84272
    40.32268

    The little routine got me close to the nodal value - it just tested the product of the day times the gradient against the observed day value

    And, Thanks for the rep!

    BTW - Have you a Bowditch?
    Last edited by xladept; 04-09-2016 at 08:46 PM.

  46. #46
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    I've read a some stuff on Bowditch about navigation and tidal currents for my literature review.

    I'll give this a go now!

    Thank you!

  47. #47
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    It looks like we can get the actual amplitude by just dividing by the tangent of the gradient - for this data anyway

    Amendment - Make that the Cosine of the gradient.
    Last edited by xladept; 04-11-2016 at 01:28 PM.

  48. #48
    Forum Contributor Gregor y's Avatar
    Join Date
    10-24-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010 32-Bit
    Posts
    276

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    I hate to do a hit and run, and I wish I had more time to dig into this one.

    It doesn't look like anyone has suggested to look into a Linear/Non-Linear programming solution; however if you do the size of your data set is way outside of the range of the free version of the solver addin that comes with excel.
    If it'd make you feel better using my answer because of my street cred, then you can go ahead and click Add Reputation below to improve it.

  49. #49
    Registered User
    Join Date
    04-07-2016
    Location
    Southampton, England
    MS-Off Ver
    2016
    Posts
    25

    Red face Re: Finding the smoothest, flattest curve from a combination of various site values.

    Due to the deadline I'm up against, I've just gone with suggestions of using sites with offsets that cancel each other but are equal in magnitude. It's given me a relatively lower fluctuation compared with using all the sites.

    Thank you anyway though!

  50. #50
    Forum Contributor Gregor y's Avatar
    Join Date
    10-24-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010 32-Bit
    Posts
    276

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    I take it back Mr Shorty mentioned LP first, and it does appear as though the generic solver may do the task.

    However the problem I'm comming up with in your data model is that either through your attempt to standardize and or manufacture data points you've forced the stations to be more or less linear functions of the first one, so S1=k*S2, and S1+S2=(1+k)S1 which will be less smooth than just S1 alone. Given that, then the "smoothest" curve would be the single one with the smallest k value ie S54. (solver agrees)

    How I set up my solver: Removed colums for sites not needed, insert row above for x values, B1=1, C1:AW1=0, AX1=sum(B1:AW1), AX3:AX2956=sumproduct($B$1:$AW$1,B3:AW3), AY3:AY2955=(AX4-AX3)/0.01, AZ3:AZ2954=AY4-AY3, AZ2=sumsq(AZ3:AZ2954), Solver: objective: AZ2, min, changeing:B1:AW1, B1:AW1 = Binary, AX1>=1, Method: Evolutionary

  51. #51
    Forum Contributor Gregor y's Avatar
    Join Date
    10-24-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010 32-Bit
    Posts
    276

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    Although after you fix your data so that every station doesn't peak in the same direction at the same time, you may want to consider changing the binary constrant so that B1:AW1 is between 0 and 1 inclusively, as a true smoothing may be based on a percentage of each site. Moreover talk with your local math department to see what may be needed to add in a seccondary goal of min/max the station count as well.

  52. #52
    Forum Contributor Gregor y's Avatar
    Join Date
    10-24-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010 32-Bit
    Posts
    276

    Re: Finding the smoothest, flattest curve from a combination of various site values.

    hmm, i may stand corrected try stations: {23,24,25,27,32,39,40,42,43,52} and let me know if that's more what you're looking for.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Finding the smoothest, flattest curve from combinations.
    By es20g13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2016, 04:41 PM
  2. VBA code finding values/tags on a site and import it to EXCEL
    By a1b2c3d4e5f6g7 in forum Excel General
    Replies: 0
    Last Post: 04-16-2014, 12:50 PM
  3. Finding a unique combination of values
    By bassiere in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 08-27-2013, 10:20 AM
  4. Finding values based on the standard curve - Pls help
    By Wilsern in forum Excel General
    Replies: 4
    Last Post: 08-25-2011, 09:30 PM
  5. Finding y-Values in budget curve app w/ excel
    By James Gross IV in forum Excel General
    Replies: 2
    Last Post: 09-11-2005, 10:05 PM
  6. Finding y-values in budget curve app w/ Excel & VBA
    By James Nasty in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-10-2005, 10:05 PM
  7. Finding y-values in budget curve app with Excel & VBA
    By James Gross IV in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-16-2005, 12:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1