Matlab predictor-corrector

2 views (last 30 days)
Mary
Mary on 10 Sep 2020
Commented: Image Analyst on 11 Sep 2020
Hi,
I have the following example as illustrated in the attached figure:
points A, D and B form the green line and points C and D the orange line. The coordinates of A, B and C are known. So the slop of the green line is known. However, the exact value of orange line's slop is not known. However, there is a good starting guess for it. Now, I am looking for something that can find the coordinate of the point D for a slop closest to the initial guess. Is there a function doing that in Matlab ? Is this procedure called predictor-corrector ?
Regards,
Mary
  1 Comment
Image Analyst
Image Analyst on 11 Sep 2020
Hi,
I have the following example as illustrated in the attached figure:
Points A, D and B form the green line and points C and D the orange line. The coordinates of A, B, and C are known. So the slope of the green line is known. However, the exact value of orange line's slope is not known. However, there is a good starting guess for it. Now, I am looking for something that can find the coordinate of the point D for a slope closest to the initial guess. Is there a function doing that in Matlab? Is this procedure called predictor-corrector?

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 11 Sep 2020
As long as all coordinates of A, B, and C are known, then if your guess for the slope between C and D lies between the slope of CA and the slope of CB, then you can find D, exactly and analytically. It's just simple algebra. No optimization or MATLAB even needed.
If the guess is outside that range, then point D will either be on top of point A or point B, depending on which slope, AC or CB, is closest to your guessed slope.
Sounds like algebra homework so I'll let you solve it, unless your teacher said it's okay to turn in someone else's solution as your own.
  2 Comments
Image Analyst
Image Analyst on 11 Sep 2020
Why are there plenty of solutions? In your example, if the slope between CA is -0.8, and the slope between C and B is 1.5, and your guess is a slope of 1000, then there is only one place where you could get a slope of 1000, and so you could get the exact location of D. To the left of C, you can get slopes anywhere from -0.8 to -infinity, and on the right anywhere from 1.5 to + infinity. There would be only one point where you'd get a slope with a value of +1000.
Please show a diagram with plenty of CD lines all showing the same guessed slope.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!