Help with interpreting an interpolation problem

Click For Summary

Homework Help Overview

The discussion revolves around interpreting a homework problem related to trigonometric interpolation, specifically involving the evaluation of a MATLAB function for a given set of samples and the analysis of maximum error in relation to a specified function.

Discussion Character

  • Conceptual clarification, Problem interpretation

Approaches and Questions Raised

  • The original poster attempts to clarify the requirements for plotting the maximum error of the interpolating function and questions whether to plot the maximum error for specific values of n or to create a plot of the error function itself. They also inquire about identifying when they are close to machine precision and the implications of cancellation errors.

Discussion Status

Participants are engaged in clarifying the original poster's understanding of the problem and the requirements for the plotting task. There is an ongoing exploration of the interpretation of the homework prompt, with no explicit consensus reached yet.

Contextual Notes

The original poster mentions using Julia instead of MATLAB, which may influence their approach to the problem. There are also technical issues regarding LaTeX formatting that have been addressed in the thread.

PhysicsKid0123
Messages
95
Reaction score
1

Homework Statement


I don't know if this is the appropriate place to ask this, but I really do need some help. I am doing a homework problem and I don't understand what is being asked. It goes as follows:

> Write a MATLAB function to evaluate the trigonometric interpolant ##p_n(x)## for a given set of samples, ##\bf{y}##:

Here it follows with some comments about making such a function, I'll leave that out since it's not relevant, but it goes on to say:

> To test your program use ##f(x) = 10cos(x)+5cos(3x)## and plot the maximum error ##max |p_n(x)-f(x)|## for ##n= 4,8,16,32,64.## Verify that the maximum error is close to machine precision for ##n=32,64.## What is the reason behind this?

So I was able to find the interpolating function ##p_n(x)##, but I don't know what the next part is asking. Am I supposed to find the maximum value of ##g_n(x) = |p_n(x)-f(x)|## for each ##n##, say it is ##g_n(x_0)##, then plot ##g_i(x_0)## vs ##i## for ##i= 1...n##? So effectively, each value ##g_i(x_0)## is plotted on an ##y##- axis and ##i## on a corresponding ##x##-axis? Or am I simply supposed to make a plot of ##g_n(x) = |p_n(x)-f(x)|## for each n?

Also, how do I know when I am close to machine precision? When I start getting cancellation errors?

Thank in advance for the help.

By the way, I am using Julia to do this, not MATLAB.

Homework Equations


None are relevant to my question.

The Attempt at a Solution


No solution yet, I wouldn't be asking this question.
 
Last edited by a moderator:
Physics news on Phys.org
Sorry, I don't know how to enable LaTex.
 
PhysicsKid0123 said:
Sorry, I don't know how to enable LaTex.

Instead of $p_n(x)$, replace each starting and ending $ by #nospace# (two # signs with no space between them) for in-line formulas; that gives you ##p_n(x)##. If you want a displayed equation or formula, replace each starting and ending $ by $nospace$, that is, write two $ signs with no space between them. That gives you $$p_n(x)$$
 
Fixed the LaTeX in post #1.
 
Mark44 said:
Fixed the LaTeX in post #1.
Yes, I got it. Thank you.
 
Fixed the volume in post #1.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 65 ·
3
Replies
65
Views
8K