MATLAB Session -- Golden Section Search

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024
  • This video demonstrates how to implement the Golden section search method in MATLAB for optimization.

Комментарии • 48

  • @hawraaateyah5491
    @hawraaateyah5491 Год назад +1

    how to integrate multi objective particle swarm optimization with golden section selction in matlab ..icant

    • @empossible1577
      @empossible1577  Год назад +1

      Have you coded both individually? If not, I highly recommend doing that first. After that, I am not sure what you have in mind to combine the two. One way you can do it is to first program a PSO. Then, each time you are to perform an evaluation of a particle, you perform a GSS to find a local extreme and move the particle to that position. Does this make sense?

    • @hawraaateyah5491
      @hawraaateyah5491 Год назад

      @@empossible1577 yes i coded multi objective particle swarm optimization in matlap .if you want to sent for you copy from my job in matlab to continou with taxi cab

  • @hawraaateyah5491
    @hawraaateyah5491 Год назад +1

    please ..can any one helpe me ..i need to integrete muli objective particle swarm optimization with golden section selection in matlab

    • @empossible1577
      @empossible1577  Год назад

      Have you coded both individually? If not, I highly recommend doing that first. After that, I am not sure what you have in mind to combine the two. One way you can do it is to first program a PSO. Then, each time you are to perform an evaluation of a particle, you perform a GSS to find a local extreme and move the particle to that position. Does this make sense?

    • @hawraaateyah5491
      @hawraaateyah5491 Год назад

      @@empossible1577 please i want to make a vedio that explaine how to integrate mopso with golden section (because i need for it to converges element of archive )

  • @anthonykerl19
    @anthonykerl19 6 лет назад +3

    Great video thanks for this

  • @aggelosphyzx4065
    @aggelosphyzx4065 4 года назад +1

    @CEM Lectures I tried the same algorithm (with reversed inequalities to find the minimum) with the test function (x-3)^2. When the starting interval is something like [0,10] it gives xmin=3 as expected.However, when the starting interval is something like [-100,100] it gives nonsense and I don't know why. By nonsense I mean it produces a negative number.

    • @empossible1577
      @empossible1577  4 года назад

      Hmmm...strange. I recommend visualizing your method and displaying all parameters each iteration. This should tell you what is wrong. I suspect you have a small little misplaced negative sign or something like that. Those are very hard to find. Sometimes you can only find that looking at everything each iteration.

    • @aggelosphyzx4065
      @aggelosphyzx4065 4 года назад

      @@empossible1577 well it is a plain copy of what you implemented but if you tried it and get a good result probably I missed something

  • @thedundun5754
    @thedundun5754 3 года назад +1

    Great video man, but I still don't get the part where we can know if our result is maximum or minimum? or the answer is always maximum?

    • @empossible1577
      @empossible1577  3 года назад +1

      The trick is in the "if" statements. I should create a slide to show the differences. Give the if statements some thought.

    • @thedundun5754
      @thedundun5754 3 года назад

      @@empossible1577 thanks man, I was thinking from the "if" itself and kinda stuck on it. Thanks for the video and the reply!

  • @vivekkumawat5328
    @vivekkumawat5328 2 года назад +1

    thanks bro

  • @rosebiba9847
    @rosebiba9847 4 года назад +1

    How about the function e-x -2cos x

    • @empossible1577
      @empossible1577  4 года назад

      I have not plotted this function to say for sure, but it should be a matter of just entering the new function and the correct starting bounds. Give it a try!

  • @ram670351002
    @ram670351002 5 лет назад +1

    Thank you very much

  • @luisangel8285
    @luisangel8285 3 года назад

    I thought the golden ration was 1.618. When plugging your g into a calculator it yields 0.618

    • @empossible1577
      @empossible1577  3 года назад

      R and 1/R are often both called the Golden Ratio.

  • @KhanMuhammadBabarPA
    @KhanMuhammadBabarPA 3 года назад

    Can you please tell me, how can we quantify the golden ratio of the JPG/tiff or any image format? For example; there is a print advertisement (visual image), and we want to quantify it in MATLAB; so can we quantify it? Please let me know; I will so grateful to you.

    • @empossible1577
      @empossible1577  3 года назад

      I am unsure what type of calculation you need done. You want to perform the Golden Section search on a JPG image?

  • @miggy5074
    @miggy5074 3 года назад

    what if the maximum is at the upper or lower bound?

    • @empossible1577
      @empossible1577  3 года назад

      That would be a poor choice for the bounds, but the algorithm would still converge I am pretty sure.

  • @vishaldolas1506
    @vishaldolas1506 4 года назад

    How can I use golden section method if there are two variables in the equation (x and y)?

    • @empossible1577
      @empossible1577  4 года назад +1

      If there are two variables, you no longer have a root-finding problem and so entirely different algorithms are needed.

  • @fayezalshalan2250
    @fayezalshalan2250 5 лет назад

    shouldn't be
    if f(x1)>f(x2)
    xu=x1 end
    instead of what you have
    if f(x1)>f(x2)
    xu=x2 end

    • @empossible1577
      @empossible1577  5 лет назад

      If f(x1)>f(x2), then you know the extremum is on the left side of the interval. This means you will move all of the points on the right side of the interval toward the left to close in on the extremum. In this case x2 will become the new extreme right value which is xu. Thus we set xu = x2.

    • @andreimihoc7429
      @andreimihoc7429 4 года назад

      @@empossible1577 that still seems like it is backwards. My textbook says if f(x1)>f(x2), then the maximum is between (x2, xU) which is the right side of the interval. And therefore xL = x2.

    • @andreimihoc7429
      @andreimihoc7429 4 года назад +1

      you know what, I realized that you are defining x1 and x2 the opposite way that I am. I have x1 = xL + d and x2 = xU - d

    • @empossible1577
      @empossible1577  4 года назад +2

      @@andreimihoc7429 Glad you figured it out, but thank you for pointing out a potential mistake!

  • @taracat862
    @taracat862 4 года назад

    Thanks a lot

  • @prestonharris7406
    @prestonharris7406 4 года назад

    does the final answer give the minimum of the function?

    • @empossible1577
      @empossible1577  4 года назад

      This code is finding a maximum. It is easily modified to find a minimum.

    • @prestonharris7406
      @prestonharris7406 4 года назад

      CEM Lectures the visual part don’t work. My lines don’t move

    • @empossible1577
      @empossible1577  4 года назад

      @@prestonharris7406 There is no visualization in this video. Maybe your talking about another one? Did you include "drawnow" in your code? This forces MATLAB to update the figure window.

    • @prestonharris7406
      @prestonharris7406 4 года назад +1

      @@empossible1577 Sorry i just went back and looked to discover i wrote the code outside of the while loop. Thank you for the help, now i must figure out how to change to a minimum

    • @prestonharris7406
      @prestonharris7406 4 года назад

      @@empossible1577 Can you give me some hints to turn it into a minimum, I still have not figured it out.

  • @moniekaj1
    @moniekaj1 5 лет назад

    Why we use fU and fL ?

    • @empossible1577
      @empossible1577  5 лет назад

      fU and fL are the upper and lower bounds for the function f.

  • @safiyanusani8157
    @safiyanusani8157 4 года назад

    Hi, Can you explain how you arrived at the formula for the percentage relative error?. Many thanks.

    • @empossible1577
      @empossible1577  4 года назад

      I may call it that, but it is actually the relative difference between values from iteration to iteration. It is not an overall error. So it is just the difference in values between two iterations divided by the value at the newest iteration. Also, you can see all of notes on the course website:
      empossible.net/academics/emp4301_5301/
      Hope this helps!

  • @yanischetouani7392
    @yanischetouani7392 5 лет назад

    please , could you send me THE CODE !

    • @empossible1577
      @empossible1577  5 лет назад

      The video is the code! Ha ha.

    • @yanischetouani7392
      @yanischetouani7392 5 лет назад

      I will pass my exam soon i dont have time to tape, please send it to me, chetouaniyanis@gmail.com

    • @yanischetouani7392
      @yanischetouani7392 5 лет назад

      @Norman Strickland yes and i had 3/20, thanks

    • @nailtosun449
      @nailtosun449 5 лет назад

      you are unbelievable...