(PDE)(Gram-Schmidt Function Orthogonalization) I was wondering if somebody else can figure out where I'm (I think) making a mistake, I'm trying to make a given set of functions orthogonal via Gram-Schmidt.
@Pompeii00
@freckles , are you at all good with PDE/Gram-Schmidt?
I can look it up and try to help you with it.
But I will have to do so after lunch.
Alright, cool; thanks nonetheless.
This was used in quantum mechanics to find a convenient basis. I'm not sure how much I remember about it though.
i'm back. like did you want to show the problem.
Yeah, just wanted to make sure somebody was sticking around before I committed. What I'm trying to do is, given three functions, f_0, f_1, and f_2, each being
\[f_0=1,\ \ \ f_1=x \ \ \ , f_2=x^2\]Respectively, where the relationship between them is \[f_n=x^n, \ \ \ n \in \mathrm{N}\]
Making those three functions orthogonal by the Gram-Schmidt process.
@dan815
The issue that I'm having is when I try to take the inner product of f_1 and g_2 as in the Gram-Schmidt procedure, I don't get a value of zero, which I need to get, AFAIK, in order for the functions to be demonstrably orthogonal.
what is g_2?
Wait a minute, one sec. Trying to find a bunch of new orthogonal vectors, \[g_0=f_0, \ \ \ \ \ \ \ \ g_1=f_1-\frac{(g_0,f_1)}{(g_0,g_0)}g_0\]
Where the things in parentheses are the inner product of the two functions.
\[(f,g)=\int\limits_0^1f \cdot g dx \text {\right }\]
or is it -1 to 1 instead of 0 to 1
Yep, exactly, so for the first one, it's just equal to itself (at least to be orthogonal), for the second one, it should be x minus the inner product of x and 1. It's 0 to 1.
\[g_0=1\]\[g_1=x-\frac{\int\limits_{}^{}(1)(x)dx}{\int\limits_{}^{}(1)(1)dx}(1)\]
g1=x-1/2
I would have gotten x-1/2, not sure how you got 3/2-yeah, and then, since those are orthogonal, if we take the inner product of the two of them, the result should be zero, right?
i did the integral of g1*g1 dx on bottom
mistakenly
i mean f1*f1 lol
\[\int\limits_{}^{}(1)\bigg(x-\frac{1}{2}\bigg)dx=\int\limits_{}^{}\bigg(x-\frac{1}{2}\bigg)dx=\frac{x^2}{2}-\frac{x}{2}\]
you get 1/2-1/2
Wait, nevermind, that makes sense now, doesn't it? 1/2-1/2=0. Alright, not sure where I screwed up originally, lol. But now I need to make them orthonormal as well.
So I need to divide each by its inner product with itself, which in the first case, we don't need to do (it already has magnitude 1) and need to do the second one as well.
\[\frac{x-1/2}{\int\limits_{}^{}(x-1/2)(x-1/2)dx}\]
\[\frac{x-\frac{1}{2}}{\frac{1}{3}-\frac{1}{2}+\frac{1}{4}}=\frac{12x-6}{4-6+3}=\frac{12x-6}{-2+3}=\frac{12x-6}{1}=12x-6\] if i didn't make a mistake
\[\int\limits_{0}^{1}\bigg(x^2-\frac{1}{4}x+\frac{1}{4}\bigg)dx=\frac{x^3}{3}-\frac{1}{8}x^2+\frac{1}{4}\bigg]_0^1\]
1/4x, that last part
\[(x-\frac{1}{2})(x-\frac{1}{2})=x(x-\frac{1}{2})-\frac{1}{2}(x-\frac{1}{2}) \\ =x^2-\frac{1}{2}x-\frac{1}{2}x+\frac{1}{4} \\ =x^2-\frac{1+1}{2}x+\frac{1}{4}\]
or recall (x-b)(x-b)=x^2-2xb+b^2
Ah, I gotcha, I see my mistake
Alright, but the problem is, that inner product needs to be zero.
and it will be
\[\int\limits_{0}^{1}(12x-6)(1) dx=\frac{12x^2}{2}-6x|_0^1=6-6=0\]
Do you evaluate the entire expression at zero to one? What's the basis for that? That would equal zero, but I don't see where that operation (evaluating that final amount) suddenly comes from.
i thought you said the inner product still needs to be zero
so that is what i was showing that the inner product of 1 and (12x-6) is 0
this means that they are orthogonal
Wait, what? I'm just getting lost/disoriented in the math, give me a moment.
Alright, so if I read correctly, our result 12x-6 is the ortho*normal* version of g_1? It's the unit vector version of (x-1/2)?
yeah
Alright, so since that is orthonormal and is also obviously orthogonal, the inner product with that and g_1 should also be zero.\[\int\limits_{}^{}(1)(12x-6)dx=\int\limits_{}^{}(12x-6)dx=(6x^2-6)\bigg]_0^1=0\]
Yay! Lol, alright, cool.
\[f_0=1,f_1=x,f_2=x^2 \\ g_1=f_1-\frac{(f_1 ,f_0)}{(f_0,f_0)} f_0=x-\frac{\frac{x^2}{2}|_0^1}{x|_0^1}(1)=x-\frac{\frac{1}{2}}{1}=x-\frac{1}{2} \\ \frac{g_1}{||g_1||}=12(x-\frac{1}{2})=12x-6\\ \text{ but I think we also need \to do } g_2=f_2-\frac{(f_2,f_0)}{(f_0,f_0)}f_0-\frac {(f_2,g_1)}{(g_1,g_1)}g_1 \text{ and then find } \\ \frac{g_2}{||g_2||}\]
like the orthogonal basis should be g0,g1,g2
and the orthornormal basis should be g0/||g0||,g1/||g_1||,g2/||g_2||
\[(f_2,f_0)=(x^2,1)=\frac{x^3}{3}|_0^1=\frac{1}{3} \\ (f_0,f_0)=(1,1)=x|_0^1=1 \\ (f_2,g_1)=(x^2,x-\frac{1}{2})=\frac{x^4}{4}-\frac{1}{2}\frac{x^3}{3}|_0^1=\frac{1}{4}-\frac{1}{6}=\frac{3}{12}-\frac{2}{12}=\frac{1}{12} \\ (g_1,g_1)=(x-\frac{1}{2},x-\frac{1}{2})=\frac{x^3}{3}-\frac{x^2}{2}+\frac{1}{4}x|_0^1=\frac{1}{3}-\frac{1}{2}+\frac{1}{4}=\frac{4}{12}-\frac{6}{12}+\frac{3}{12} \\\text{ so } (g_1,g_1)=\frac{1}{12}\]
\[g_2=f_2-\frac{(f_2,f_0)}{(f_0,f_0)}f_0-\frac {(f_2,g_1)}{(g_1,g_1)}g_1 \\ g_2=x^2-\frac{\frac{1}{3}}{1}(1)-\frac{\frac{1}{12}}{\frac{1}{12}}(x-\frac{1}{2}) \\ g_2=x^2-\frac{1}{3}-(x-\frac{1}{2}) \\ g_2=x^2-x-\frac{1}{3}+\frac{1}{2} \\ g_2=x^2-x-\frac{2}{6}+\frac{3}{6} \\ g_2=x^2-x+\frac{1}{6}\]
\[\frac{g_2}{||g_2||}=\frac{x^2-x+\frac{1}{6}}{\int\limits_{0}^{1}(x^2-x+\frac{1}{6})(x^2-x+\frac{1}{6}) dx}\]
which should be just 180x^2-180x+30
Alright, cool; yeah, I understand this now, which is as much as I wanted to go. I have one last question (going to open up a new thing for it) just relating to doing a fourier expansion given some function and an orthonormal basis.
\[\text{ answer is } \\ (\frac{g_0}{||g_0||},\frac{g_1}{||g_1||},\frac{g_2}{||g_2||}) \\ =(1,12x-6,180x^2-180x+30)\]
if there was no mistake made
i can try
Alright, yeah, no worries. In any case, thank you!
honestly how to whip out my linear algebra book for that last problem a bit rusty i am
I want to make one more note here in case of confusion on notation I was taking ||g|| to mean (g,g) whch you know when int_0^1 g^2 dx
Join our real-time social learning platform and learn together with your friends!