Mathematics Homework Solutions
Problem
#57079

Matlab Hermite Interpolation

(See attached file for full problem description with equations)

---
I need some guidance on a Matlab programming project.  The project concerns Hermite polynomial interpolation.  We are given values  and   and their derivatives   and   at  and   respectively, and we look for coefficients  such that if

                                  
then

.

I found that the following coefficients satisfy the above requirements:



with  .

Next I am to write a Matlab function which takes inputs x,y0,dy0,y1,dy1 and returns the value of the cubic polynomial q at x that satisfies the above conditions.  I have written the function and it is pasted below:

function y=qHermite(x,y0,dy0,y1,dy1)
%%qHERMITE returns the value of the cubic polynomial q
%%at x which satisfies q(0)=y0,q'(0)=dy0,q(1)=y1,q'(1)=dy1

y = y0+dy0*x+(y1-y0-dy0)*x.^2+(dy1+dy0-2*(y1-y0))*x.^2*(x-1);
return

Next I am to find the corresponding formula for when   are replaced by  .  This polynomial will be called  .  After some algebra work, I found   and its coefficients to be


with

,       ,       ,     .

Now finally comes the part with which I need assistance.  I am to write a Matlab function for   which uses the function I wrote for  .  I can write a program for Q which stands alone, but I do not see any way to write a function for Q which calls q, since the coefficients are different in each case.  Please show me how this can be done.
Thanks in advance!
---

Attached file(s):
Attachments
scproj2.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

scproj2.doc
such that if



then

.

I found that the following coefficients satisfy the above requirements:



.

Next I am to write a Matlab function which takes inputs x,y0,dy0,y1,dy1
and returns the value of the cubic polynomial q at x that satisfies the
above conditions. I have written the function and it is pasted below:

function y=qHermite(x,y0,dy0,y1,dy1)

%%qHERMITE returns the value of the cubic polynomial q

%%at x which satisfies q(0)=y0,q'(0)=dy0,q(1)=y1,q'(1)=dy1

y = y0+dy0*x+(y1-y0-dy0)*x.^2+(dy1+dy0-2*(y1-y0))*x.^2*(x-1);

return

and its coefficients to be



with

.

. I can write a program for Q which stands alone, but I do not see any
way to write a function for Q which calls q, since the coefficients are
different in each case. Please show me how this can be done.

Thanks in advance!
Solution
What is this?
By OTA - Overall OTA Rating
Maddu Shankar, MSc - 4.6/5
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • scproj2[1].doc
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse