Finding coefficients of a 3rd degree polynomial while i impose a numerical value to its maximum value
이전 댓글 표시
Hi, I have a polynomial of 3rd degree in time. a0 + a1×t + a2×t^2 + a3×t^3. I want to impose a numerical value to its maximum (say 50) in a known time interval and find out the corresponding values of the coefficients a0 to a3. Is there any direct way ? I have a tendency towards some optimization scheme. Any ideas ??
채택된 답변
추가 답변 (3개)
Walter Roberson
2011년 1월 25일
Calculus.
The maximum of a cubic must occur either at one of the two interval end-points, or at one of the two places where the differential of the function is 0.
The differential is a1+2*a2*t+3*a3*t^2 which has 0's at t =
(1/3)*(-a2+sqrt(a2^2-3*a3*a1))/a3
-(1/3)*(a2+sqrt(a2^2-3*a3*a1))/a3
Differentiate the original polynomial twice and look at the sign to determine whether the point will be a maximum or minimum:
sign(2*a2+6*a3*t)
Substitute the two potential solutions for the differential being 0 back in to the original expression and simplify,
(1/27)*(27*a0*a3^2 - 9*a3*a1*a2 + 6*a3*a1*sqrt(a2^2-3*a3*a1) + 2*a2^3 - 2*a2^2*sqrt(a2^2-3*a3*a1)) / a3^2
-(1/27)*(-27*a0*a3^2 + 9*a3*a1*a2 + 6*a3*a1*sqrt(a2^2-3*a3*a1) - 2*a2^3 - 2*a2^2*sqrt(a2^2-3*a3*a1)) / a3^2
To constrain the maximum to be C, pick one of those two and solve for it being equal to C subject to the constraint that the t so implied is within the target interval. Solving it for a2 will get you a longish cubic; solving for a3 gets you two more compact solutions. Pick one of the two and substitute it back in to the double-differentiated polynomial and simplify. Now impose the condition that the sign of that should be negative (for a maximum). The easiest way to approach that is to solve for the t that makes the expression 0. The expression will be linear in t so everything to one side will be negative and everything to the other side will be positive. You will end up with something like
t = 9*a2*(-a0+C)^2*a1 / (9*C*a2*a1^2 + 6*C*a2 * sqrt(a1^2*(3*C*a2-3*a2*a0+a1^2)) - 9*a2*a0*a1^2 - 6*a2*a0 * sqrt(a1^2*(3*C*a2-3*a2*a0+a1^2)) + 2*a1^4+2*a1^2 * sqrt(a1^2*(3*C*a2-3*a2*a0+a1^2)))
I have not done a formal examination of this expression, but it appears to me to have enough free play to be able to have it come out to pretty much any real value, and thus to be within whatever interval you imposed.
The implication of this approach is that you can impose your maximum, C, and impose your interval, and that you can possibly do so for any arbitrary a1 or a2 (the other would be determined by the location within the interval that you wish to be the peak.)
Minimization would be a waste of time as there are probably infinite solutions. Pick a random t in your interval to be the peak, pick a random a1 or a2, and the rest can be solved for algebraically.
Bruno Luong
2011년 1월 25일
0 개 추천
Sure, a0=-Inf, a1=a2=a3=0
Bruno
카테고리
도움말 센터 및 File Exchange에서 Linear Least Squares에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!