Determining polynomial coefficients by known derivatives

조회 수: 7 (최근 30일)
Omur
Omur 2012년 10월 18일
댓글: Star Strider 2017년 7월 8일
Hello community, I'm trying to create a cubic polynomial function, I know these: y(0)=1 y(30)=0.5 dy(0)/dx=-1 dy(30)/dx=-1 Can I determine the values for coefficients ?

채택된 답변

Dr. Seis
Dr. Seis 2012년 10월 18일
편집: Dr. Seis 2012년 10월 18일
Yes. Just in case this is homework, I will give an example to get you started.
Let's say you have the case below (I will start with the case where we do not have derivatives at a location).
We are trying to solve for A, B, and C
y(x) = A*x^2 + B*x + C
Knowns:
x1 = 0; y1 = 1;
x2 = 3; y2 = 6;
x3 = 7; y3 = 7;
So we can construct an inverse problem of the form G * m = d, where:
G = [x1^2,x1,1; x2^2,x2,1; x3^2,x3,1];
d = [y1; y2; y3];
We determine m (equal to [A; B; C] in our example) by:
m = G\d;
And we get:
plot(-1:10,polyval(m,-1:10),'r-', [x1,x2,x3],[y1,y2,y3],'k+')
  댓글 수: 8
Dr. Seis
Dr. Seis 2012년 10월 18일
편집: Dr. Seis 2012년 10월 18일
To learn more about using mark-up to format your questions/answers/comments you can check out this page:
Omur
Omur 2012년 10월 18일
Thank you so much !

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Suzie Oman
Suzie Oman 2017년 7월 8일
This answer doesn't incorporate the derivative. How would this be solved taking into account the derivative?
What about in 3 dimensions?

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by