Fitting quadratic curve to three constraints

In summary, the conversation is about fitting a quadratic curve to three constraints, two of which are points and the third is an angle. The person is struggling to understand the process and has found examples for fitting a curve with three point constraints, but not an angle constraint. They mention an old example they have, but it is poorly annotated and they are having trouble understanding it. They discuss different methods for solving the problem, including treating it as a differential equation problem and using matrices for simultaneous equations. Eventually, they mention finding a solution using cubic splines to match a given angle at both endpoints.
  • #1
Bob Smith
16
0
This should be easy but I've not done this in years and I'm feeling dense:

I need to fit a quadratic curve to three constraints, two of which are points, the third is an angle.

I've found examples to do this but only if all three constraints are points, so if someone would kindly explain the process I'd be a happy man. :)

Edit: I should add I've got an old example in front of me where I did just this (for a cubic equation though) but due to poor notes on my part I can't quite understand what I was doing.
 
Last edited:
Mathematics news on Phys.org
  • #2
Can you post the old example, however poorly annotated?
 
  • #3
I assume the two points you are given are points on the parabola but what is the angle?
 
  • #4
One method is to treat it as a differential equation problem. All parabolas are solutions of

[tex]\frac{d^2y}{dx^2} = 2A[/tex]

for some constant A. Integrating, you get

[tex]y = Ax^2 + Bx + C[/tex]

Now, you have three parameters, and three conditions. Translate your angle into a slope, and you can write your conditions as

[tex]y(x_1) = y_1[/tex]

[tex]y(x_2) = y_2[/tex]

[tex]\left \frac{dy}{dx} \right|_{x_3} = \tan \theta[/tex]

then just solve for A, B, and C.
 
  • #5
I should have been a bit more specific in my post.

I can form the two equations and the derivative equation for the constraints. The angle is also at the same point as one of the points the curve must fit, and sine the angle is zero (top of the curve), it is the same as the gradient, so no need to worry about converting.

The bit I got stuck as was what to do with the equations, i.e. how to solve. :) Like I said, it's been a long time since I touched this. I'll have a bit more of a play and see if I can get it to work.

Edit: I should add, once I've got this working, I'll want to add a fourth constraint that is the gradient of the other point (which will be non-zero), so need a general solution that I can scale up to a cubic equation. Thinking about it, perhaps if I try that from the beginning, it will make my old example easier to work from.

Edit again: nope, still no luck. If it weren't for the gradients this am I correct in thinking this is a simultaneous equations problem (which I can do), but as is, it involves differential equations (which I can't). So I probably made the thread in the wrong section too.
 
Last edited:
  • #6
Well, thought I should add I got my solution by using matrices for the simultaneous differential equations. Cheers anyway. :)
 
  • #7
hmm...finding the constants A, B, and C is just a matter of solving simultaneous linear equations...but I suppose that's what you did if you used matrices.

If you want a curve that conforms to four constraints in order to match a given angle at both endpoints, then you should look up "cubic spline".
 

Related to Fitting quadratic curve to three constraints

1. How do you determine the coefficients of a quadratic curve that fits three constraints?

To determine the coefficients of a quadratic curve, you need to set up a system of equations using the three given constraints. These equations will involve the coefficients of the quadratic curve and the three constraints. Solving the system of equations will give you the values of the coefficients.

2. Can a quadratic curve fit any three constraints?

No, a quadratic curve can only fit three constraints if the constraints are consistent and can be solved using a quadratic equation. If the constraints are not consistent or cannot be solved using a quadratic equation, then a quadratic curve cannot fit them.

3. Is there a formula for finding the coefficients of a quadratic curve that fits three constraints?

Yes, there is a formula called the "method of undetermined coefficients" that can be used to find the coefficients of a quadratic curve that fits three constraints. This method involves setting up a system of equations and solving for the coefficients.

4. What happens if the three given constraints are not enough to uniquely determine a quadratic curve?

If the three given constraints are not enough to uniquely determine a quadratic curve, then the curve will not have a unique solution. This means that there will be multiple quadratic curves that can fit the given constraints, and the specific coefficients of the curve will depend on the method used to find them.

5. Can a quadratic curve fit more than three constraints?

Yes, a quadratic curve can fit more than three constraints. In fact, the more constraints that are given, the more specific and accurate the quadratic curve will be. However, it is important to note that there must be at least three constraints for a quadratic curve to have a unique solution.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • General Math
Replies
22
Views
3K
Replies
2
Views
2K
  • General Math
Replies
6
Views
2K
  • Astronomy and Astrophysics
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
2
Views
1K
Replies
3
Views
1K
Replies
8
Views
993
  • General Math
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
8
Views
1K
Back
Top