![]() |
.. (parent folder) | |
Hw7 - Important theorems & properties
|
This entire hw is a good review for helpful properties, E.g, 1. A basis is: Linearly independent; Spans the space; number of elements = dimension of the space. And - any two of these properties yield the third one. 2. What's the result of an inner product (with a symmetric range) of even/odd/one-of-each functions? 3. Recall that a Least-Squares approx can be constructed (from an orthogonal basis): f ~~ <f,p0> / <p0,p0> * p0 + <f,p1> / <p1,p1> * p1 + ... 4. The recursive formula for orthogonal families can be good for proofs. 5. There are cases where a Least-Squares approx is identical to an approximation (with the same points & basis functions). Remember: all the relations between the questions here are meant to help you and to spare the need to prove every new section from scratch. |
HW3 - q.4. clarification
|
Note: the basic arithmetics +,-,*./ DO exist. |
Do we have to submit .m files in Matlab sections?
| No. The text of the commands that you ran (copy-pasted) is okay. |
Simple Matlab commands
|
To create an array of x values and a corresponding one with a function's values: x = 0:0.01:5; y1 = sin(x) ./ (x+2).^2; Notes: put ; at the end of the line to prevent the output. The point before the operators * / ^ are needed (element-wise operations). To show several graphs with colors: plot( x, [y1; y2] ) OR plot( x, f1, 'k', x, f2, 'r', x, f3, 'b' ) //the characters represent colors To issue a few plot commands without erasing the previous ones, call "hold on" once. To add a title to the plot: title( 'My first plot!' ) |
HW1 - q.3 - What does it mean if it's a good function?
|
After you find the function p(x), calculate it on some values of x (outside the given range) and see if there are reasonable results. |
Matlab - how to calculate ln?
|
Like in several languages, Matlab use the name "log" for the function that we call "ln". Try log(exp(1)) and you'll get 1 as expected. |
Hw1 - q.4 - Do I have to use known (or unknown) inequalities from Hedva?
|
There's a solution without them. Using a known theorem about the change in a function between two points. (which is a special case of the remainder R_n that we saw). If you use some widely-known claims, please make sure that they are indeed the famous ones. e.g.: Good: "we learned in calculus that ln(x) < x-1" Bad: "The left inequality is true because we had exactly this example in the tutorial in Hedva 1m." |
Hw1 - q.1 - What errors are wanted?
|
In sections b & d - theoretical upper bounds to the error. (it should be apparent which x & xi yield the greatest value of the reminder expression). In section f - the actual error that appears. In all sections, the answer should be a single number and not a function of x. |
Hw1 - q.5 - How to use Matlab's symbolic library?
|
## For more details, see new file under Course Material - Matlab Introduction The function in the hint to q.5 is called "int". The simple way to call it for a bounded-range integral (from a to b) is: int( 'x^2', 'x', a, b ) There is another way to write it: syms x int( x^2, 'x', a, b ) (note that now the first parameter is not a string!) What happens here? Notice that a symbol is a "smart string". A symbol can either refer to a constant, as b = sym( 'pi/2' ), or represent a variable, as x = sym('x'). A symbol can even be a function of a variable. syms x is equivalent to writing x=sym('x'). It declares x as an instance of type symbol. Its value is the smart string 'x'. Since x is a symbol, x^2 is also a symbol, whose value is the function x^2. The Matlab function 'int' can work with this symbolic function very well. |

