Yes to R^3 and convex polyhedra. By a lot of work, I'm mostly thinking that it means calculating each starting normal (though I suppose those are constant once the polyhedron is specified), making note of that, and then a matrix multiplication plus calculating the angle from the y-axis for each normal once the polyhedron is rotated.
#numerical-analysis
1 messages · Page 11 of 1
Calculating the normal that is the most vertical is simple, take the dot product with the upwards unit vector and keep track of which one gives the largest value
Function fzero on Matlab doesn't work for finding a root of $e^x-x-1$ what can be done?
Suraj
Computationally, I don't think this is actually too bad
If you are using blas for the mat mul
If you have already implemented it and it's too slow, then ok we can discuss further
That's fair. I was just working through how to implement it and it seemed like a fairly brute force method, so I thought it was worth checking into it.
There are probably some techniques using the symmetry group of the polyhedron if your polyhedron has additional symmetry
Hmmmm
There are probably some clever things that you can do with matrix decompositions (https://en.wikipedia.org/wiki/Rotation_matrix#Decompositions)
But probably a bit overkill for a 3x3
Thanks for talking through it with me. Much appreciated.
Farm
Schrodinger equation in spherical coordinates?
If you aren't doing this numerically, this isn't the correct channel
It looks like you're trying to do separation of variables, so #odes-and-pdes
Okay
when you make the ansatz $u(r, \phi, \theta)=R(r)P(\phi)T(\theta)$ and plug it in, distribute the derivatives, etc you’ll get a lot of cancellation
ansh
bc like say d/dr P(\phi)=0 since P has no dependence on radius
Bad
I'll try it out
:spray bottle emoji:
@Farm This is solved in details in all QM books. better read than ask here cause the whole derivation is a lot. As my prof. said, take the whole afternoon 😄
ArgR4N
We have seen a proof, the difficult part was the inequality of $1/Cond(A)_N \geq \frac{dist(B \textit{ singular})}{N(A)}$
but I am not very satisfied with some intuitively justified steps
ArgR4N
For this we constructed a B singular such thath $N(A - B)/N(A) = 1/Cond(A)_N$. I don´t really thing this proof is at my level for me to think a proof 😅, but I wanted to see a more rigourus one. (The unjustified steps were related to proving the existence of some vector with some condition relative to the norm. This condition is easily seen by taking some known norm, but what is difficult is to see that such a vector exists for any norm.)
ArgR4N
This text is confusing me. In particualr when it talks about divided differences. The value $k_{ij}$ should be a scalar. But if I blindly do a difference of the normals divided by the edge length I get a vector. I think this is not properly explained.
Makogan
Can you share the entire document
does anyone know what happnes to L if you divede lets say A R1 by 6 to get the postiont 1,1 to be 1 so its eaiser to the rest of lu decomp
What
like say i divied row 1 of matrix A by 6 what would happen to L
I have a pretty silly question, but it just involves a standard numerical way to compute derivatives at some point x
So my professor wanted us to find the gradient at some given points and he told us to compute them numerically given a tolerance of eps = 10^-7
So i just wanted to know how this method
$f^\prime_{x_i}=\frac{f(x+\epsilon e_i)-f(x-\epsilon e_i)}{2\epsilon}$
till
Would be different from just repeatedly going through the estimates by having smaller and smaller values of a step size h and just stopping when the difference between two consecutive estimates would be less than epsilon
what are " the estimates" you are going through here?
oh i mean just the approximations from the central difference formula D_k
my code for that in matlab would be just a while loop iterating through smaller and smaller values of h until $|D_n - D_{n-1}|<\epsilon$
till
hmm i dont know if my question's making sense sorry. purely just something i was curious abt
It does make sense
If you know what f is, you can use f'(x) and then use | d_n - f'(x) | < e for the tolerance
But if we don't know what f is or f' is difficult to compute then I believe we would use | d_n - d_n-1 |
Another alternative is to instead compare derivative approximations of two different orders
This is a second order approximation
So you can compare it with a 4th order approximation with the same epsilon
oh right that would make sense
This is the idea behind adaptive runge kutta methods
How would I find the rate of convergence of f(x,n)?. I already was able to get rid of the absolute value signs because it alternates being above and below W0(x). It appears to be 1/W0(x).
Have you tried a taylor series
nope, but how would that help me? and do you mean the taylor series for W_0 or f?
oh, that makes sense
wait how would I do it around W_0 if W_0 is not an integer?
and n is?
Hmmmm
Actually I think it's probably easier to consider a continuous version
The continuous version of this is $y'(x,t)=\ln(x/y(x,t))$
Angetenar
how is that continuous and how do you interpret that?
No I don't think this is the right way either
So the solution is $W_0=xe^{-W(x)}$ right
Angetenar
Well, mathematica is telling me that the solution to y=log(x/y) is y=xe^(-W(x))
Anyways
We're doing to do a perturbation analysis
So for the solution W_0, we are going to perturb this slightly
So we have W_0+eps
And then we see what happens to it
So let's say that f(x,n-1)=W_0+eps, we want to know what W_0 is
So we compute the taylor expansion of $\log(x/(W_0+\eps))$ with respect to $\eps$ around $\eps=0$
Angetenar
To 3 terms, this is $\log(x/(W_0+\eps))\approx \log(x/W_0)-\eps/W_0+\eps^2/(2W_0^2)+O(\eps^3)$
Angetenar
that makes sense
Then, when we plug this into the limit, we have [\frac{W_0(x)-f(x,n)}{W_0(x)-f(x,n-1)}=\frac{1}{\eps}\left(W_0-\log(x/W_0)-\frac{\eps}{W_0}+\frac{\eps^2}{2W_0^2}+O(\eps^3)\right)]
Angetenar
Now, we know that W_0=log(x/W_0) so those two terms cancel
And we are left with $\frac{1}{\eps}\left(-\frac{\eps}{W_0}+\frac{\eps^2}{2W_0^2}+O(\eps^3)\right)=-\frac{1}{W_0}+\frac{\eps}{2W_0^2}+O(\eps^2)$
Angetenar
So the limit is -1/W_0
Perturbation analysis is a useful and powerful technique
I see that now
I'm a Maths Undergrad Student and intrested in the field of Numerical analysis, I select the topic for my undergrad thesis "Numerical solutions for unsteady laminar boundary layer flow and heat transfer over a horizontal sheet with radiation and nonuniform heat Source/Sink". When i read this Paper there are a lot of topics from Complex fluid dynamics and only numerical technique has been applied to solve governing equation. My question is that is this good topic for Numerical analysis field or should i change it, also consider future scope. Thanks
Seems like a reasonable undergrad thesis topic
Hmm. I suspect there should be theorems about convergence of piecewise rational approximants but am hard-pressed to turn up the references or rates of convergence or bounds on the constants involved.
Have you looked at padé approximants?
Each interior piece of a C^d piecewise rational clearly has to be a 2-point Padé approximant, but I don't know what that says esp. about rates of esp. uniform convergence.
Convergence with respect to what? Shrinking interval size?
L^p norms I'm hoping, even if L^1 or L^\infty .
That's the norm that you are interested in convergence in
What is changing to cause the convergence? Degree of approximant or interval size?
At any rate, for each piece of the interpolant, you should have an error bound that depends on the degree of the interpolant and the size of the interval
You just take all of these errors together
The degree types would stay constant. More knots & piecewise intervals would be what increases, like piecewise polynomials of having a fixed degree within each piece.
It appears that lower degree types make more sense to avoid accidentally introducing singularities on the real line & whatever the stiffness issues are with high-degree polynomials & rationals.
The missing piece may be the piecewise rational aspect of it.
I can't actually find the analogous convergence results about piecewise polynomials / splines.
You can derive it then
There should be similar results with convergence as the piecewise intervals proliferate for plain old splines / piecewise polynomials, too, but I somehow don't know where to look for those, either.
Google scholar?
I appear to be a particularly bad prompt engineer.
I've already been throwing queries at Google Scholar for a few days. Somehow ”piecewise rational» turns up very little.
Jan Gelfling or similar wrote something in 1975 & nothing else has touched the subject since, or so it appears.
n-term rational is a single grand rational that's got some sort of duality or homomorphic or diffeomorphic aspect between the two. So a bunch of things will go about chattering about piecewise polynomials & then will have a grand unified rational as the thing they're establishing some sort of correspondence with.
So that's a sort of search term overlap that's a total nightmare to prompt engineer my way past. And I've thus far been unable to prompt engineer my way past it.
What’s a prompt engineer?
It's an inflated title for someone who issues commands to AI systems.
I was looking for the 1D case but the paper looks close to applicable.
How does one say that they're representing a polynomial space in a particular basis? e.g. Chebyshev, Bernstein etc.? What are degree d polynomials in one of those bases?
What are the names for those spaces?
For the second, if you are asking about representations of monomials x^d, then just take inner products
It's just polynomials of degree d
The basis doesn't change the vector space
That's why it's a distinct concept from a vector space, yes.
I have no clue what spaces you are referring to then
Neither do I, hence my asking.
What space do you want a name for
Polynomials with specific choices of bases do not have names
There's more & different structure, like Fourier-Plancherel bits where they're a sort of leading fragment of a larger space, different bases corresponding to different weights and inner products etc.
Is there a technique to sample a surface, similar to a poisson sampling, but instead of having a possoin disk aorund each sample, you have a poissin ellipsoid that follows the curvature of the surface?
I am trying to cover an implicit surface with samplse and trying to get it to match curvature directions.
Upon closer examination, it suffers from the same problem that makes it all ungooglable: it establishes a duality between piecewise polynomials and one big grand rational function instead of ever even mentioning piecewise rational functions.
Hmm. Maybe this terminology bit is an abstract algebra question.
State Lagrange's interpolation and show that Newton's forward formula is a special case of it
Hello.
I am interested in pursuing graduate studies in numerical analysis and scientific computing. Particularly, finite element methods, numerical linear algebra.
I have some background in numerical analysis, finite difference methods, and geometric multigrid.
As for numerical linear algebra, I have not had a proper course or self-studied it.
I was wondering if I could have a rough, or possibly accurate, guide on how to prepare for graduate studies as a start, as in which books would be suitable to get familiar with finite element methods, the theory with functional analysis, and an introduction to numerical linear algebra.
Thank you.
For numerical linear algebra, Trefethen and Bau or Demmel are standard books
For finite elements and its theory?
I havent had a proper course in functional analysis as well, I was thinking of beginning with Kreyszig or is it too introductory?
You don't need that much functional analysis to do numerics
There are many many books about finite elements
Iserles has a book on numerical methods for differential equations which covers finite/spectral element methods
Thank you.
What is this?
@wide spear Jan Gelfgren had two manuscripts in the 70s & it appears the one titled for multi-point Padé approximants has exactly what I'm looking for.
Nice
This is remarkably ungooglable. I think it's mostly a coincidence that I ever turned up anything at all because all of the search engines get totally derailed by the numerous papers etc. mentioning the duality between splines on subdivisions of an interval & one grand rational spanning the whole unsubdivided interval.
There's some kind of arrangement with $L_{\overrightarrow{d}}(x)=\prod_k\frac{(x-x_k)^{d_k}}{d_k!}$ that's supposed to be involved with a by-hand construction of interpolatory Lagrange-Hermite polynomial bases, but somehow I'm fumbling the details & failing at Google all over again.
Nadia
Compile Error! Click the
reaction for more information.
(You may edit your message to recompile.)
I think it only mentions things once.
is numerical analysis mostly for pde’s or does it often show up in other problems as well?
Numerical linear algebra is another big subfield
Also strictly speaking, numerical methods for odes are not pdes
And then you also want to do things like integration
And interpolation
There are numerical analysis things for special functions, solving nonlinear equations, numerical differentiation exists, stochastic ODEs & PDEs & a wide variety of statistical things fall within its purview, there are integral equations, KKT optimisation, variational optimisation even apart from Euler-Lagrange & Hamilton etc. equations, also discrete optimisation, linear programming is enormous & it keeps going on.
I am an undergraduate mathematics student interested in pursuing a thesis in numerical analysis. Initially, I chose a topic from fluid mechanics, aiming to apply numerical techniques, but my supervisor’s expertise lies in transforms, not fluid mechanics. Since my interest is in numerical analysis while my supervisor specializes in transforms, I am unsure whether to change my topic within the numerical field to align with my supervisor’s expertise or to continue with my supervisor's field transforms If I choose transforms or numerical analysis, what trending and suitable topics are? Alternatively, if I stick to numerical analysis outside transforms, what topics are currently relevant and suitable for an undergraduate thesis?
Lots of stuff to look at for both.
Transforms pair well with Spectral methods, which is undergrad level and you can find lots of good resources for them.
Outside idrk
But there is always lots of stuff, it's a massive field
scott-brenner mathematical theory of finite elements is the standard book
i think if you really want to understand fem in terms of error estimates and analysis, you would need a bit of background in sobolev spaces (brezzis is a good book)
but for implementation purposes it’s not needed too much
How do I solve this?
I don't really understand the formula
What do I plug in for a? And what is p equal to?
Ohh, how do I find it?
By looking at the structure of the limit
is it something like this?
I feel like you're overthinking this
hmmm most likely
Hmmm. There's a weird thing where Gelfgren's error bound is pertinent to a complex domain containing the interval.
p=lim 1/n^2 so you just plug in
pn=1/n^2, p=1/n and test a=1,2,etc until you stop getting a constant for lambda
Hmm. Comparing convergence behaviour of $C^d\left[x_0,x_0+m\cdot\Delta x\right]$ piecewise polynomials & rationals with knots at $\left{x_0+j\cdot\Delta x\right}_{j=0}^m$ where each polynomial piece has degree $2d-1$ & each rational piece degree type $(d,d-1)$ is awkward for me. Gelfgren's 1975 paper is tough for me to decipher.
Nadia
Compile Error! Click the
reaction for more information.
(You may edit your message to recompile.)
could someone point out where i've gone wrong in this 4-point ifft flow diagram?
What is the answer supposed to be
According to https://scistatcalc.blogspot.com/2013/12/fft-calculator.html the answer is {0.175 + 0.175i, 0.175 + 0.375i, -0.075 + 0.625i, 0.125 - 0.175i}
Complex FFT calculator, IFFT calculator, online FFT calculator
Is that using the same normalization
normalization?
you mean the division at the end? or the twiddle factor? either way it should be the same by definition of idft
psi(0) = 0.7/4 + 0.7/4i is consistent with the online calculator. But then it goes to shit with the others
I will double check your math in a bit
I took a lil break and got back to it. Turns I forgot to do the bit reversal even though I had it written down
Ah ok
so omega(1) and omega(2) should be swapped
Also this is inverse not forwards
Yes doing the inverse
Yes and yes
Anyways you should still do it yourself with the swapped omegas
that's what im doing now
It's just 1s and i's
I got all but 1 imaginary part the same 🥲
😵💫
nevermind... I just can't read my own writing
I need to invest in a tablet asap
FFT is unbelievably genius work
wish i came up with it
Gauß was good.
Gaub
ß is a ligatured form of sz, expanded as ss in modern German.
I don't think I even understand how to derive polynomial or piecewise polynomial bounds or rational bounds without the rational being piecewise.
Chebyshev polynomials have nice DCT algorithms for multiplication.
Piecewise constants seem to use the mean value theorem.
Hmm. The references I can whip up for whatever reason presume $C^d([x_0,x_N])$ spline interpolates are interpolating $d$ function derivatives vs. the derivatives just being continuity conditions & only the 0th-order derivatives / actual function values interpolating anything. At that point, I'm clueless as to what the errors of spline interpolation are & they don't seem to be dealing with a different problem from 2-point $d$-order Hermite interpolation repetitively packed end-to-end.
Nadia
I'm reading the Oliveira-Takahashi paper on ITP and am not convinced it's really doing useful things.
Of course one can just compare Halley, Newton, secant, and bisection probe points and beyond that, and since you went through the trouble of evaluating the function at all these points, you can examine all of those points that are admissible and pick the tightest opposite sign bracketing interval. It also had the not so small issue of not verifying satisfaction of residual tolerance or signalling the failure to satisfy such.
I can’t figure out how to extend the Rolle’s theorem argument for error bounds on a Lagrange interpolant to (C^d) piecewise polynomials or rationals.
I’m pretty sure there are known linear combinations of $\prod_{0\leq k\leq K}\frac{\left(x-x_k\right)^{m_k}}{m_k!}$ where $\left(\forall k\right)\ 0\leq m_k\leq d_k$ to produce a basis for Hermite interpolants. I think the only relevant ones have $m_k=d_k+1$ for all but one index. But that still doesn’t really help estimate errors for $C^d$ piecewise polynomial or rational interpolants.
Nadia
Hi guys, can you help me to do this exercise using this algorithm 7.1, I've been doing this over and over and always got the coefficient zero.
Set up a linear system by requiring the stencil to be exact on polynomials 1, x, x^2, ..., x^d, where d is as high as you can go. The error big O follows from this and Taylor theorem
thank you for the ideaa
I'm still having trouble figuring out some way to get bounds on the errors for rational interpolants that are of more than minimal degree with the other degrees of freedom being used for e.g. continuity conditions with neighbouring intervals. I can't figure out how to get bounds on rational interpolants period. Or why do they even have to be interpolants? What if I do something like LOESS with C^d piecewise rationals? I can't figure out how to get any meaningful bounds on really any problems of the kind, not even for polynomials or anything beyond piecewise linear.
Is there a different / better channel to get ideas about these things e.g. analysis channels?
hello
wow what a nice problem you read that again i am sure i am confused i have no idea what you talking about but you should make your problem specific meaning make different different piece out of it make it descrete then try to solve it
Alright, let's try an example.
Suppose one has a rational $r(x)=\frac{p(x)}{q(x)}$ of degree type (3,2) on an interval $[a,b]$ so that it would interpolate a function $f(x)$ at $a$ and $b$. Its other degrees of freedom would be absorbed by setting $r'(x)$ an $r''(x)$ at $a$ and $b$, presumably with the usual implicit differentiation ideas involving constraining coefficients of $p(x)$ and $q(x)$ by considering $p^{(k)}(x)=\frac{d^k}{dx^k}\left(q(x)\cdot r(x)\right)$. What kinds of bounds can I get on $\left\vert f(x)-r(x)\right\vert$ on $[a,b]$ in these sorts of situations?
Nadia
@hot otter Does that clarify what I mean?
I chose degree type (3,2) thinking that it's sort of like the piecewise linear case for rationals.
Does trying to do KKT optimisation even make sense?
How even are strict inequalities dealt with for KKT?
I think the answer is that optimisation is not how one derives error bounds so it does not make sense.
I have some vague idea that $\left\vert R(x)\right\vert$ where $R(x)=f(x)-r(x)$ that gets extremised at $\xi\in(a,b)$ might have $R(x)=R(\xi)+\sum_{k=0}^\infty(f_k-r_k)\cdot\frac{(x-\xi)^k}{k!}$ and then getting from that to any sort of upper bound on $|R(x)|$ mystifies me, where $f_k, r_k$ are the Taylor coefficients about $\xi$ of $f(x)$ and $r(x)$. At the point that leaves me, it doesn't even get a bound in terms of the function.
Nadia
Milne-Thompson (1933) has something on error bounds for Thiele interpolants but it's a little ugly.
Basically the denominator of the interpolant is still part of the bound, something like:
$\frac{\prod_{k=1}^n(x-x_k)}{n!\cdot\left(q(\xi)\right)^2}\cdot\frac{d^n}{d\xi^n}\left(f(\xi)\cdot\left(q(\xi)\right)^2\right)$ or similar.
Nadia
This question is regarding numerical stability and higher order (convergence) methods.
I have implemented a Runge-Kutta 4 method as part of an N-Body simulator and have measured the convergence order empirically but it appears to be order 5 instead of the theoretical 4.
I can't seem to figure out why or even if this is theoretically plausible. The truncation error is O(h^5) so that may be related but I can't piece it together
I can provide my data if needed
My Explicit Euler and Leapfrog methods are yielding the expected orders 1 and 2 but I can't explain the one for RK4
Funky
if the method is 'stable' (i. e. small perturbations in input cause small changes in output) then the truncation error carries over to the convergence error, which should explain why the order is 5
could you provide more details about the method, e. g. specific weights?
in general, there are (implicit) runge kutta method with higher convergence order than number of points, see gauß, radau or lobatto formulas
I think I'm using the standard explicit RK4 method computed as 1/6 * (k1 + 2*k2 + 2*k3 + k4)
This is the graph I've been able to generate (I know its information dense, page count limit is ridiculous so I've had to make compromises 😅 )
Also I'm a CS student so a lot of the in-depth maths went over my head
well, superconvergence does happen sometimes and it depends on the regularity of your differential equation. but I don't know if I can say much about it here
hmmm
would you say my implementation has an issue then? I don't really know about regularity.
hard to say, but I don't think there's a bug or anything since the approximations seem to converge just fine
im conflicted on whether I should keep this rk4 in my report or not since I can't seem to explain it
I might just email my professor for help since all of this was entirely optional
yeah, an email sounds good
Very unlikely
You're doing n body right
Try doing it with a 2 body system
You should be able to perform a theoretical analysis directly for the 2 body solution
this is how I have arrived at my convergence measurements
Oh
Then you should be able to do a theoretical analysis for the 2 body system in particular
Some terms may magically cancel
I took the simple example of two bodies of mass 4, separated by 2 units with velocity 1 in opposite directions to form a circular orbit
i do not know how to do this
Try doing it for a noncircular solution
whats the intuition for that
When you have very symmetric things, you get better behavior
such as?
the two cases i can think of is either bodies which just oscillate or circular
I suspect that the symmetry of the solution is improving your solution accuracy
Can't you do an elliptical solution
Alternatively, do it for a n body system where n>2
how would i measure convergence for that? dont i need to compare error against analytical solution?
Then the reference solution, you compute using something like RK5 or RK6 or a higher order method
Hey
why does something need to be well posed/well conditioned to obtain numerical stability. im trying to find an intuitive explanation or proof for this
Presumably you mean that the underlying problem needs to be well posed for a numerical solution to be stable?
yes
You are familiar with floating point right
Essentially, whenever you are solving a problem numerically, you can only approximately solve the problem
So you find the approximate output for an approximate input
If the underlying problem is not well conditioned, then even for two inputs that are close together, the solutions can be very different
In which case, your numerical solution is not of any use
See machine epsilon: https://en.m.wikipedia.org/wiki/Machine_epsilon. Double precision is most common in non deep learning computing. This says that when approximating a real number by a floating point number, you may incur relative error up to machine epsilon. Thus if your mathematical function amplifies relative errors in the input numbers, your numerical implementation of it may have large relative error.
I have a stupid question. so I did fea solver for helmholtz equation. and now trying to compare it to fundamental solution. for fundamental solution do I have to numerically solve the roots? It doesn't make sense to me cause Im trying to compare my numerical solution to an exact solution but for exact solution I have to numerically solve it? than Im compare numerical solution to numerical solution? If I root finding there will be errors, so my comparison is not exact right?
I'm a bit confused here.
Where is the root finding coming in
i need fundamental solution's roots. my goal is to calculate the wavelength of two solutions
btw, how should I calculate the wavelength since the wavelength are different further out?
$F(r)=\frac{i}{4}H_0^{(1)}(kr)$
yehuihe
Let's say I have a succession of values $x_{n}$ which tends towards $z$. The absolute error is majored such that $ \z-x_{n+1}| \leq | x_{n+1}-x_n |$. I'm trying to find a similar expression but for the relative error. can someone help?
lazynjnja
Divide both sides by z
yeah but i dont know z
... because I'm told to use this inequation so that the program halts when the relative error becomes less than epsilon, so I probably need to find some bound for the relative error that I can compute
Ok
If you have an iteration scheme and are deciding when to stop there's a few things that you can do
Using the absolute value abs(x_{n+1}-x_n) of the update isn't uncommon
You can also use the relative value of the update
So abs(x_{n+1}-x_n)/abs(x_n)
Would anyone be able to provide me with resources that have butcher tableu's for Dormand-Prince methods? I currently use a RKF4(5) method to integrate my system as it's the only one ive been able to find sufficient material on. I also have no clue how i'd get the truncation error from just the butcher tableu and if how its used changes between what I currently have implemented to find the new timestep if the error is above/too far below my tolerance
https://www.uni-muenster.de/imperia/md/content/physik_tp/lectures/ss2016/num_methods_ii/rkm.pdf seems to go over the process of finding the optimal timestep :D
pg 9-11, im not sure if that applies to all methods?
Is the dormand prince paper not satisfactory
sometimes I feel like giving up 😭 I was searching dormand-prince methods , dormand prince numerical integration, the list goes on, but just searching 'dormand prince' gave me what I needed 
i am confused on conditions for this to converge
so far: p(M) < 1 where x0 and b are eigenvectors for M and, b = 0 when M is idempotent are the only ones i have gotten so far
I was told that these conditions are not enough to cover all cases in a help channel given that eigenvalues could be complex or smth, so i do not know what to put
additionally, there is a second part that asks how M must be defined for the iterations to converge to a solution to Ax=b. with some basic algebra I got
x = Mx+b
x-Mx=b
(I-M)x=b
therefore I-M=A => M=I-A
is this right or am i forgetting smth
Has anyone seen functions that graph like this? What field of study is this sort of thing? (these are all the same class of function with different class parameters over the same input range. I've never seen this before).
From some googling, I found that the only conditions necessary for convergence is that p(M) < 1 and that's it. Why is that?
Sorry for skipping your message
the easiest way should be using Banach fixed-point theorem
you have to show that $\varphi(x) = A x + b$ is a contraction, e.g.
$|| \varphi(x) - \varphi(y)||_2 \leq k ||x-y||_2$ with $k < 1$
In your case:
$|| Ax -b - (Ay-b) ||_2 = ||A(x-y)||_2 \leq ||A|| ||x-y||_2$
@stone hill and if $\rho(A) < 1$ then $\varphi$ is an contraction and you can apply Banach fixed-point theorem
Oh i see. I guess i overthought it. Would not have thought of using that theorem
Or actually more like under thought it
I feel bad for being frustrated with that guy last night now lol, but to be fair i did not have any of this pre req knowledge.
with more experience it gets easier
Ok so it turns out i overthought the conditions for convergence even

all i had to do was x* = Mx*+b => Ix*-Mx*=b => (I-M)x*=b => x*=(I-M)^-1b$
it looks like logarithmic curves that start non-differentiable and smoothly become differentiable
anyone seen something like that before?
that's not true. Look at the following example:
$ x_{n+1} = \begin{pmatrix} 5 & 0 &0 \ 0 & 5&0\ 0&0&5 \end{pmatrix} x_n$
An unique solution exists x = 0.
However your iterative alg. will not converge
malakai
for $x_0 \neq 0$
malakai
x* is defined as whatever the thing converges to, but that's true oof. So i wasn't overthinking at first 😭
Oh well :(
I guess I got that one partially wrong
If it converges it converges to x*
Yeah
but they're right in that that would break my x* definition
Oh wait no
It wouldnt
Cuz if b is zero then it would just make x* zero and that would work actually
?
No the problem with this is that it sometimes implies that convergence happens when it doesn't
you have differentiate between the solution of the problem x*=0 itself and the convergence of your algorithm. Just because your problem has a solution does not mean that the algorithm will find the solution.
Oh ok
Doesn't the spectral radius condition already cover this?
The sequence will converge in that situation but it's a kinda pointless convergence
Well it diverges if x_0 is nonzero
yeah the spectral radius condition covers the convergence
this is an interesting question, because you can just linearize it to see the answer
$\begin{bmatrix}x_{n+1}\1\end{bmatrix} = \begin{bmatrix}M&b\0&1\end{bmatrix} \begin{bmatrix}x_n\1\end{bmatrix}$
Trivial Lemma
The skill for this channel really varies
this reduces the problem to "when does x_(n+1) = Ax_n converge"
hope this helps @stone hill
ah, sorry just looked at it 😅
why is the value of e about 2.7?
Nah i think it's cool anyway
because 1 +1 + 1/2 + 1/6 + 1/24 is about 2.7
I think you have convergence if the matrix norm is < 1
We never learned with matrix norm was
you in harvard or smth
But I'm curious what this would be useful for
which in this case doesn't work because it will probably be 1 now that I look at it
you can use it to find a closed form for x_n
by diagonalization
$\begin{bmatrix}x_{n}\1\end{bmatrix} = \begin{bmatrix}M&b\0&1\end{bmatrix}^n \begin{bmatrix}x_0\1\end{bmatrix}$
Trivial Lemma
I'm not American
I saw the equivalent GPA score for my bachelors after I graduated
and it was about 3.9 iirc
Yeah honestly I dunno where I'd go from here. But it's neat thinking there's a ton of ways to go about this
so I just played what I knew
Do you know when x_(n+1) = Ax_n converges? for A a matrix?
p(A)<1 right?
Oh there's more?
are the millennium problems solvable?
in this case the spectral radius is at least 1
however, having an eigenvalue of 1 isn't an issue
Ig it also converges if A is idempotent
your thing will converge if p(M) < 1 (in general)
regardless of b
there are other solutions too
Like a condition that would cover more cases?
Yeah
if the generalized eigenspace corresponding to 1 is equal to the eigenspace and all the other eigenvalues of M are < 1 (in absolute value)
this will be regardless of x_0
depending on x_0 there are several conditions
Why would this guarantee it?
you can essentially separate x_n in a part there and a part outside of it
and look at two separate sequences
I'll try thinking ab it
I'm having a hard time understanding maximum possible error. I've found the Taylor approximations for t_1(x) and t_3(x), but I'm not sure how to move forward. I know the setup is max -1<=x<=1 | f(x) - t_n(x) |, but how do you move forward? I'm using Elementary Numerical Analysis by Kendall Atkinson Weiminhan, followed one of the examples in the book so looks like they just plugged in 1 into f(x) and t_n(x), but I'm gonna assume that's not always true.
prove that t1 is an upper bound (on (0,1))
and t3 is a lower bound
i.e. tan^(-1)(x) < x for 0 <= x <= M (and M >= 1)
Nobody? Is this like, a new class of curves? I have simple functions that generate these. Is that interesting?
I'm not involved in academia in any way, so, a bit hard to gauge if I've got something interesting.
on the power method, am I correct in saying that the error is bounded by O(|λ2/λ1|^k), and so the rate of convergence is O(|λ2/λ1). and therefore we would have for the inverse power method that error is bounded by O(|λn/λ(n-1)|^k) and so the rate of convergence is O(|λn/λ(n-1)) ?
It looks like a series of step functions that converges to a root function as the step width gets smaller and smaller. The interesting question is what the generating function looks like.
you consider $g_i(x) := f(x) - t_i(x), i=1,3$ and then you search for local extrema in ]-1, 1[ and additionally, you have to consider the existence of boundary extrema. Therefore, you compute $g_i(-1) $ and $g_i(1)$. The last step is to compare the local extrema and the values at the boundary.
malakai
yeah, that should be correct, since the inverse power method is only variant of the power method
great thank you
is there a way to estimate global error from accumulated local error?
like just number of iterations * truncation error ?
and something to do with the order maybe idk
yes! if let’s say you have an iterative method and $u_n$ is your current solution, $y_n$ is the true value. Also define
$u_{n+1}^=y_n+F(y_n)$, where $F$ say is the method and $u_{n+1}^$ is the approximation using the true solution ($y_n$), then you have
$$|y_{n+1}-u_{n+1}|\leq |y_{n+1}-u_{n+1}^|+|u_{n+1}^-u_{n+1}|$$
ansh
the first term on the right is the error incurred in a single step while the second term is the error over all old steps, i.e, starting your method n+1 steps ago vs starting your method at the previous step
is there a way to create a bound on what the global error may be if you dont have access to the true solution?
usually both of those quantities are easily boundable, like for euler’s method the first term becomes $h\tau(h)$ where $\tau$ measures the bound of the second derivative
ansh
and with a lipschitz condition you can bound the second term also with h
and then you just end up getting some recurrence relation in terms of the one step errors which you can solve for the global error by repeatedly plugging into itself
you could apply your method on a really refined mesh/small step length
and treat that as a “true” solution
Also for analytical purposes you don’t necessarily need the true solution
like here you just denote it as something and know what it satusfies
yeah I think I did read in papers that some people just use a higher order method with smaller timesteps to create a 'true' one
@molten knot
hey man not sure if youre around
I have no idea if this is representative of anything
but inside the integrator I take note of the timestep and the truncation error
this plots the cumulative sum for each
so if I assume it adds linearily , could I just extract this relation for my other plots to estimate a global errors on the final values?
it shows error vs seconds simulation rn
after a year simulated
i think so, it’ll depend a lot on consistency and stability of your method
what sort of problem are you working on?
its numerical integration surrounding the n body problem
also stiffness could always be an issue, some problems might be ill conditioned/stiff
quadrature?
the orbits im considering right now are fairly circular and I dont think they are considered stiff
or more like integrator in the sense of a diff eq solver
i see
I didnt see a point in going for a symplectic integrator for my 'short' timeframe things
hmm id may compute the global error on the current step length
and a step length half the size
and measure their ratio
or the log of their ratio
and keep halving it and doing that repeatedly
see if you can get an order of convergence from that
maybe try changing parameters or the problem up and see if the order stays the same
if the method is consistent it should
I added a shitton more bodies and its still showing linear
I could try the log thing youre mentioning
I think it'd kinda be a pain in the ass to setup
nah it’s not bad
just do like
Err = []
for n in range(1,10):
h=2^n
compute global error(h)
Err.append
take ratios of everything in list and logs
plot them with respect to h on loglog
assuming you can easily compute global error
I cant 💀
In my last blog post, I described how to derive the local truncation, or per-step, error analytically. I then compared the analytical prediction to empirica...
linear scaling of global error doesnt seem completely impossible
Is your local error at the last timestep also linear?
Actually, you should expect a better error
I took the norm up to element i of the local errors and found the global error to be proportional to the root of the time integrated
Not sure if that makes sense
What solver and ode
Where are the derivatives
these?
no I havent, the implementation is kinda finnicky and focused around a specific thing so modifying it isnt super easy
is there an explanation for the sqrt(t) proportionality?
Well if you do the taylor series analysis then you can probably derive something

these hitches appear if moments in the simulation arent that smooth and the time step has to be reduced
what is the min value for r_21? could be a numerical instability to the singularlity at 0
theres a case for 0 to make sure it doesnt diverge
the highly eccentric stuff is responsible for the step size having to be reduced
OK, you implemented a proper singularity removal strategy
yeah
honestly ill just go with the demonstration that its growing proportional to sqrt(t)
it should be sufficient
oh I have a sarafyans fehlberg implented too
thats a nice idea
dont think its for stiff scenarios but its another solver to get a different perspective
good point
hi
are there any papers on efficiently computing sobolev norms? i have an iterative scheme where i want to compute say the H^3 norm of my solution (vector evaluated at grid points) at each iteration
doing quadrature + finite difference for H^1 is fine but anything higher kinda gets tricky in terms of speed
ideally if the result extends to W^p,q would be even better
Can you elaborate on the speed concern
like if i’m doing 1000 iterations, id want to compute the H^k error as quickly as possible
L^2 is fast and H^1 is fastish
but with H^2 it starts slowing down a lot since i’m applying central difference and then quadrature to it
and doing that 1000x
Ok I have a meeting in 6 minutes but I will think about this after
it would be nice if i could just have like loss(p,q) and pass in a positive integer p or q and get the corresponding sobolev norm
and quickly since it’s computed at each iteration
but even just having an extension to H^2 would be great
thanks
Ok this is how I would do it
In 1d
Grid points $x_0, x_1, x_2, \ldots, x_n$ with grid spacing $\Delta x$ and function values $f_0, f_1, f_2, \ldots, f_n$
Angetenar
Then the $L^p$ norms of $\mathbf{f}$ are [\norm{\mathbf{f}}{L^p}=\left(\frac12f_0^p\Delta x+\frac12f_n^p\Delta x+\sum{i=1}^{n-1}f_i^p\Delta x\right)^{1/p}]
Angetenar
Ok now for higher derivatives
First, we have $f_i'=1/(2\Delta x)(f_{i+1}-f_{i-1})$ and $f_0'=1/(2\Delta x)(-3f_0+4f_1-f_2)$ and $f_n'=1/(2\Delta x)(f_{n-2}-4f_{n-1}+3f_n)$
Angetenar
So [\norm{\mathbf{f}}{W^{p,1}}=\norm{\mathbf{f}}{L^p}+\left(\frac12(f_0')^p\Delta x+\frac12(f_n')^p\Delta x+\sum_{i=1}^{n-1}(f_i')^p\Delta x\right)^{1/p}] which can be simplified to \begin{multline*}\norm{\mathbf{f}}{W^{p,1}}=\norm{\mathbf{f}}{L^p}+\\Bigg(\frac{1}{2^{p+1}\Delta x^{p-1}}((-3f_0+4f_1-f_2)^p+(f_{n-2}-4f_{n-1}+3f_n)^p)+\\frac{1}{2^{p}\Delta x^{p-1}}\sum_{i=1}^n(f_{i+1}-f_{i-1})^p\Bigg)^{1/p}\end{multline*}
Angetenar
This makes sense right
Next, for second order
[\norm{\mathbf{f}}{W^{p,2}}=\norm{\mathbf{f}}{W^{p,1}}+\left(\frac{\Delta x}{2}((f_0'')^p+(f_n'')^p)+\sum_{i=1}^{n-1}(f_i'')^p\Delta x\right)^{1/p}]
Angetenar
And so on
This is how I would code it in C++
double loss(const int p, const int q, const std::vector<double>& fvals, const double deltax) {
int size = fvals.size();
std::vector<double>& derivs (size, 0);
std::vector<double>& temp (size, 0);
double val;
double loss = 0;
for (int j = 1; j < size-1; j++) { // points 1 through n-1
loss += pow(fvals[j],p)*deltax;
}
// points 0, n
loss += pow(fvals[0],p)*deltax*0.5;
loss += pow(fvals[size-1],p)*deltax*0.5;
// derivatives
derivs = fvals;
for (int i = 1; i <= q; i++) {
// derivatives of order i
temp[0] = 1.0/(2.0*deltax)*(-3*derivs[0]+4*derivs[1]-derivs[2]);
temp[size-1] = 1.0/(2.0*deltax)*(3*derivs[size-3]-4*derivs[size- 2]+derivs[size-1]);
for (int j = 1; j < size-1; j++) {
temp[j] = 1.0/(2.0*deltax)*(derivs[j+1]-derivs[j-1]);
}
// accumulate to sum
loss += pow(temp[0],p)*deltax*0.5;
loss += pow(temp[size-1],p)*deltax*0.5;
for (int j = 1; j < size-1; j++) {
loss += pow(temp[j], p)*deltax;
}
derivs = temp;
}
return pow(loss, 1.0/p);
}
This is how I would implement it in c++
thanks i’ll try to implement it tmrw and see how it holds
i just wonder how fast doing that central difference calculation is
especially for like d=2 or d=3
could someone please help me solving
A is complex, but not \beta or Y
and i think that i've seen that you take the derivative of $\hat{\beta}^T$ sometimes
Jonathan
What are you trying to solve for
yes indeed
but i'd like to solve this one
Are you struggling with taking the derivative?
yes i am
MatrixCalculus provides matrix calculus for everyone. It is an online tool that computes vector and matrix derivatives (matrix calculus).
thank you!
use differentials to get the gradient vector with respect to beta
Heya! Anyone is interested studying together Statistics and Programming languages??
Do message me soon
Not channel appropriate
how do i solve something like this?
Have you done anything similar in class
Expand $\frac{F(x) - F(0)}{F(0)}$ as a Taylor series around $0$.
L
Maybe
This is from a numerical analysis text book
So I think that there may be some additional required consideration of floating point error
Maybe that can be handled assuming we can evaluate $\hat{F}(x)$ where $\hat{F}(x) = F(r(x))$, with $|\frac{r(x) - x}{x}| \leq \varepsilon$.
L
not sure what the typical assumption is for numerical anal
so i have to replace F(x) with its taylor series expansion and then show that what i get is bounded?
Lipschitz continuity is enough


The question was kind of vague. I suggest Taylor series because it gives full information for $(F(x) - F(0))/F(0)$. You may use the expansion up to second order with the lagrange remainder to get an explicit bound for the relative error in terms of $\delta$. It's gonna be on the order $O(\delta^2)$.
L
How are trancendential functions computed to arbitrary precision
I know computers usually use minimax polynomials
for float computations
but how would i compute sin(x), e^x, etc to arbitrary precision(there are a few families of generalizatons of these functions that do not have nice taylor series, but that I want to implement fast arbitrary precision algorithms for)
It'll depend on the specific function
NIST has a lot of information on this: https://dlmf.nist.gov/
What'd be the most computationally efficient way to solve a system of 2 nonlinear differential equations with the following very nice properties to arbitrary precision? As in, the error having a maximum error less then a given arbitrary value?
There is a conserved quantity(though it is not energy)
We know the solution is periodic, and we know the exact period.
We have a closed form solution in terms of an inverse integral(but computing the solution this way is numerically unstable and only works over part of the solution, hence why normal numerical methods for odes are prefered)
Our end goal is a fourier series for the function computed to again, arbitrary precision(I should be able to specify an error bound and it should compute fourier coefficients to the solution within that error bound).
A dense output would be preferable.
The solution over the real numbers is bounded between -1 and +1
Is there a way to directly find the fourier coefficients here?
actually, are there any books on numerical ode simulation in general?
Going into theoretical physics probability i have a hunch that will be useful
y' = x^3, x' = -y^3, x(0) = 1, y(0) = 0. Note y^4+x^4 = 1 is the conserved quantity
Is RK time integration not satisfactory?
I have a feeling a better method exists
I want the solution to be accurate up to machine precision for all times t
i'm trying to make a high fidelity table for some functions decribed in terms of solutions to these des
If you take a fourier transform, you should end up with a nonlinear system of equations that you can solve for all the fourier coefficients
the fourier transform of the equations themselves or of the numerical solution to those equations?
The fourier transform of the equations
Iserles is a classical text
alright, this turns into -iwY(w) = F(x^3), iwX(w) = F(y^3). Then what? Sorry if this is trivial
F(f(x)) is the fourier transform of f, same as X(w) is the fourier transform of x
god i wish there was a chain rule for fourier transforms haha
I'm busy now, I'll respond in an hour
Ok so the idea is
The functions are periodic so instead of a full fourier transform, a fourier series is sufficient
Assume that $y=\sum_ny_ne^{int}$ and $x=\sum_nx_ne^{int}$
Angetenar
Then $y'=\sum_niny_ne^{int}$ and $x'=\sum_ninx_ne^{int}$
Angetenar
And $y'=x^3$ so $\sum_niny_ne^{int}=\left(\sum_nx_ne^{int}\right)^3$
Angetenar
Now for the right hand side, we have that [\left(\sum x_ne^{int}\right)^3=\sum_n\sum_a\sum_b\sum_c\delta_{a+b+c=n}x_ax_bx_ce^{int}]
Angetenar
Think about why this is true
delta here is the kronecker delta, not dirac
Splitting about the modes, we then have that [iny_n=\sum_a\sum_b\sum_c\delta_{a+b+c=n}x_ax_bx_c]
Angetenar
And likewise, for $x_n$, [inx_n=-\sum_a\sum_b\sum_c\delta_{a+b+c=n}y_ay_by_c]
Angetenar
this looks like a convolution. Can we use the FFT to speed this up at all?
What are you going to take the FFT of
Anyways
To solve this numerically, truncate the range for n, a, b, and c
a, b, c, n in [-N, N]
x and y should be quite regular so y_n and x_n should decay quickly away from 0
could you give an example computation here for say x_1? I'm having a bit of trouble wrapping my head around this
again, thanks for this though
This is a nonlinear system of equations
yeah, could you show how to write out that system explicitly i guess is what i'm asking
Let $X=[y_{-N},y_{-N+1},\ldots,y_{N-1},y_N,x_{-N},x_{-N+1},\ldots,x_{N-1},x_N]$
Angetenar
Define $F(X)=inw_i-\sum_{a=-N}^N\sum_{b=-N}^N\sum_{c=-N}^N\delta_{a+b+c=i}z_az_bz_c$
Angetenar
Apply newton's method
The notation is kind of scuffed
But it shouldn't be too hard to figure out
Anyways I wouldn't recommend doing this
Directly doing RK-n will be much easier
This is probably a stupid question, but truncation error won't matter with enough steps right?
As in there is some nonzero stepsize i can employ such that the total error over the entire interval will be less then any given error bound right?
This is a bit of a tricky question
There is a small enough time step such that the total accumulated truncation error will be < epsilon
However, if you're doing this numerically, you should be careful of floating point error as well
Which is on the order of 10^-16 for double precision and will acumulate linearly with the number of time steps
If you need smaller errors, then quad precision has floating point error around 10^-34
now that i think about it because i'm only going to be doing this computation once to make a table and to find fourier coefficients, i could just use multiprecision floats
yes it's more expensive but it's not like i need to do this over and over again
When you actually do the fourier coefficient part, you should be careful about the period of the functions
My goal is to just find a fourier series that is accurrate to within 10^-34 for all inputs(so that this series is equivilent to the actual function for quad floats)
the period is known 100% exactly. It's a messy thingy involving the gamma function but it's an exact value
Have you seen this
glancing over this, yes there is a closed form solution for the integral of sin_4(x)
It was both listed in a textbook i found on the subject and I found it independently
the integral of sin4(x) iis 1/2*sin4(x)^2 * 2F1(1/2, 3/4; 3/2; sin_4(x)^4) +C
where 2F1 is the hypergeometric function
@wide spear Actually, I know the function exactly at a few other points. Does this make it any easier?
It does not, no
- There is actually a simpler form of the equation, x' = (1-x^4)^3/4, x(0) = 0. You can do something similar here right? Just raise both sides to the fourth power basically.
- This also works for just the sine part of the transform, sicne we know this function is odd, right?
3, doing this for the sine part, we get.
b_1^4*w^4*cos(wx)^4 = (1-(b_1sin(wx))^3)^4
we can expand the right, but then what?
do we plug in x=0?
also for n>1 wouldn't that system not be uniquely determined
wait nvm
i get this
I think i might have found a better way
I reduced it to solving a weird dft equation for a sequence basically
how do you just get rid of e^int here?
For this step?
yeah
You can separate each fourier mode
If $\sum a_ne^{int}=\sum b_ne^{int}$ then $a_n=b_n$
Angetenar
alright
also, i think i have a faster way to do this
,tex
$(\sum^{k}_{n=0} a_n)^{p}$ is, essentially, taking a convolution of the sequence $a_n$ with itself p times. So use FFT fast convolutions instead of a triple sum.
Colonizor48
How are you going to take the convolution of a sequence that you don't know the values of
,tex
Rewrite $(\sum x_ne^{iwnt})^3$ = $(\sum \mathscr{F}^{-1}(\mathscr{F}(x_ne^{iwnt}})^3)$. where ${x_n}^3 = {x_n^3}$
Colonizor48
Compile Error! Click the
reaction for more information.
(You may edit your message to recompile.)
Do the same to the other side
,tex
So we get $iw\sum\mathscr{F}^{-1}({\mathscr{F}(n*y_ne^{iwnt})$) = $(\sum \mathscr{F}^{-1}(\mathscr{F}(x_ne^{iwnt}})^3)$
where here, the sum operator simply sums over a finite sequence
note how the composition of the sum operator and F^-1 operator is a linear operator
therefore, we can factor the sum F^-1 operator out of both sides and get
$iw\mathscr{F}(ny_ne^{iwnt})$ = $\mathscr{F}(x_ne^{iwnt}})^3$
Colonizor48
Compile Error! Click the
reaction for more information.
(You may edit your message to recompile.)
now this is reduced so solving for the sequences x_n and y_n
which can probably be done using newtons method, but could maybe also be done symbolically or through some other method
Colonizor48
Compile Error! Click the
reaction for more information.
(You may edit your message to recompile.)
Also I think you can cancel out e^iwnt here right
How
Note that the fourier transform of the sequence can also be interpreted as a multivariate vector function
so we can start with guesses for x_n and y_n and use netwons method or something
or there could be a way to solve analytically\
Do this first, cancel the modes, then undo the step and rewrite the sum as a sum cubed again without the exponential term, then apply the fft optimization
start with an initial guess for the series of fourier coefficients, then use some sort of method to solve
@wide spear Does this hold up?
I'm not sure what this means
can someone direct me to resources on good general linear methods?
is order of convergence the same as order of accuracy
They're used in different contexts
Order of convergence is used for iterative methods
ok thanks
Write your own c++ code
"""
Rayleigh Quotient iteration.
Examples
--------
Solve eigenvalues and corresponding eigenvectors for matrix
[3 1]
a = [1 3]
with starting vector
[0]
x0 = [1]
A simple application of inverse iteration problem is:
>>> a = np.array([[3., 1.],
... [1., 3.]])
>>> x0 = np.array([0., 1.])
>>> v, w = rayleigh_quotient_iteration(a, num_iterations=9, x0=x0, lu_decomposition="lu")
"""
x = np.random.rand(a.shape[1]) if x0 is None else x0
for k in range(num_iterations):
sigma = np.dot(x, np.dot(a, x)) / np.dot(x, x) # compute shift
x = np.linalg.solve(a - sigma * np.eye(a.shape[0]), x)
norm = np.linalg.norm(x, ord=np.inf)
x /= norm # normalize
if verbose:
print(k + 1, x, norm, sigma)
return x, 1 / sigma
hi all, im trying to implement rayleigh_quotient_iteration here.
but I don't get this graph of calculation by my own hand calculation tho
so I set x0 = [0, 1],
a = np.array([[3., 1.],
... [1., 3.]])
then I do hand calculation, first sigma is indeed 3.000, but after solving x, the next vector, I got [1., 0.]
how the hell the book got [0.333, 1.0]?
where is this k=1 line from?
I did hand calculation, after first step x_k is wrong. x_1 = [1., 0.] after normalization it's still [1., 0.]
c

what should i get after first iteration?
i got (8/3, 4/3) but im not sure if its correct
how do i derive new general linear symplectic integrators
Are you familiar with how existing symplectic integrators are derived
No learning about that would be useful
@wide spear
[ 1.95, 1.75] (it asked for 2 iterations)
I found this notes in the Trefethen book. seems industy standard like matlab and LAPACK has better
Stopping Criteria than regular things we write ourselves. Does anyone know what they usually uses?
Is there some paper on stopping criteria?
normally you have a while loop with the stopping criteria $|| v^{(k)} - v^{(k-1)}||_2 > \varepsilon$ with $\varepsilon > 0$
malakai
Yeah I know this. This is very blend off the text book solution. I think what this meant is there are advanced
industrial practice on how to implement stopping criteria
sorry to disappoint you, there aren't any advanced ones at least for the power iteration
I think it meant not just for power iteration, but all iterative algorithms
This is a very common stopping criteria
I'm not sure what you are looking for in terms of advanced industrial practice
A lot of it is very ad hoc
i suppose that yehuihe believes that there are some special ones only used in advanced industrial practices which are not teached in generall
If you have a specific problem, sometimes you can use some problem structure for a different stopping criteria
Yes the way this book sentence framed pretty clear right? termination conditions are one of the major differentiator for my own solution and top-quality software. Anyway
You can see what stopping conditions lapack uses, it's all open source
But tbh, I suspect that the stopping conditions that lapack uses are not that fancy
I took a class with one of the lead devs
booth Matlab and lapack use the standard ones for each algorithm.
fancy ones you only have in codes adapted for special problems
Ok got it. seems these are for generic robust algo in the library. Thank you
oh one more question. In inverse iteration, we suppose to solve A-mu*I. If we choose a shift so close to an eigenvalue then we will converge very fast. If we choose mu to be an eigenvalue then should take one iteration. This suppose to make inverse iteration very useful if we know what eigenvalue already to find out eigenvectors
nearly singular ill-conditioned shift close to an eigenvalue cause no trouble indeed as explained in exercise. But if I use exact eigenvalue then shifted A is a singular matrix, which cannot be solved. How should I modify this in my code for this case?
for example A=[[3, 1], [1, 3]], eigenvalue 4 and 2. If I choose shift to be 4.000001, it converge in two iteration to 4 and find the eigenvector. It works
but if I choose shift to be exactly 4, then I can't solve this equation, therefore failed.
Well if you can't solve the equation, then you can terminate the iteration immediately
it depends, if you are only interested in the eigenvalue, you are fine. If you want to know the eigenvector and as in your case \mu = \lambda, then you can restart your algorithm with \mu = lambda + \varepsilon in order to compute the eigenvector
Yeah the point is if shift is exactly the eigenvalue then you can get eigenvector in a single iteration. if I add a epsilon then it will take two. But I get you. I think there is no nicer way to get it except adding an epsilon
hey, can anyone pls recommend me a good yt playlist for learning the mentioned numerical methods syllabus?
Consider reading a book
can you pls suggest me some good numerical methods books?
I think this roughly corresponds to burden and faires
thank you
hi guys
ive this course for my 4th sem
and i don't understand it
can someone suggest me tips to study
whats about exactly?
i tried studying from the suggested readings, i just don't get how to apply the methods
like lu decomposition, guass jacobi seidel etc
oh i see
do you have to do proofs or programming or practical exercises?
in paper?
i suggest you do the basics and know very well when to apply it or not
if the matrix is positive-definite etc
yeah from where do I do the basics
i would follow a book
but my advice is so trivial im sorry
i do think thats the basis for finite differnces
What is a specific question that you are struggling with
far? aside?
Well being conservative is pretty useful
What qualifies as remarkable to you?
Well conservation is pretty numerically useful
That's the primary benefit
It's also easy to formulate for unstructured meshes
From a math perspective, it's also interesting
There is the notion that finite volumes correspond to an alternative weak formulation
Finite element corresponds to the standard weak formulation right
Finite volume methods correspond to an alternative weak formulation where you formulate the pde in terms of its average value
how the proof for local convergence work

idk how this starts like this
quite werid
Its the thing where the solution isnt smooth or whatever
Actually idk
I just know its the thing where you multiply by test function and integrate
And use integration by parts
Ok im wrong sorta
Ok so this is the most common notion of a weak solution
But there are others
Like the viscosity solution
I remember reading something about averaging as another form of weak solution but I don't remember where and I've been trying unsuccessfully to find a reference
Yeah no worries
Mandy Moose
The variational formulation corresponds to finite elements
Distribution weak solution and test function weak solution are the same
My confusion is how do you write solvers for coupled diffeq in general
Ok bad question
Ig my problem is confusion with update steps and stuff
Yeah but that isnt what i mean ig
Sorry im on phone so i cant actually ask question that well
But more like I only know how to write solvers for linear higher order odes
If you write out a model problem I'll take a look tomorrow
Thanks ill do exactly that
Ill just make some shit up
And show my attempt
Ig i have confusion with that + nonlinear solving but I have to learn more about nonlinear myself me thinks
Because ive only done nonlinear solving for second order diffeq
Nah im lying lemme stop being disrespectful and give you full details when im ready
I have a conceptial question. In the Trefethen book when he mentioned he only restricting to symmetric matrices for power iteration, inverse iteration, and rayleigh iteratioin. But all computed rayleigh quotient in the algo. Does all three works for Non-hermitian matrix as well?
I asked chatgpt it says not for rayleigh quotient iteration but works for inverse iteration. Which is strange cause in inverse iteration also calculate rayleigh quotient
@wary oriole i suppose the issue is that the eigenvalues of real symmetric matrices are real, too. Therefore, you don't have to consider the complex case.
These methods works in general for hermitian matrix. Not just real symmetric ones
My question is whether it works for non hermitian
and if you want you can use M = A^H A instead of A
for the sign of the eigenvalue you can use one step of the power itertion used on A
In some situations they do and in some they dont. It depends on the matrix.
However, they lose most of the nice properties that are guaranteed for hermitian matrices.
For the non-hermitian case there are more specialized methods like Arnoldi Iteration and LOBPCG
Yeah seems like it. like cubic convergence.
but does power iteration and inverse iteration the same? I thought inverse iteration works in general sense
Power iteration should work for general matrices
You can prove the convergence using Jordan form
Power iteration and inverse iteration are the same exact method. Inverse iteration is just power iteration applied to an inverse matrix in order to ensure that the smallest eigenvalue becomes the largest
Hey
Hello.
Hello
I always misname it but thanks.
Do you understand french or I need to use chatgpt?
Hello?
Ok hermite interpolation
So, since I was in Newton and lagrange methode, it was direct.
The main formula and error formula.
Since I started diving into Chebyshev and Hermit, I couldn't keep up with the author...
Do you understand the idea behind hermite interpolation
Well so with newton/lagrange interpolation, you construct the interpolant purely using function values
With hermite, you also use derivative information
So it should be more accurate
Exactly.
Yes
But.
Oh alright.
So, it confused me with that example...
Why do I need to know it is linear independent?
So the H_0, H_1, K_0, and K_1 need to be linearly independent
This is sort of a fundamental property when doing interpolation
Those are the base of hermite, right?
$K_0$ is constructed to have the properties that $K_0(x_0)=K_0(x_1)=K_0'(x_1)=0, K_0'(x_0)=1$
Angetenar
This what I don't understand.
$K_1$ is constructed so that $K_1(x_0)=K_1(x_1)=K_1'(x_0)=0, K_1'(x_1)=1$
Angetenar
When it equals to 1 or 0?
Yes
Do you mind explaining it to me please?
I'm not sure what you don't understand
I'm a bit slow in these stuff (even in lagrange nominator)
So,
k indicates what exactly?
if i indicates which point..?
i and k are indices
Yes, i follows the point, k follows what?
H_0, H_1, etc..., K_0, K_1, etc....
So, how on earth i doesn't equal to k?
H_1(x_0)=0, H_1(x_1)=1
What do you mean
Do you agree that the interpolation of hermit give that polynome?
Yes, that is the hermite interpolant for two points
Exactly.
I can literally see the indice k in that polynome, but how does x change?
If it doesn't bother you, can we join a call, please?
It is your right, mate.
Anyway,
As I understood,
We have 2 points for example.
p(2n+1)= y0H0 + z0K0 + y1H1 + z1K1, right?
Yes
I still cant reach/find the case where I need use this:
You use those to check that the p(x) defined on page 83 satisfies 4.12 and 4.13
OHHHHH
I see I see.
So when you get the polynome (final result)
Instead of calculating H and K (exhausting) you just replace with their values directly, yeh?
At x_0 and x_1 you can just replace with the values
like p(x0) = y0(1) + y1(0) + z0(1) + z1(0) which means p(x0)= y0 + z0 right?
$p(x_0)=p_0H_0(x_0)+p_1H_1(x_0)+p_0'K_0(x_0)+p_1'K_1(x_0)=p_0$
Angetenar
p0 + p0'
K_0(x_0)=0
Since in K both i and k are identical in the case of i=k=0.
Oh yes, thanks for reminding me.
Silly question but
I can use either H to verify OR K to verify, right? (It all went down hill after BAC)
H"(x_0)=H"(x_1)=0
They don't even exist in the formula...
You can explicitly compute H_0' and H_1' from the given formulas on page 82
Bro... why do I need H' and K'?
I hope you bear with me because These 2 methods are the only pain in the ass for me.
You need K' to capture the derivative information correctly
But I still can't find them in the polynome formula...
This formula?
Yes.
They are not used in the definition of p
But if you check that $p'(x_0)=p_0'$ and $p'(x_1)=p_1'$ then you need to compute $H'$ and $K'$
Angetenar
hang on.
I GOT IT.
So, finding the polynome is the easier part.
But verifying it is the hardest part, we need to have the full equation of H and K and H' and K', this is why we have those propities to avoid all that wor, right?
Am I right?
I guess so
You can continue
I'm in page 84, cas generale.
Ok
What it is highlighted?
m is the number of derivatives that you use
