#numerical-analysis

1 messages · Page 6 of 1

sleek rover
#

Hello, i have one question related to interpolation. So my task is to interpolate closed curve but the problem i've met is certain x is having two or more corresponding y value so is for example lagrange interpolation applicable and if yes how?

wide spear
#

What

idle quartz
#

I just invert it inside my outer CG everytime.
So now there is an outer CG and an inner CG. Thanks anyway.

fossil glade
#

Sounds like hermitian interpolation, in which case, just lagrange won't cut it there

plucky kayak
fossil glade
#

I am a bit confused by trigonometric interpolation:
We've shown how the FFT takes y0, ... y_n (where n+1 is a power of 2) and returns c_0, ... , c_n. From those I get coefficients a_i = c_i + c_-i and b_i = i(c_i-c_-i) for i between 0 and m=(n-1)/2... but that would only require 2m+1 = n values c, but I am given n+1 values of c

wide spear
#

Is y_n at the endpoint of the interval?

fossil glade
#

In our case it is the interpolant evaluated at $2\pi\frac{k}{n+1}$ with k=n

pine jettyBOT
wide spear
fossil glade
pine jettyBOT
sleek rover
#

Here is task itself it says that there is given the closed curve. Idk what interpolation they mean by second task.

#

Also one more thing they told me right now is to do the interpolation in range by range. But how do i find this ranges?

gritty cliff
#

am solving the 1-D advection-diffusion equation, but I am stuck on how to implement the formula into my code. I understand how to the the next time step when the advection term and diffusion term are separate, but I am stuck now when they are both together. I am using Crank-Nicolson for the Advection term and RK4 for the diffusion term. I am Able to get this far but i realize that RK4 is a multi-step method with 4 steps. What I have solved by mistake is RK2. How do I advance further than this? What i am trying to find the the next timestep U^n+1. In this image D1 is a derivative matrix for the 1st derivative and D2 is one for the 2nd derivative. (error i spotted in my writing its supposed to be dt/2 not dt/4)

#

(if someone comes around who is able to help feel free to dm me. i am off to bed 😴 )

heavy swallow
#

who knows , why do deflate the matrix , eliminating the last row and column will not cause the final answer wrong?
because i think keep last row and column will take effect to other eigenvalues's calculation , and i think it should consider whole matrix ,not only sub matrix

fathom rain
#

you can view a matrix of the form B=[A 0;0 a] where A is a matrix and "a" is a scalar as a block diagonal matrix (where A is one block and "a" is the second block) The eigenvalue "a" of B is independent of the the rest of the matrix (and can thus be "discarded"

#

example: ```julia> B
5×5 Matrix{Float64}:
0.18417 0.95633 1.57871 0.635951 0.0
0.95633 0.42293 1.14073 1.01519 0.0
1.57871 1.14073 0.222519 0.649137 0.0
0.635951 1.01519 0.649137 1.9075 0.0
0.0 0.0 0.0 0.0 5.0

julia> eigen(B)
Eigen{Float64, Float64, Matrix{Float64}, Vector{Float64}}
values:
5-element Vector{Float64}:
-1.3899812449001656
-0.5821905848859844
0.9999619656168435
3.7093277956206867
5.0
vectors:
5×5 Matrix{Float64}:
0.670541 0.421714 -0.416131 -0.446506 0.0
0.119093 -0.855552 -0.163937 -0.476416 0.0
-0.731924 0.24181 -0.431349 -0.468778 0.0
-0.0218994 0.178089 0.783516 -0.594901 0.0
0.0 0.0 0.0 0.0 1.0```

heavy swallow
#

thank you sverek , let me check it

wide spear
heavy swallow
pine jettyBOT
#

cache-missing

fathom rain
# pine jetty **cache\-missing**
julia> B
5×5 Matrix{Float64}:
 0.614101  1.09511   1.20847   0.630836  0.773735
 1.09511   1.84073   1.53124   0.856159  0.716563
 1.20847   1.53124   0.114145  1.41037   0.0239439
 0.630836  0.856159  1.41037   1.46599   0.263584
 0.0       0.0       0.0       0.0       5.0

julia> eigen(B)
Eigen{Float64, Float64, Matrix{Float64}, Vector{Float64}}
values:
5-element Vector{Float64}:
 -1.2403034786581852
 -0.015204498399530662
  0.822681140496317
  4.467783661371424
  5.0
vectors:
5×5 Matrix{Float64}:
  0.325097  -0.834671  -0.186815  0.403405  0.386012
  0.230702   0.509684  -0.563801  0.607559  0.539833
 -0.865804  -0.117312   0.059875  0.482739  0.379609
  0.302443   0.172579   0.802274  0.484871  0.389487
  0.0        0.0        0.0       0.0       0.513587

julia> eigen(B[1:4,1:4])
Eigen{Float64, Float64, Matrix{Float64}, Vector{Float64}}
values:
4-element Vector{Float64}:
 -1.2403034786581866
 -0.015204498399531197
  0.8226811404963139
  4.467783661371417
vectors:
4×4 Matrix{Float64}:
 -0.325097   0.834671  -0.186815  -0.403405
 -0.230702  -0.509684  -0.563801  -0.607559
  0.865804   0.117312   0.059875  -0.482739
 -0.302443  -0.172579   0.802274  -0.484871```
heavy swallow
#

thanks !

gritty cliff
heavy swallow
#

hello , who knows ,why power iteration can evaluation the eigenvalue, the rayleigh quotient has a condition that is x is close to eigenvector ,but in the algorithm, u_j is only unit vector ,not promise close to the eigenvector

wide spear
#

The key is that it is an iterative method

#

u_j is a unit vector that is changing direction

heavy swallow
#

u_j is only close to the direction of eigenvector , but not in value ,

#

so i don't understand how can calculate the \lambda use u_j

wide spear
#

As you iterate, u_j gets closer and closer to an eigenvector

#

Eventually, it will be machine precision away from an eigenvector and the corresponding lambda_j will be machine precision away from the corresponding eigenvalue

heavy swallow
#

after iterate many times, the $u_j$ still an unit vector , becuase it's definition is $u_{j-1} = x_{j-1} / ||x{_j1}||_2$

but!
the eigenvector of A is may not unit vector , so ,the u_j is close to the eigenvector only in direction , but not value , this is what am confuse, why in the algorithm ,use $u_jT$ to evaluate $\lambda$ , that is $\lambda_j = u^{T}{j-1}Au{j-1}$

wide spear
#

?

#

If x is an eigenvector then any c*x is an eigenvector for c a nonzero scalar

pine jettyBOT
#

cache-missing
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)

heavy swallow
#

get it ,

#

thanks !

lapis tangle
#

Does this look right?

scarlet spruce
#

it's hard to read

lapis tangle
#

wait a second

lapis tangle
scarlet spruce
#

i meant due to the handwriting 😂

lapis tangle
#

HAH im sorry okay my mistake

scarlet spruce
#

but you have more steps to do

#

i think it's correct are xi_j the coef for u?

lapis tangle
#

the u is the J and the v is the i.

scarlet spruce
#

use linearity to get the stiffness matrix

lapis tangle
#

exactly, that should be the last step right

#

oh wow thank you criver 🙂 i am shocked i did this properly to this point 🙂

scarlet spruce
#

also you wrote v(0)=v(L)=v(0)

#

i think you meant to write = 0

lapis tangle
#

yes, i was going to ask, thats the correct assumption to make right

scarlet spruce
#

the conditions are not periodic

#

it's a wrong assumption

lapis tangle
#

since the nodes should equal to the values right?

scarlet spruce
#

the correct is v(0)=v(L)=0

lapis tangle
#

yes, i wrote incorrectly

#

that is what i meant

#

okay i got it into a matrix form and written all out, thank you criver 🙂

lapis tangle
scarlet spruce
#

if you prescribe derivatives this is not the case anymore

#

but there you just substitute the derivative with whatever is prescribed

lapis tangle
#

say the that function equals zero? Also wouldnt you drop it out of A?

#

and thank you btw criver, my teacher really wanted to go over why that problem that i showed you previously was singular. he thought i was a genious because i knew the answer. Thank you for helping me 😛

scarlet spruce
#

you have essential/stable and natural BCs

#

there's a discussion of that in Evans and Gazzola

#

essentially if I have something like Au = f, where A is a differential operator

#

then you integrate by parts (i.e. use Green's theorem) enough times to transfer half of the derivatives to the test function

#

this produces as many boundary terms as steps you do

#

e.g. if A = (-\Delta)^{2q}

#

then you would transfer (-\Delta)^q to the test function

#

and that would pop out terms like \Delta^m v d_n \Delta^{l} and d_n \Delta^m v \Delta^l u

#

in either case ones with order >=2q-1/2 would be termed natural

#

the rest are stable

#

the stable ones can be zeroed out

#

maybe that's a bit too advanced though

lapis tangle
#

im lost 😛 i wont lie, i understand greens theorm and how its igbp. i guess you can do it multiple times and it evenly splits the dervative out. if it meets some condition its stable if not i guess its unstable.

that has somethign to do with BC right? so like dirchlet conditions are stable while neumann arent?

scarlet spruce
#

natural ones are outside the Sobolev space and you need to substitute

#

e.g. Delta u = f

#

Sobolev space is H^1

#

but on the boundary you are allowed only 1-1/2 = 1/2

#

so v d_n u must disappear because d_n u isn't in the spsce

#

if you prescribed Dirichlet conditions v=0

#

if you prescribed derivatives d_n u = g, then just substitute to get int v d_n u = int v g

#

you have to separately enforce stable/essential BCs

#

natural ones appear "naturally" in your formulation

#

for A = Delta, stable is Dirichlet and natural is derivative (at least for H^1)

#

for A = Delta^2, stable is u(x) =..., d_n u(x) =...

#

and natural are Delta u(x) = ..., d_n Delta u(x) = ...

#

wait

#

no

#

now it's correct

#

the first two are of order 0,1 which is smaller that 2-1/2 = 3/2

#

the natural ones are of order 2 and 3

lapis tangle
#

i see, haha, is this advanced math?

#

you have an example of a book that woudl teach this?

#

what kind of math is this even?

scarlet spruce
#

the monograph under pubkications

#

polyharmonic boundary value problems

#

evans has it shortly in his pde book too

lapis tangle
#

the book im using is by some swedes named larson and bengzon

#

i must say its quite a good book, it read very well

#

thank you for the knowledge 🙂

fathom rain
#

larson is in umeå

#

you take a course at kth? 🙂

lapis tangle
#

can i ask a question on finite difference method here or is that too basic for this room?

scarlet spruce
#

it's fine

lapis tangle
#

im using the central differnce method for this.

its (U_j+1 - 2U_j + U_j-1) / h^2

#

and then im going to use the implicit to get the ax = b right?

scarlet spruce
#

well, discretise the domain in space, then approximate the second derivative yes

#

careful at U1 and Un

#

you have to account for the bcs

lapis tangle
#

yes, im unsure what to do. since its not dervatives here its not ghost points

#

so would it be that A would be something like this?

scarlet spruce
#

sGhost are fine

#

e.g. study dxx U1, and see that U0 is included, just substitute in the bc for it

#

similarly for Un, check Un+1 there

lapis tangle
#

for the first ghost point would it be u_j-1 = u_j+1 ?

scarlet spruce
#

you can pick equidistant grid with xi = i/(n+1)

scarlet spruce
#

assume 1,...,n are on the interior and 0,n+1 are at the bcs

lapis tangle
#

alright i think i got it ill get to work now. So I can use the explicit method with this and ghost points

scarlet spruce
#

you can use ghost points yes

scarlet spruce
#

note that u0 = u(0) and un+1 = u(1) and just use that

lapis tangle
#

im gonna sleep on it and try tommorow, im a little scared. this is a practice exam and i can do like 70% of it it seems.

im a bit stuck on this one though. thanks for the help criver gonna call it a night 🙂

fossil glade
#

What kind of convergence should I expect with the discrete fourier transform? That is building a sum of sine and cosine waves from the fourier coefficients a la FFT

wide spear
#

What limit are you taking?

fossil glade
#

Adding interpolation points, specifically in powers of two

wide spear
#

So you fix a domain and make the grid spacing finer?

fossil glade
#

Yeah

wide spear
#

The DFT will converge to the continuous fourier transform

#

You can see this by viewing the DFT as a discretization of the fourier transform integral

fossil glade
#

0 to 2 pi, points of the form 2pi k/N

#

Right, this in the context of interpolating periodic functions but the error so far has been terrible

wide spear
#

Error in an implementation?

fossil glade
#

Could be. But I am not alone in getting errors of that magnitude. Do you maybe know of a source that describes such an implementation?

wide spear
#

In mathematics, trigonometric interpolation is interpolation with trigonometric polynomials. Interpolation is the process of finding a function which goes through some given data points. For trigonometric interpolation, this function has to be a trigonometric polynomial, that is, a sum of sines and cosines of given periods. This form is especial...

fossil glade
#

That's wildly different way of going about it. Hm...

wide spear
#

What is your way of doing it?

fossil glade
#

The wiki way is constructing a certain basis, our way was finding the a_i and b_i's explicitely

#

So far, given an even number of points n and m=n/2 taking a_1 = c_1/2 and c_m/2=a_m+1 and finding the a_i = c_k+c_k+m and b_i = i(c_k - c_k+m)

#

that way of finding the b_i is seemingly the only way to do it, since only that way do the actual outputs pair up to have equal imaginery or real parts

#

in other words, taking this https://en.wikipedia.org/wiki/Discrete_Fourier_transform#Inverse_transform
and trying to figure which things cancel to real valued cosine and sine terms

In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex-valued function of frequency. The interval at which the DTFT is sampled is the reciprocal of the duration o...

fossil glade
wide spear
#

?

fossil glade
#

pi is a root of sinc

#

-0.04 is a tad bit off from 0

random canopy
#

it's sin(pi x)/(pi x) instead of sin(x)/x

fossil glade
fathom rain
fossil glade
#

?

fathom rain
#

standard definition

vernal narwhal
#

How do I go about solving for my new value in adam moulton order 2 or above

#

Given it is implicit

#

I was told that I should use like newtons method but I don't see how I am to use it in this example . Do I perform a taylor approximation about f(tk,yk) ?

#

i might just need to look more into it but I am not sure how I am suppose to go about solving for a yk+1

wide spear
#

You are solving y_k+1-h/2*f(t_k+1,y_k+1)=y_k+h/2*f(t_k,y_k) right

#

Or how about this

#

We have that [y_{k+1}=y_k+\frac{h}{2}\qty(f(t_k,y_k)+f(t_{k+1},y_{k+1}))] so then [y_{k+1}-\frac{h}{2}f(t_{k+1},y_{k+1})=y_k+\frac{h}{2}f(t_k,y_k)] so we set $C=y_k+\frac{h}{2}f(t_k,y_k)$ and then [F(x)=x-\frac{h}{2}f(t_{k+1},x)-C] so then we want to solve for $F(x)=0$ which we do using Newton's method

pine jettyBOT
#

守沢千秋

vernal narwhal
#

like you might do

#

$F(x) \approx F(x_1) + F_x(x_1)(x-x_1)+ F_t(t_1)(t-t_1)$

#

wait nvm...

pine jettyBOT
#

Brandon7716

vernal narwhal
#

hmmCat I think I get it

#

t is fixed so we don't have the partial t

#

well its 0

wide spear
#

y_{k+1} is a number

vernal narwhal
#

but I don't know that number

wide spear
#

That's whay you're using Newton's method for

vernal narwhal
#

oh okay. I see

#

so as far as a "guess" to initiate the method I can just throw in my previous y_k and see where it converges?

wide spear
#

Yes

vernal narwhal
#

okay I think I got it now, thanks pandaHmm

vernal narwhal
#
function [G3_x, G3_v] = G3_Scheme(t, G3_x, G3_v, u, h, x_p, v_p, i)
    if i <= 2
        [G3_x, G3_v] = RK4_Scheme(t,G3_x, G3_v,u,h,x_p,v_p,i);
    else
        syms x v;
        A = (18/11)*(G3_x(i))-(9/11)*(G3_x(i-1))+(2/11)*(G3_x(i-2));
        B = (18/11)*(G3_v(i))-(9/11)*(G3_v(i-1))+(2/11)*(G3_v(i-2));
        f1 = x-(6*h/11)*x_p(t(i+1),x,v,u)- A;
        f2 = v-(6*h/11)*v_p(t(i+1),x,v,u) - B;

        % Create a vector of symbolic variables
        vars = [x; v];

        % Create a vector to store the functions
        F = [f1; f2];

        % Compute the Jacobian matrix
        J = jacobian(F, vars);
        
        %Initial Guess
        x0 = [G3_x(i); G3_v(i)];

        %Newton-Rapson
        for j=1:10
            J_x0 = subs(J, vars, x0);
            F_x0 = subs(F, vars, x0);
            deltaVec = linsolve(J_x0,-1*F_x0);
            x0 = x0 + deltaVec;
            if norm(deltaVec) < 10e-6
                %disp('Norm condition met');
                break
            end
        end

        G3_x(i + 1) = x0(1);
        G3_v(i + 1) = x0(2);
    end
end
#

so I think I implemented it correctly

#

and it did graph

#

x_p and v_p are the ode system for van der pol

vernal narwhal
#

🙏 it seems linsolve can be slow or maybe it can't solve it and isn't tell me. I should look into this

wide spear
raven dew
#

just write it out in terms of the explicit definition

river thicket
#

does anyone know how to do this problem?

#

i've made a basis {e^(ik(n1xp+n2xp)} and a matrix A with this basis for all my datapoints x

#

so A = { e^(ik(n1 * x + n2 * y)), ... , e^(ik(n1 * x + n2 * y))}, for different points of n1 and n2

#

now, how do you use the least square method here?

#

I've been stuck on this problem for hours and I am not progressing

#

v(xp) = v(x,y)

scarlet spruce
#

if you have min_x |Bz-f|^2 then B^*B z = B^* f is the solution

#

however your basis should be orthogonal here I believe, or is it not?

#

in either case B_pl = exp(ik(n1(l) * xp + n2(l) * yp))

#

1<=p<=M and 1<= l <= (2N+1)^2

#

you can use the map l(n1,n2) = (n1+N) * (2N+1) + (n2+N), then l(-N,-N) = 0, l(N,N) = 2N(2N+1) + 2N = (2N+1)(2N+1) - 1

#

then the inverse maos are n2 = l % (2N+1) - N and n1 = floor(l/(2N+1)) - N (or just integer division withoit floor)

#

so now fp = v2(xp)

#

and zl = hat{v2}(n1(l), n2(l))

#

@river thicket

river thicket
river thicket
scarlet spruce
#

because your formulation has hat{v2}(n1(l), n2(l))

#

i just name this vector z with the vectorization discussed

#

then that double sum can be written as a single sum

#

and thus as a matrix vector product Bz

#

then you're in the standard setting |Bz-f|^2

river thicket
#

So we're solving all the v_1(n1,n2):s here?

#

the coefficients or the amplitude for v_1(x,y)

#

A\v_1(x,y) in matlab code

#

where A is our basis matrix

#

So we're solving all the v_c:s

v_1(x,y) = v_c1(n11,n21) e{ik(n11x+n21)} + ... v_cr(n1r,n2r) e{ik(n1rx+n2r)}

#

@scarlet spruce

scarlet spruce
#

zl = v(n1(l),n2(l)) is just a vector z of unknown coefficients

#

B^* B z = B^* f

#

you don't need backslash or to even form matrices if this is orthogonal

river thicket
#

but the matrix is a m x n form

#

m != n

scarlet spruce
#

yes

#

that's a non-issue

#

see what I wrote and think about why this is the case

river thicket
#

alright gotcha

#

thank you criver

#

hope ur doing okay

wide spear
#

What is the minimum flops needed for the solution of a 3x3 linear system?

dense echo
#

What's the number to beat? Plain Gaussian elimination takes 30, not counting comparisons to guide pivot choices.

wide spear
#

Well I guess 30 is the number to beat

#

Actually how many flops is it for the explicit solution

dense echo
#

My best idea for that one (that is, under the constraint that the only divisions are by the complete determinant) is 50.
Computing a determinant as (col1 × col2) · col3 takes 14 flops, but the common denominator can reuse the cross product from one of the numerator calculations and then only takes 5 extra.

ebon cloud
#

Could somebody help me gauge what extrapolation is?

#
We have given a dataset [xi] and [F(xi)]. We also have given that a(h) = centralised differentialquotient of F. 
What we want to calculate is f(1) (the derivative at place 1). Also to be considered is that F is analytical.
#

I dont quite understand it and have been reading through the lecture notes for like 2 hours

fathom rain
ebon cloud
#

So first thing to do is calculate the Polynomial?

ebon cloud
fathom rain
fathom rain
cold vessel
#

QR decomposition is messed up. Do you actually have to do the matrix multiplication $R_{i,n} A$ in order to figure out the next rotational matrix $R_{i+1,n}$?

pine jettyBOT
#

edwardborn

cold vessel
#

That's going to result in like $\mathcal{O}(n^2)$ number of matrix multiplications!

pine jettyBOT
#

edwardborn

wide spear
#

Are you doing this with Givens rotations?

cold vessel
#

Yeah

cold vessel
cold vessel
#

This shid will be cheesed as hard as possible with permutation matrices

lavish palm
#

2 = c_0 + c_1,
0 = c_0 \cdot x_o + c_1 \cdot x_1,
2/3 = c_0 \cdot (x_o)^2 + c_1 \cdot (x_1)^2,
0 = c_0 \cdot (x_o)^3 + c_1 \cdot (x_1)^3

im trying to setup a simpsons rule looking evaluation for the following integral:
int -1 to 1 f(x)dx approx c_0x_0 + c_1x_1

and i came up with the system above by using 1 ,x, x^2, x^3 for f(x). I tried solving it by hand and got x_1 = 0. 1/3, +/- i/sqrt3 . and a classmate got x_0 = 1/sqrt3 , x_1 = -1/sqrt3 , c_0 = c_1 = 1. She got it with matlab so i just assume i mustve made a mistake somewhere.

But what i really wanna know is can i solve that system in a less annoying way than just solving for each variable and plugging in somewhere else like i originally did?

#

The original wording for the homework problem:

Find nodes x0, x1 and coefficients c0, c1 such that:

int -1 to 1 f(x)dx approx c_0x_0 + c_1x_1

has the highest degree of accuracy possible.

wide spear
#

That's the usual way to do it

#

And is applicable to a wide range of problems

#

However, there is a specialization known as Gauss-Legendre quadrature where the x_i will be the roots of the Legendre polynomials

fossil glade
#

This is about Haar spaces and that looks… clearly wrong?

misty bronze
#

Hello guys, is this the right place to discuss the Galerkin method? 😄

misty bronze
#

epic

fossil glade
misty bronze
#

my understanding is that the Galerkin method is quite good

dreamy copper
#

in your example f is e^x

#

What about lambda_n+1?

#

I guess correct me if I am wrong but f in $W_n$ means $f=\sum_{i=1}^n a_ie^{\lambda_i x}$ where $a_i\in\mathbb{R}$

pine jettyBOT
#

cofe prpl

dreamy copper
#

So using your examples for lambda we can take n=1 so n+1=2 and we can let f be ae^3x +be^x and e^-\lambda_2 be e^-x

#

So then we want to find c such that

$e^{-x}(ae^{3x} +be^x)-c= ne^{3x}$ for some n

pine jettyBOT
#

cofe prpl

dreamy copper
#

Nah im confused

#

I see what its saying though

#

I think I see what its trying to say

#

Yeah cus this is clearly false

#

Because lhs has slower growth than rhs

#

Give me any updates about what the correct statement was

fossil glade
#

Then I shifted c to the other side which gets me e^2x=ae^3x+c, which is pretty clearly not the same looking at the derivative of it's log (2 vs ae^3x/(ae^3x+b), the namely converges to 1)

#

Or just intuitively cursed

dreamy copper
#

Yeah this is not right

#

Its trying to be some statement about linear dependance

wide spear
#

It looks like you have two separate lambda_2s

fossil glade
wide spear
#

Oh wait my bad I misread

dreamy copper
#

Good point though

#

Ive heard assumptions for indexed lambdas being ordered in numerical linear algebra

#

I dont think ordering does shit here though

fossil glade
#

Yeah, no.

#

The LHS can always be constant times e^(lambda_1-lambda_2)x. The RHS can be cleared up by differentiating once until you have something like:
e^(difference in lambda)x = constant times e^(lambda 1)x

#

So like, this necessitates lambda 2 being 0 💀

#

ooh update

fossil glade
pine jettyBOT
misty bronze
#

I would love some feedback on this attempted solution to the problem in attached screenshot:
For Helmholtz equation:
For Helmholtz equation:
$$
u''(x) + \alpha^2 u(x) = f(x), x\in [-1,1]
$$
With bcs = $u(\pm 1) = 0$.
We define $L(u) = u''(x) + \alpha^2 u(x)$, and $R = L(u) - f$ and $R_N = L(u_N) - f$.
We seek to find an approximation solution $u_n \in V_n$ where $V_n$ is the span of $\psi_i$, for $\psi_i (\pm 1) = 0$. By Galerkin's method we find $u_N \in V_N$ such that $(R_N,v)=0 \forall v \in V_n$.
Expressing as linear algebra problem:
$$
(u_N'' + \alpha^2 u_N - f, \psi_i) = 0, i \in 0,1,\dots,N
$$
With some manipulation we get:
$$
\Rightarrow \sum_{j=0}^N \hat{u}_j ((\psi_j'',\psi_i) + \alpha^2(\psi_j, \psi_i)) = (f,\psi_i), i \in 0,1,\dots,N
$$
We define $\mathbf{x}$ such that $x_i = \hat{u}j$, $\mathbf{b}$ such that $b_i = (f, \psi_i)$, and $A$ such that $a{ij} = \alpha^2(\psi_j, \psi_i) - (\psi_j',\psi_i')$.
As such, $u_N$ may be found by solving $A\mathbf{x} = \mathbf{b}$ for $\mathbf{x}$.

pine jettyBOT
#

madlor

misty bronze
#

i used ChatGPT to check my answer, but it would be naive to blindly trust it to detect if i made an error

wide spear
#

Where did the u hat j come from

misty bronze
#

oh eh

#

from $u_N = \sum_{j=0}^N \hat{u}_j \psi_j$.

pine jettyBOT
#

madlor

misty bronze
#

its the coefficients in $u_N$ polynomial thingy

pine jettyBOT
#

madlor

misty bronze
#

$u_N$ is the approximation to the sol for the PDE

pine jettyBOT
#

madlor

wide spear
#

When you write x i equals u hat j, should that be x j

wide spear
misty bronze
#

Hmm, i agree

#

i will make sure to mention that next time

#

does the rest look reasonable ?

wide spear
#

Yes

#

You may want to mathbf the matrix A

misty bronze
#

oo ok

#

well great

#

that means i understood what i need to understand for my exam

wide spear
#

For an exam, you should be clear about what part is the solution to 2a

dreamy copper
dreamy copper
fossil glade
#

But it itself is a non proof

dreamy copper
#

I never heard of a haar space. What are some interesting things about them?

#

I looked on wikipedia and it looks like a space with the property that there exist unique element that best approximate any desired real valued function

grave sluice
#

Hello guys.

I'm currеntly studying Rombеrg Intеgration in numеrical mеthods and havе a quеstion rеgarding its application. In Rombеrg's mеthod, wе intеgratе using tеchniquеs likе thе trapеzoidal rulе and Simpson's 1/3 & 3/8 mеthods. My quеstion is, can wе choosе any of thеsе intеgration mеthods as a basе for Rombеrg Intеgration, or doеs Rombеrg Intеgration rеquirе spеcific mеthods? Additionally, how do wе dеcidе which mеthod to usе in thе contеxt of Rombеrg Intеgration?

plucky kayak
#

you can use most basic left/right rectangles, trapezoid or midpoint rules

#

since romberg allows you to achieve arbitrarily high accuracy there's hardly any reason to use more complicated integration methods

neat gorge
#

Hi, sorry for double posting. I didnt realize university-level questions were meant to be posted in specific topic channels.
My question is, I am working with Lagrange, Hermite and Chebyshev interpolation schemes. I have verified that, when performing Lagrange interpolation, it is OK to first transform the X domain to the [-1, 1] interval for maximum precision. Same applies to interpolation with Chebyshev basis. Of course, for values of derivatives, there would be scaling constants.
However, I am now testing Hermite interpolation, and I do not get the same results if I first normalize the X values to [-1, 1]. Any idea why? thanks a lot in advance!
One thing to note, I am using the following formula for Hermite interpolation polynomial:

#

Could it be that normalization of X to [-1, 1] does not work because there are two terms being added (the 2 sums), and the effect of the normalization will be different in each term, so it leads to non-linear effects?

grave sluice
# plucky kayak since romberg allows you to achieve arbitrarily high accuracy there's hardly any...

Thank you for your rеsponsе. To clarify, wе'll bе adhеring to thе standard rulеs and mеthods. Additionally, I'd likе to inquirе about thе origins of thе formula wе'rе discussing. Is it dеrivеd from thе trapеzoidal formula? I undеrstand its purposе is to approximatе thе arеa undеr a curvе, but I'm curious about its foundational dеrivation. Could you plеasе еlaboratе on this?

plucky kayak
#

well I don't know about that particular formula, but another one is derived based purely on considering integral's exact value and it's approximation, regardless of how the approximation was computed

#

$U = \int_a^b u(x) \dd x = U_N + O(h^p)$ where $U_N$ is approximate value of the integral computed on the grid with $N$ line segments, $h$ segment length and $p-th$ order of accuracy

then you can compute the same approximation on two grids - original one and one that has $r$ times more line segments $\ U = U_N + c h^p + O(h^{p+q}) \ U = U_{rN} + c\left( \frac{h}{r} \right)^p + O\left( \left( \frac{h}{r}\right)^{p+q} \right) \$ where $q = 1$ in the case of left/right rectangles and $q=2$ in the case of trapezoid/midpoint rule

pine jettyBOT
#

Transparent Elemental

plucky kayak
#

now you can just subtract first equation from second and express the unknown constant $c = \frac{U_{rN}-U_N}{r^p - 1} \cdot \frac{r^p}{h^p} + O(h^q)$ and substitute it in the second equation $\ U = U_{rN} + \frac{U_{rN} - U_N}{r^p - 1} + O(h^{p+q}) \$ so now you have an approximation to $U$ with $(p+q)$ order of accuracy instead of $p$

pine jettyBOT
#

Transparent Elemental

plucky kayak
#

then you can compute U_{r^2N} and compute the new estimate with p+q order of accuracy by using previous value U_{rN} (not the higher accuracy estimate), and knowing estimates for U_{rN} and U_{r^2N} both with (p+q) order of accuracy you can compute new estimate for U_{r^2N} with p+2q order of accuracy by applying the same formula and replacing p with p+q

grave sluice
#

Okay Thank you for your detailed explanation on the technique,
but I have noticed that the step size is halved at each iteration (h to h/2, then h/4, etc.). Could you explain why the step size is specifically halved each time instead of being divided by three or another number?

#

How doеs this particular halving contributе to thе mеthod's accuracy?

plucky kayak
#

you make finer grid

#

particular choice of r doesn't matter that much

grave sluice
#

Thanks for the Insight, so its the refinement of the grid whats important to improve the accuracy rather then the factor by which the step size is reduced;

plucky kayak
#

these are the same thing since step size and number of grid points are inversely related

#

h = (b-a)/N where N is the number of line segments over [a;b] and h is step size

#

by dividing h/r you get that it's the same as (b-a) / (rN), so the number of line segments grew by factor of r

#

to get the number of grid points you just need to replace N with N+1

strange yoke
#

When implementing periodic boundary conditions, are the first and last points considered adjacent, or to be the same point?

wide spear
#

It depends on how you're discretizing

strange yoke
#

My problem is just Poissons equation in 1D

#

2nd-order central difference

#

So, I have the governing equations at the endpoints,
$$
\begin{align}
&\phi_{-1} - 2\phi_{0} + \phi_{1} = \Delta x ^{2} \rho_{0} \
&\phi_{N_{x} - 2} - 2\phi_{N_{x}-1} + \phi_{N_{x}} = \Delta x^{2} \rho_{N_{x}-1}
\end{align}
$$
where $j \in [0, N_{x}-1]$

pine jettyBOT
#

Quantumfluxcapacitor
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)

wide spear
#

Where are the x_i located

strange yoke
#

They are coincident with the \phi_{j}, meaning the \phi are defined at the gridpoints

wide spear
#

What is the coordinate of x_i

strange yoke
#

The grid is uniformly spaced from [-\pi, \pi]

#

so x_{i} = -\pi + i * \Delta x

wide spear
#

Ok so because it's periodic, phi(-pi)=phi(pi) right

#

x_0=-pi but your indices only go up to N_x-1 which is at (N_x-1)/N_x*pi

#

So the last and first point are adjacent in your case

strange yoke
wide spear
#

You don't have a point at pi

#

If your j indexed from 0 to N_x then x_(N_x) would be at pi

strange yoke
#

\Delta x = L / (N_x - 1)

wide spear
#

Oh in that case then your first and last point are the same point

strange yoke
#

which means that x_{Nx-1} = pi

wide spear
#

Yes

strange yoke
strange yoke
#

So, this means that \phi_{-1} = \phi_{Nx-2}?

wide spear
#

Yes

grave sluice
#

Hello guys, I have a question on Gauss-legendre quadrature interval of integration.
I understand that the standard interval for a two point Gauss legendre is from [-1,1], but what if the integral was from [a,b] and its not from [-1,1]? How do I transform my integral to fit the [-1,1] interval?

wide spear
#

How do you map the interval [-1,1] to [a,b]?

grave sluice
#

Well we have to use change the variables using the x= ( ( (b+a)+(b-a) ) xd ) /2

wide spear
#

Oh ok

grave sluice
#

apparently this is how we got this equation for finding x

wide spear
#

You just do a u sub

#

What about these two don't you understand

grave sluice
#

Well I understand that guass-quadrature is for polynomials, but i dont understand why is it only for the intervals of [-1,1]

wide spear
#

It isn't

#

You first define it for [-1,1] then use these transforms to define it on intervals [a,b]

grave sluice
#

Oh okay, so we transform the interval [-1,1] to our given polynomial integral interval [a,b]

#

but how do we transform the intervals from [-1,1] to [a,b]?

wide spear
#

?

grave sluice
#

Like for example here we are given a function from [0,0.8],
we are gonna integrate this function from [-1,1], and then we need to transform the interval [-1,1] to [a,b] right

wide spear
#

Yes

brave crypt
#

anyone know how to do this

wide spear
#

What part are you confused by

errant wagon
# brave crypt

You could just use vandermonde matrix for interpolation in part a)

brave crypt
wide spear
#

You can use whatever you want to find the interpolating quadratic

strange willow
wooden kiln
#
$$ f(u) = \frac{du}{dt} $$
$$ u_{i + s_1} = u_i + \Delta t \left( \frac{8}{15} f(u_i) \right) $$
$$ u_{i + s_2} = u_{i + s_1} + \Delta t \left(-\frac{17}{60} f(u_i) + \frac{5}{12} f(u_{i + s_1}) \right) $$
$$ u_{i + 1} = u_{i + s_2} + \Delta t \left(-\frac{5}{12} f(u_{i + s_1}) + \frac{3}{4} f(u_{i + s_2}) \right) $$
pine jettyBOT
#

jacobjivanov

wooden kiln
#

I need to expand this to be applicable to non-autonomous equations. Would the following Butcher Table represent it?

wide spear
#

No

wide spear
wooden kiln
wide spear
#

u_{i+1} should equal u_i + some stuff

wooden kiln
wide spear
#

Where is the 3rd order convergence line

wooden kiln
pine jettyBOT
#

jacobjivanov

wooden kiln
#

Probably something I should include. I guess I should say, I proved convergence, not necessarily 3rd order convergence

wooden kiln
wide spear
#

Plot 1/N^3

wooden kiln
#

The longer one with N going as high as 10^6 takes a minute or two to run so I just cut it off

wide spear
#

You also generally don't need so many data points

wooden kiln
wide spear
#

You can usually just take dt=0.1, 0.05, 0.025, 0.001, etc...

#

Yes

#

You can multiply by a constant to make your graph look nicer as well

wooden kiln
wooden kiln
#

But back to my original question, would this Butcher Table be representative of this Runga-Kutta method and work for non-autonomous equations?

wide spear
#

You can plot any constant/N^order

#

The RK scheme presented has no information about the c_i you would have along the left side of the table

#

Is there a reason you want to use this RK3 scheme

wooden kiln
pine jettyBOT
#

jacobjivanov

wooden kiln
#

This came from the Wikipedia page for Runga-Kutta methods, with the caveat that this is "neither sufficient, nor necessary for consistency", which is why I wanted to double check here.

#

I am using the RK method for an incompressible flow simulation for my research. Previously, my RK method relied on the fact that my equations, namely, the following, were autonomous.

#
Initially, our Vorticity-Evolution Equation is as follows:
$$ \frac{\partial \omega}{\partial t} = \nu \left( \frac{\partial^2 \omega}{\partial x^2} + \frac{\partial^2 \omega}{\partial y^2} \right) - \left( u \frac{\partial \omega}{\partial x} + v \frac{\partial \omega}{\partial y} \right)  $$
By using discrete spectral methods, i.e $\Omega_{\mathrm{pq}} = \mathrm{fft2}(\omega_{\mathrm{ij}})$, our equation becomes:$$ \frac{\partial \Omega_{\mathrm{pq}}}{\partial t} = \nu \left( \frac{\partial^2 \Omega_{\mathrm{pq}}}{\partial x^2} + \frac{\partial^2 \Omega_{\mathrm{pq}}}{\partial y^2} \right) - \mathrm{fft2}\left( u \frac{\partial \omega_{\mathrm{ij}}}{\partial x} + v \frac{\partial \omega_{\mathrm{ij}}}{\partial y} \right) $$By using an integrating factor $\mu_{\mathrm{pq}}(t) = \exp \Big[\nu \left(k_p^2 + k_q^2\right)t \Big]$, our equation becomes:$$\frac{\partial}{\partial t} \Big[ \mu_{\mathrm{pq} }(t) \Omega_{\mathrm{pq}} \Big] = - \underline{i} \mu_{\mathrm{pq}}(t) \Big[ k_p \cdot \mathrm{fft2}(u_{\mathrm{ij}} \omega_{\mathrm{ij}}) + k_q \cdot \mathrm{fft2}(v_{\mathrm{ij}} \omega_{\mathrm{ij}}) \Big]$$As a result, our time derivative $\Big[ \mu_{\mathrm{pq} }(t) \Omega_{\mathrm{pq}} \Big]_t$ is no longer autonomous. 
pine jettyBOT
#

jacobjivanov

wooden kiln
#

Unfortunately, I take a numerical/computational methods course next semester, so I'm kind of running blind, though my middle equation has been successfully integrated over time

#

Problem being it is slow

wide spear
#

Is it in python

wooden kiln
#

RK3 is the minimum required for stability

wide spear
#

You could totally do the normal RK4

wooden kiln
wooden kiln
wide spear
#

Is storage an issue?

#

Storage was much more of an issue in the past than it is now

wooden kiln
#

I'm not entirely sure yet, if I'm being honest

wide spear
#

It almost certainly is not

wooden kiln
#

But if I have 512x512 arrays for vorticity, x velocity, y velocity, streamfunction, various partial derivatives, ... etc, then why not?

wide spear
#

512x512 is not very much

wooden kiln
#

512x512 runs on my laptop. I have access to an HPC, but have not done anything with it yet

wide spear
#

That's actually quite small

#

Let's say you have 10 different 512x512 arrays of doubles

#

That's only 5 megabytes

wooden kiln
#

Hold up, I need to go. Do you mind if I ping you when I get back. No issue if you don't respond immediately.

wide spear
#

Ok

wooden kiln
wide spear
#

Ok that's still < 10 megabytes

#

I don't think you should be worried about memory

wooden kiln
#

But even if low-storage isn't necessarily a huge selling point, wouldn't the RK4 be more computationally expensive?

wide spear
#

Yes but it's also 4th order

#

RK4 is very popular

wooden kiln
#

What advantage would I get if RK3 is stable?

wide spear
#

Smaller error

wooden kiln
#

How much computationally expensive would you expect it to be?

#

4/3 * 100 %?

wide spear
#

Not necessarily, the intermediate steps are simpler as well

wide spear
#

If you look at the butcher tableau for RK4, it's diagonal

wooden kiln
#

I see. I'll try to get it to work.

#

Thanks for all your help

wooden kiln
fossil glade
#

Someone know a good treatment of generalized gauss quadrature? As in, finding a choice of points and weights that can exactly integrate functions with weight ($ \int^{1}_{-1} w(x)f(x) dx$)

upper hull
#

Im looking for a comprehensive guide of on how to apply either an rk4 method or adams-moulton 4th order predictor-corrector to a system of two ordinary differential equations, and if possible how to translate that to python?

wide spear
#

What are your conceptual questions?

upper hull
#

ig conceptually kinda ties into what i need help with implementing as well, when applying either of those methods to a series of odes, do you just apply them both separately and then just plot them both next to each other because thats kinda what some of these implementations have been doing more or less but i dont think thats right

brave crypt
pine jettyBOT
#

Sir John

wide spear
#

Why do you need to divide by u?

brave crypt
#

i need to somehow express the ghost value outside the domain to get the diffusion at boundary
when i apply this bc, the only ghost componend in discretization comes from the first derivative in advection term dV/dx using central difference, expressinng it divides by u, which can become zero at some point, due to flow in both directions

wide spear
#

You don't need a ghost value outside to compute the second derivative

brave crypt
#

keep scheme low order?

wide spear
#

You can use an asymmetric finite difference

brave crypt
#

im trying to keep it second

wide spear
#

There is an asymmetric finite difference of second order

brave crypt
#

you mean one-sided derivative backwards into the domain?

wide spear
#

Yes

brave crypt
#

it messes up my Mass matrix which normalizes the system and makes it symmetric

#

since my grid is non-uniform, hence L matrix is assymetric,
then i need to somehow normalize it, i multiply whole momentum by diagonal mass matrix M, which also normalizes the gradient operator for pressure, which has to be integer

#

it's a bit complicated, lemme show some typeset notes
this hat M together with inv(R) make laplacian symmetric and nice
also its inverse helps to express the gradient matrix in a nice form with integer coefficients

#

sorry for so much info 😦

brave crypt
#

example i used to construct Gradient from the above system

#

i think the workaround might be using uniform grid in the direction of the outlet, and only refine the grid in direction parallel to outlet, then i think using one-sided derivative could be an option

brave crypt
#

i checked the algebra, if i use one-sided then matrix becomes assymetric. maybe this can be a trade-off idk :\

tall solar
waxen hazel
#

I DONT UNDERSTAND QUSTION

wide spear
#

Do you know what the nonlinear finite difference method is

waxen hazel
tender lake
wide spear
#

I haven’t either lol

brave crypt
wide spear
#

Derivatives are linear though

brave crypt
#

maybe there is some strange non-linear apxmation? D:

wide spear
#

The derivative is the best linear approximation to a function

#

Just like

#

By definition

fathom rain
#

there is no such thing (as far as I know) and google only gives sporadic msc theses of people who just solve nonlinear systems discretized with fdm and newton

fathom rain
#

i downloaded the book, indeed it is just fdm + newton

left notch
#

Well today I have to finish my fft report and give a presentation on it

#

Hope it turns out OK 🫥

warped heath
#

Hello, for LU decomposition when we say

#

Solve linear systems Ax_i = e_i, (1 ≤ i ≤ 4) where e_i is the ith vector of the canonical basis of R4

#

What does that mean ? I certainly know how to do it, but I don't know how to formulate the question like this

warped heath
#

How is LU decomposition useful in this question?

wide spear
#

You use LU decomp to solve systems of linear equations

warped heath
#

But what is e_i and x_i here ?

wide spear
#

e_i is the vector composed of 0s with 1 in the i-th component

#

You solve for x_i

warped heath
#

like (.., ... , ..., ...)

#

?

wide spear
#

e_1 = (1, 0, 0, 0)

#

e_2 = (0, 1, 0, 0)

warped heath
#

The exercise does not require solving the linear system for 4 different vectors, that makes no sense

#

I do not understand what you are saying

#

It's like doing the LU decomposition for 4 different vectors in same exercise , what's the point?

warped heath
#

And

#

I have other question about an exercise

#

Discrete Laplacian matrix : How to show that det(A_n) = 1 for all n, here ?

#

And they say "Deduce, using the profile of the matrix A_n, the LU decomposition of An = L_n U_n.""

#

What do they mean by profile

fathom rain
fathom rain
fathom rain
visual dune
silk drum
silk drum
silk drum
warped heath
#

I don't understand how they got to the formula I highlighted in blue. Can someone explain to me please?

wide spear
#

Multiply the inequalities at the end of the previous line together, then rearrange

warped heath
#

ok thank you

warped heath
#

Hey

#

Numerical interpolation and integration : Calculate in two ways (by solving a linear system or integrating polynomials
of Lagrange interpolation) the weights α, β, γ of the following quadrature methods:

warped heath
#

I don't understand how to do for this exercise

#

can someone help me please?

cobalt sky
warped heath
#

but if you ask the question, I think you are not familiar with numerical interpolation/integration

cobalt sky
fathom rain
# warped heath can someone help me please?

for the first one set up the system and get the linear equation (since you have 2 nodes), extrapolate to x=0 and 1 and use trapezoidal rule? Once you have done that you will see that the solutions is rather obvious. For second one use a quadratic, and do the same but use simpsons

warped heath
#

But I don't understand how the ingral of t² dt is alpha / 16 + beta / 4 + 9theta/16

#

I don't understand how they determine the integrals

fathom rain
#

just evaluate t^2 for t=1/4 2/4 3/4

warped heath
#

2/4 ?

fathom rain
#

2/4=1/2

warped heath
#

I make three separate integrals with three values ​​of t different?

#

why do they add?

#

or t_0, t_1, and t_2

#

t = t_0 + t_1 + t_2 ?

fathom rain
#

f(t)=t^2 int(f(t))=alphaf(1/4)+betaf(1/2)+gammaf(3/4)

warped heath
#

ok I will do that, thank you

fathom rain
#

so it is just alpha(1/4)^2+beta(1/2)^2+gamma(3/4)^2

warped heath
#

Last question

#

For the Lagrange method

fathom rain
#

just setup the vandermonde matrix and solve the system

warped heath
#

He ask the order

#

of the method

#

They say that it is at least 1 for the system method and at least 2 for the Lagrange method

fathom rain
#

first one is 2nd order and the second one is 4th order

#

just like trapezoid and simpsons

warped heath
#

how do you see here that the method is of order 4?

#

please

fathom rain
#

it is just simpsons with slightly different coefficients and evaluation points

#

and simpsons is 4th order

warped heath
#

You can't know that just by calculating the values? Do you have to remember that this is the Simpson method?

fathom rain
#

i used another way to find the coefficients by using simpsons 🙂

#

you can derive the order the same way as you do with simpsosn

warped heath
#

I do not know how to do

fathom rain
#

i did: ```>> ceffs=[1 1/4 1/16;1 1/2 1/4; 1 3/4 9/16][f1;f2;f3]

ceffs =

3*f1 - 3*f2 + f3

16f2 - 10f1 - 6f3
8
f1 - 16f2 + 8f3```

#

and evaluated simpsons (so x=0, 1/2 and 1)

#

and tat gave the correct alpha, beta, gamma

#

(same as you)

warped heath
#

You use another method to determine alpha, beta, theta, this is not asking here

#

the questions are related and they ask us to deduce from what we did

fathom rain
#

h =

(8*f1 - 16*f2 + 8*f3)*x^2 + (16*f2 - 10*f1 - 6*f3)*x + 3*f1 - 3*f2 + f3

>> (subs(h,x,0)+4*f2+subs(h,x,1))/6

ans =

(2*f1)/3 - f2/3 + (2*f3)/3```
warped heath
#

bn I don't understand anything, I don't know that it represents all that, it doesn't help me to understand

#

no matter

#

thank you for your help for first question!

fathom rain
#

you have 3 data points, you have a quadratic equations approximating f(x), then you can do a standard way to show what order it is (will be like simpsons but some other constant term, worse than for simpsons)

warped heath
#

the course tell us :

#

We say that a quadrature formula has a degree of precision n if the formula is
exact for f(x) = x^k (0 ≤ k ≤ n), but not exact for f(x) = x^(n+1)

fathom rain
#

one usually say that trapezoidal rule is of "order" 2 since the error term is O(h^2) "degree of precision" is not the same thing

#

trapezoidal rule will exactly integrate f(x)=c0+c1x

warped heath
#

We have that with Lagrange method, we know the value of alpha, beta, theta. How to know the order?

fathom rain
#

and simpsons f(x)=x0+c1x+c2x^2

warped heath
#

simpson is Newton-cote method

#

Newton-cote for n= 2 is simpson

#

here we talk about Lagrange

fathom rain
#

you can derive one from the other assuming f(x) is quadratic in this case

warped heath
#

how do we derive this?

fathom rain
#

the error? google proof error bound quadrature rule

warped heath
#

no

#

not error

#

the order

fathom rain
#

the order of the method is given by the bound of the error

warped heath
#

so the difference between that :

#

and that :

fathom rain
#

if error is O(h^2) then the method is second order

warped heath
#

because the error here is I(f) − In(f)

fathom rain
#

but they maybe ask you for "degree of precision" and not the order. then it is 2 for the second one

#

since it will exactly approximate a quadratic equation f(x)

#

(by construction)

warped heath
#

I don't want the proof

#

but you didn't tell me that the error was that, I was able to find it

#

remains to understand how to use it

#

in this case

pine jettyBOT
#

Claymore

wide spear
#

You will probably get better answers in the physics server, linked in #old-network

warped heath
#

Quadrature method using derivative_

#

Let f ∈ C^1([0, 1]). We consider the elementary quadrature formula:

#

where ξ ∈ [0, 1] and w0, w1, w2 are real numbers. We pose

#

Questions

#
  1. Determine the parameters ξ, w0, w1, w2 so that the quadrature formula is exact if f is a polynomial of degree less than or equal to 3
#

-> It's done. no problem

#
  1. The parameters ξ, w0, w1, w2 being thus fixed, calculate E(x → x^4) and deduce the order of the method
#

We deduce the order of the method

#

E(x -> x^4) = 1/30 which is not equal to 0 so the method is of order at most 3.

#

My Question

#

Why did finding something different from 0 mean that the method is at most of order 3?

#

Where does this 0 come from, what is the comparison with?

wide spear
wide spear
#

So you compare the exact value with the approximated value

#

And want that to be 0

warped heath
#

yes but the exact value and the approximated value, is not 0

#

I don't have a 0 in either

#

I followed the chatgpt method but gives me nonsense

#

this annoys me

wide spear
warped heath
#

ok thank you

#

If I am given the following Butcher tables, how do I determine the writing of the Runge-Kutta scheme ?

warped heath
#

I will take the example of the first

#

On the internet I see they say :

#

I found (in my case I consider x_n = t_n) :

#

k_1 = hf ( t_n + h/4 , y_n + k_1 / 4)

#

k_2 = hf (t_n + 3h/4 , y_n + k_1 / 2 + k_2 / 4)

#

y_(n+1) = y_n + 1/2 (k_1 + k_2)

#

I compare that to what they find in the solution to my correction:

#

It's completely different..........

bright palm
#

@warped heath what would be easiest or most helpful here

#

i wonder if we should just start from your table and work forward

warped heath
#

I have already done everything, I followed the theoretical formulas

#

I don't find the same thing as in my correction

bright palm
#

are you certain they are different and not just a slightly different way of writing the same thing

#

i guess yea

#

i really think its easiest to just start over

warped heath
#

if not, even if I start again I will not write different lines

bright palm
#

im going to have to do it myself to figure out if yours is wrong im too dumb to look at it and spot the error between the table and 2 different answers

#

so if im gonna do it we might as well both do it

bright palm
# warped heath

unless its helpful to you if i disappear for 10 minutes then come back and say i got the answer here

warped heath
#

As you wish

bright palm
#

im just gonna do it brb

warped heath
#

I have the impression that my K1 and my K2 and their K1 and their K2 are different formulas...

#

for K2 they have two f(....)

#

in this formula, only one f

bright palm
#

i think thinkies

warped heath
#

well I don't understand where the differences come from, why and how to find the same results

#

maybe @wide spear if you know

warped heath
#

damn it makes me sad it makes me waste so much time on my revisions...

wooden kiln
#

Which message should I reply to?

warped heath
wooden kiln
#

For this table, your equation is going to be as follows:

#

Well actually this Butcher Table isn't correct

#

Either you need an additional row of zeros on top and right edge, or it doesn't make sense

warped heath
#

Ok that's good I understood how they did it

warped heath
bright pawn
#

So I calculated the relative condition number of $\frac{x^4}{x^2-1}-x^2$
for $\x > 1$

pine jettyBOT
#

adonhs

bright pawn
#

which is $k_{rel} = \frac{2}{x^2-1}$ and also calculated when it's bad/good conditioned.

So it's good conditioned for $k_{rel} < 1$ so i got $x \geq $\sqrt{3}$ and othwise $1<x<\sqrt{3}$ but looking at the graph it kinda doesn't make sense to me how it's good conditioned for $x \geq \sqrt{3}$ than for $1<x<\sqrt{3}$ as the functions are more close for $1<x<\sqrt{3}$

pine jettyBOT
#

adonhs
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)

warped heath
#

** ~ ~ ~ TAYLOR-TYPE SCHEMES ~ ~ ~**

#

We propose to study the following new scheme (called Mixed Runge-Kutta Taylor)

#

Question 1 : Show that G_3(t, y, h) = T_3(t, y, h) + o(h^3) where T3 is the function associated with a Taylor scheme of order 3 (yn+1 = yn + hT_3(tn, yn, h))

#

Answer

#

Let's apply Taylor's formula to f 1(t + h / 3, y + h / 3 f (t, y)):

#

-> What I don't understand is why in the penultimate line we do the Taylor expansion up to order 2 and not up to order 3 and I don't understand how they go from order 2 to order 3 as in magic?

#

**Question 2 : Under good assumptions about f, show that the Mixed Runge-Kutta scheme Taylor is stable. What is its order of convergence ? **

#

Answer

#

-> Here I don't understand how by making the difference how they find this, I have the impression that some steps are missing... I don't see where this result comes from

warped heath
#

Not many people on this channel 😦

tender lake
vapid plume
#

@warped heath h/2 is being multiplied with f^1 (t + h/3, y + h/3 f(t,y)), so after expansion of f^1 (t + h/3, y + h/3 f(t,y)) upto O(h^2), multiplication by h/2 gives O(h^3)

safe hill
#

help me with 3a) ...

i can't understand what they are trying to say via that "Hints"

warped heath
#

Hey Sorry

#

I've been at this for several days, I don't understand

#

Gauss-Legendre quadrature method

#

Question 1 : Show that there exist unique reals α, β and γ (and explain them) such as the method quadrature is exact for polynomials of degree ≤ 2

#

For this question, no difficulty, I answered. We have α = β = 5/9 and γ = 8/9

#

Question 2 : Show that this quadrature method is in fact exact for polynomials until degree 5. We can carry out a Euclidean division by the polynomial 5X^3 −
3X and calculate ∫ (5x^3 - 3x) x^j dx from -1 to 1 for j ∈ {0, 1, 2}.

#

For this question, no problem here too. We see that ∫ (5x^3 − 3x)P(x)dx = 0 from - 1 to 1 for any polynomial P of degree ≤ 2

#

Let Π be a polynomial of degree ≤ 5. By performing a Euclidean division, we can write : Π = (5X^3 − 3X) × P + R where P and R are polynomials of degree ≤ 2. We then have

#

(Q = R here, is the same) Moreover :

#

But, J((5x^3 − 3x)P) = 0, because the polynomial 5X^3 − 3X cancel at the three points 0 and ± sqrt(3/5), and J(Q) = ∫ Q(x)dx from - 1 to 1 because Q is of degree ≤ 2. We finally have

#

-> This last result I understand a little less but it doesn't matter

#

Question 3: **Using a Taylor formula, show that there exists a constant C > 0 such that if f is of class C^6 then **

#

Here several things I don't understand in the correction, already in the development of the Taylor formula, I am not familiar with the last term "sup". I saw in Taylor's formulation with integral remainder and it's not written like that, so I'm a little difficult to understand. And I don't understand why K(x) ?? What is that ..

#

Second thing I don't understand, why it is lower than these terms. Where does this expression of J(R) come from, where does this expression of the integral of R(x)

#

Question 4 : ** Give a quadrature formula J[a,b] derived from J allowing us to approximate ∫ f(x) dx from a to b and show **

#

here the answer, the last line I don't understand also

tender lake
# warped heath Here several things I don't understand in the correction, already in the develop...

Sup stands for supremum, which is generally introduced in real analysis. https://en.m.wikipedia.org/wiki/Infimum_and_supremum#:~:text=The supremum (abbreviated%20sup%3B%20plural

In mathematics, the infimum (abbreviated inf; plural infima) of a subset

    S
  

{\displaystyle S}

of a partially ordered set

    P
  

{\displaystyle P}

is the greatest element in

    P
  

{\displaystyle P}

that is less than or equal to e...

warped heath
#

?

#

I know what sup means

tender lake
warped heath
#

I said that its presence in Taylor's formula is not familiar to me

#

but I understand this point, now

#

All I need is to understand the other 4... 😒

alpine vapor
#

anyone familiar to SDE?

#

stochastics differentiel equation

wide spear
#

What is your question?

warped heath
#

I want to build a Butcher table with this scheme. The correction says that:

#

intermediate states:

#

intermediate times:

#

I need to understand, the coefficients in bold, why in y{n, 2} there are 1/2 before f (t( {n,1}, y{n,1}) and not 0 and we can put 1/2 before f (t( {n,2}, y{n,2}) ? Why in this order ?

tender lake
#

$y_{n,2}$ is the y value plugged into the recursion you sent first

pine jettyBOT
#

Xenophon

tender lake
#

You can see that it's being estimated by a Euler step with h/2

tender lake
#

i.e. $y_{n+1}=y_{n, 1}+hf(t_{n,2}, y_{n, 2})$

pine jettyBOT
#

Xenophon

tender lake
pine jettyBOT
#

Xenophon

tender lake
#

It would be an implicit method, for one

warped heath
warped heath
#

you did not understand the exercise and the solution they give

pine jettyBOT
warped heath
#

andfrom this last line b_1 = 0 , b_2 = 1 which gives the formula

#

Anyway, these are numerical methods, It's a bit boring to explain, these are methods to follow that you need to know

#

I renew my request, since the question has not been answered

#

I want to build a Butcher table with this scheme y_{n+1} up. The correction says that:
intermediate states:

#

intermediate times:

#

I need to understand, the coefficients in bold, why in y{n, 2} there are 1/2 before f (t( {n,1}, y{n,1}) and not 0 and we can put 1/2 before f (t( {n,2}, y{n,2}) ? Why in this order ?

tender lake
#

The recursive update you sent first is the explicit midpoint method

#

Here's the butcher tableau

tender lake
tender lake
#

Everything you've sent is just the midpoint method with nothing really confusing about it

tender lake
# warped heath

These coefficients in bold are the entries of your A matrix

tender lake
tender lake
tender lake
tender lake
pine jettyBOT
#

Xenophon

tender lake
#

But you can see that this equation involves $y_{n,2}$ on both sides. This would be a implicit RK method, and you would have to solve for $y_{n,2}$.

pine jettyBOT
#

Xenophon

tender lake
#

It would just be a different tableau

#

@warped heath

warped heath
# tender lake This is literally the equation I sent you

This is not the equation you sent because you wrote that in the $y_{n+1}$, the fact that there was $y_{n}$ came from $y_{n,1}$ when it is literally false. Besides, that's not even the question I'm asking.
I appreciate your willingness to want to help me, but if you don't know something, I prefer to wait and even not having an answer, it doesn't matter

pine jettyBOT
pine jettyBOT
#

Xenophon

tender lake
warped heath
#

This is false

tender lake
warped heath
#

I'll explain to you why

tender lake
#

They are the same

warped heath
#

It's just luck, because in this case y_{n,1} = y_{n}, and you cooked the thing, but that's not why we found this result, I'll explain to you why

tender lake
#

It's not luck

warped heath
#

...

tender lake
#

I knew that one of the intermediate states was y_n

warped heath
#

This is the expression of y_{n+1}

tender lake
#

Yes, that's the general equation

warped heath
#

Not that

tender lake
#

That's specific to your question

#

Do you see how my equation comes from the butcher tableau for the midpoint method?

#

I do understand dude.

tender lake
#

But you're asking for help and being combative. You haven't actually asked a question

#

Just a vague sense of confusion about the coefficients

warped heath
#

But it's not confusing, the equation that is written there is false, and what's more, it's not even my question and with this discussion we drown out my questions and I will still be left with an unanswered question because the others will not see the statement

tender lake
#

It is not false. It is the same recursion relation that you said you wanted to reproduce

#

You haven't actually asked a coherent question in english

tender lake
#

It's all by definition

warped heath
#

I will explain more simply, the y_{n} that you see outside the function f(...) is not y_{n,1} if you assume the opposite it is because you are pretending to understand

#

and here is what you write

tender lake
#

What is $y_{n,1}$ in terms of $y_n$ then?

pine jettyBOT
#

Xenophon

warped heath
#

I will explain a second simpler thing

#

I took a completely random example from a website, you see there is a y_n here too

#

and is not kn1

tender lake
#

Yeah? and? I wasn't making a general claim

#

In your case, in this method, $y_n=y_{n,1}$

pine jettyBOT
#

Xenophon

tender lake
#

That may have been confusing to you, but it's not false

warped heath
#

I give up

tender lake
#

I have read that website, btw, and those k values are not equivalent to the intermediate y values you are using in any context

tender lake
# warped heath

I'll try one more time with this. I simply used the fact from the first equation here that $y_{n,1}=y_n+h*0=y_n$ and put the recurrence relation in terms of the intermediate values. If that's confusing, don't worry about it

pine jettyBOT
#

Xenophon

tender lake
#

Since they are equal in this case, you can just as easily use y_n

warped heath
#

I found another very good example

fathom rain
warped heath
#

In this example, y_{n,1} is not = y_{n}

#

and you find the term y_{n} in y_{n+1}. The formula you give y_{ n+1} = y_{n,1} + h..... is not true. Yes y_{n,1} = y_{n} in the case of my exercise, but pure "luck" because let's admit that y_{n,1} is equal to another value, well we wouldn't write y_{n+1} = another value + h .... we would always write y_{n+1} = y_{n} + h... It is not because y{n,1} = y_{n] that we write y_{n+1} = y_{n} + h....

#

This is exactly what I'm trying to explain, but apparently I'm the one talking nonsense

tender lake
#

Yes, because in this example the butcher tableau is different

#

It's not really important for the method you started with because, as I've said, they happen to be the same.

tender lake
#

And y_{n,1} is not the same as y_n. It would have been more conventional to use the standard notation, and I'm sorry for causing confusion

#

But it's not a big deal

amber slate
#

This kinda looks like TSP (right?).
In this problem, 1 and 20 are hospitals. Each green node is a city.
I was asked to find the shortest route possible for each hospital to each city, and also back.

For example, if I'm an ambulance guy in hospital 1 and I want to take patients from city 2, I'd go from hospital 1 - city 2 - hospital 1, using the same route twice, since that's the shortest route possible for this case (not hospital 1 - city 2 - city 3 - hospital 1).

How do I approach this problem?

(Note that if a route from hospital 1 to an arbitrary city and back to hospital 1, if and only if hospital 20 is in the route back to the hospital 1, the patients are put in hospital 20 instead of hospital 1)

cloud cobalt
#

You could compute the minimum distance from each hospital to each node using the directly connected nodes first, then the ones connected to those nodes, etc. The problem also appears to be symmetric (return route same as route out) since the edges appear to bidirectional

full hull
#

is it okay if I post a quick question in here?

#

can't seem to get help in the help section

full hull
#

I have a problem iterating this

#

since f(xL).f(xM) = 0 and that means I should stop the iterations

wide spear
#

Do you know the error bound for the bisection method

full hull
#

error bound?

wide spear
#

Yes

full hull
#

what's that

jolly snow
#

Are these the same thing? I'll be studying scientific computing next year (computer science major), I was thinking about taking numerical analysis as an elective as I want to study data science & AI next. But I'm not sure if the two courses are on the same topics or not.
SCIENTIFIC COMPUTING
Machine numbers and arithmetic, error analysis. Nonlinear equations. Review of linear algebra: norms of vectors and matrices, scalar product. Solving linear systems of equations with direct methods. Approximation of data and functions: polynomial, piecewise polynomial, trigonometric and FFT interpolation, spline functions; Parametric splines and Bezier curves and B-splines. Solution of overdetermined linear systems and least squares: the normal equations, the QR method and the SVD singular value decomposition. Some applications of SVD.
**
NUMERICAL ANALYSIS**
Analysis of errors in computational processes: inherent and algorithmic error, conditioning of computational problems, machine numbers and operations, algorithmic error analysis, forward stable, backward stable, unstable algorithms.
Numerical linear algebra: vector and matrix norms, matrix calculus.
Notable algorithms for solving linear systems. Remarkable matrix factorizations. Spectral and singular value decomposition. Iterative methods based on stationary linear iterations. Least squares problems.
Numerical resolution of nonlinear equations and systems.

silk drum
#

Numerical Analysis is not the same thing as Scientific Computing. I can see the confusion as the descriptions suggest a lot of overlap. Typically, I expect to see more scientific applications mentioned in Scientific Computing.

jolly snow
#

because if they're just slightly different, i could just study the extra stuff on my own

fathom rain
silk drum
# jolly snow do you think it's worth to take as an elective or should i pick something else s...

Generally speaking, I would recommend to direct your learning according to the topics you are interested in (because you will find success easier in topics you like) and considering the lecturers teaching the modules (as you will learn more easily from a person who teaches in a way suited to you as an individual, and you may be able to collaborate professionally on projects in the future).

I also agree it's useful to have in mind what you may do in the future, although some people don't have a good idea of that at certain points of their life and career (indeed, it's good to reflect and reevaluate at all stages and ages).

If you end up liking both topics, it's fine to do both. If you find too much overlap and redundancy, it's also fine to drop the one you find less useful overall.

jolly snow
# fathom rain what is your end goal. a phd and more theory or go into industry?

Well, i'm still just in my first year of my bachelor so i don't really know. I think I'd like to get a masters in AI & Data Science as I love math and they involve much of it compared to other career paths such as software engineering. I've read on the internet that useful topics to study for Machine Learning are Probability, Statistics, Analysis I, Diff Eq, Linear Algebra, Graph Theory, Num Analysis, and Optimization. All of these except the last two are already in my program curriculum, and I can choose up to two courses for a max of 12 credits from other degrees to do as electives. I was thinking about numerical analysis (6 credits) and optimization (6 credits) but I'm not sure. Analysis II and Abstract Algebra also seem interesting but they're both 12 credits each so I can only choose one of them

#

I think in the future I will study all of these for pleasure on my own anyway but right now I want to optimize my chances to enroll at a good masters program and know the math that is required

pearl canopy
#

if you're in your first year, you have way too much time to be worried about this imo... go meet with the two profs and see which one you like more (for scicomp and numanal). aside from the least squares stuff, most of the material covered from those two classes aren't used by the majority of data sci/ml people. both will help with mathematical/programming maturity and 'applied' problem solving though, which is great

jolly snow
jolly snow
pearl canopy
#

great, so you can go talk to your profs next time you're in the department. and i could just regurgitate the standard "calc, LA, stats", but then i feel you'd only take those classes. you should take any modeling/scicomp/opimization classes offered throughout your ug, in addition to that calc/LA/stats core

#

also, it depends on whether you want to be in a more research heavy job or not. the more researchy the role, the more mathematical foundation you need

jolly snow
#

All I know is that I like math and I like studying so I wanna continue my studies, and do atleast a masters. I don't wanna end my bachelor and go do a generic software engineer job

willow trellis
#

I have a problem to deal with:

Given constant $s$, $N+1$ interpolation points (I'm not quite familiar with the English terms) $(t_j,y_j),j=0,1,\cdots,N$ with $t_j=\frac{j}{N}$, $0=y_0<\cdots<y_N=s$, and $y_{j+1}-y_j<K/N$, I need to find a $C^5$ (smooth if possible) function $f:[0,1]\to[0,s]$, with boundary condition $f^{(m)}(0)=f^{(m)}(1),m=1,2,3,4,5$, while also satisfying the data points above, and has its first five orders of derivatives bounded by a constant independent of $N$.

pine jettyBOT
#

CollinGao-Original

willow trellis
#

K is another constant btw

willow trellis
#

ignore this problem, i proved the converse

full hull
#

okay just a quick something, when i'm using the bisection method, I index the iterations right? I write the iteration number in the table I'm doing, well I've seen some people start with the iteration indexed 1, while I start with the iteration indexed 0, because in my head I'm thinking that I already have the initial values and since I'm using the bisection method I'm already gonna be doing at least one iteration so the initial should be 0, but then a friend of mine said well we're searching for the root, which can turn out to be found through the initial values if f(xM) = 0 so it would make sense to start from index 1, so I'm here to ask about which index I should start with

tender lake
full hull
#

yes thank you very much

wooden kiln
#

If anyone could point me to a basic example of an Exponential Integrator that "only requires evaluating your integrating factor and related functions at times on the order of the integration step size", I would greatly appreciate it.

spiral spoke
#

ould someone please help me understand how to do the following questions? thanks

#

I understand a, however b and c are confusing me

lilac crane
#

what is confusing you about them

spiral spoke
#

i think i understand a bit better, however t he following question is confusing me

#

what does it mean by the "true values"

lilac crane
#

the values

#

as opposed to approximations of the values

brave crypt
#

Does someone study computer science and has survived numerical from the first time?

#

because it's really difficult

amber slate
#

Idk if this is more physics than math but,
Suppose I did an experiment where I measured current in response to voltage changes.
I now have the values for the current and their uncertainties (different for each point), and also the voltage (neglectable uncertainty). I used a linear regression. How do the uncertainties of the current propagate to the slope and the intercept estimates?

tender lake
#

Page 13 is the most relevant to your question

#

This is more of a statistics question than numerical analysis though

#

Explicit formulas for the errors in the intercept and slope are given in equations 6.61 and 6.62

amber slate
#

Thank you!
You're right, I should have asked in a different channel. But thanks~

wide spear
#

What answer did you get

#

How did you get it

safe hill
#

correct me and tell me how to proceed forward .

fluid sedge
#

helpers ping is not meant for use outside of help channels

vapid heart
#

elementary questions are intended for the help channels
The advanced channels are intended for high undergraduate and graduate level material, not pre-uni stuff that may happen to have a similar name
(This is not meant to be rude btw, just indicating that this isn't quite intended for it and isn't where you'll get an answer quickly)

visual shell
safe hill
humble mountain
#

A quick question, does gauss seidel method require the system of linear equations be always diagonally dominant?

plucky kayak
#

this is when you can guarantee convergence

humble mountain
#

Ok

dusk ivy
#

Ah, this place is not for programming side of things, right

#

Like optimizing a mathematical computation

strange linden
#

Hi i have a question regarding the finite element method

We have the theorem that says error is bounded by h^2. I'm testing my own implementation on the Poisson equation in 2D using the error measure
E=max |u_hat-u(x,y)|

i.e im just taking the difference in my nodes

this gives a proper convergence factor of 2 for the case of the function u=x^2y^2, however for u=x^3-x^2*y+y^2-1

i get very small error no matter the size of h
can someone help explain why this happens?

tender lake
silk drum
# strange linden Hi i have a question regarding the finite element method We have the theorem th...

The explanation would depend on how you have discretized your domain, the elements you have selected, the nature of the solution, and how the error is calculated.

You've specified the max of the error is low for the nodes but it might be very bad everywhere else and using other ways of evaluating the error (e.g. involving integrals).

It sounds like the chosen elements are able to interpolate the true solution well at the chosen nodes but this might not be true for all node distributions, all elements used, or all error measurements.

The derivatives of the solution might also compare badly to the derivatives of the true solution.

#

Off the top of my head, I think the error bounds should specify the general behaviour as h varies but may not explicitly indicate what the constant of proportionality is, so the error should be looked at with regards to how it varies with h, and absolute values of the error measure are less important.

strange linden
#

Yeah my thought was also that it just interpolates well in my nodes and that there’s a large error somewhere else. The exact reason is probably too specific for a discord chat. Thank you for the help

ornate wharf
#

in the finite element method, can you extrapolate from known values to reduce error?

#

i.e, if you know 2 "answers" for a first order finite difference approach (in calculating a differential, for seperate spacings) or 3 "answers" for a second order approach, can you then fit a linear or quadratic curve and use it to extrapolate to a more accurate answer?

fathom rain
#

richardson extrapolation

ornate wharf
#

oh perfect, thanks a lot

minor mural
#

How is asymptotic growth about trigonometric functions viewed

#

Isn’t by definition of theta sin x in theta(cos x)?

heavy briar
#

Hello

#

Can I ask my question here?

#

About simpson's 3/8 rule

#

The general formula

#

Can somebody explain to me how to use the general formula of simpson's 3/8 in a simple way? Like why did we put y3 there and why the rest there....

heavy briar
#

Thank you this explains everything

frosty vale
#

Is it bad if your lecturer in numerical methods has not heard of the book on numerical analysis by burden & faires

fathom rain
#

Seems to be published by 2 unknown people from an unknown university by an unknown publisher, so I would answer no?

frosty vale
#

Oh. I thought that was the standard and most recognized text on the subject

fathom rain
#

there are many introductory books in numerical analysis/scientific computing. I used heath when I studied my first course myself, now when I teach I do not use any book (but recommend a couple for people who are interested, doesn't really matter which, then all cover pretty much the same stuff)

frosty vale
#

I see. I’m really looking for a numerical analysis book that is rigorous and does not skip out on the theory

fathom rain
#

then focus on some subset 🙂 what are you interested in? PDE ODE Approximation?

frosty vale
#

I don’t have any particular field of interest. And I think, I need to study more analysis first, before heading too much into PDE and ODE theory

fathom rain
#

I don't there exist any rigorous book covering everything 🙂

#

Like if you want to solve PDEs numerically you realy need to choose the problem and appropriate method and study that

frosty vale
#

I see alright. Thanks for your insight 🙏

potent canyon
#

Hello community, I'm trying to compute the discrete laplacian (upside down triangle squared symbol) for each cell of my 2d array, but I'm seeing two kinds of kernels (to use as convolution filters on the image). Could you please give me some guidance?

  1. not sure if this is correct, but people are using it
    0.05 0.2 0.05
    0.2 -1 0.2
    0.05 0.2 0.05
  2. from wikipedia
    0.25 0.5 0.25
    0.5 -3 0.5
    0.25 0.5 0.25
#

There seem to be multiple versions of this 9-point stencil (if I'm using the right name), and I'm not sure which one is the best

#

I'm trying to make calculations with lots of matrix powering and multiplying, so I need the values to not suddenly go super big

cobalt sky
potent canyon
rich flax
#

Why after 5.998 value directly shoots above 6?

vernal narwhal
#

what technique would someone use to numerically integrate a function such as 1/sqrt(x) (sorry if this question isn't correct for this channel)?

#

from 0 to 1

#

$\int_0^1 \frac{1}{\sqrt{x}}dx$

pine jettyBOT
#

Brandon7716

vernal narwhal
#

or more generally computing integrals for a function such that 1/x^p, 0<p<1

#

guess i was just curious how numerical integration techniques for improper integrals

plucky kayak
rigid linden
cosmic karma
ancient berry
#

Order of convergence of Newton rapshon method when zero is not simple ??

grave spoke
dusk meadow
#

I am performing riemannian gradient descent, which involves having to invert positive-definite matrices each iteration. The one's i'm dealing with are of the order 100x100, sometimes larger. Could someone direct me towards any algorithms made for inverting large PD matrices?

cosmic karma
#

by inverting do you mean you’re solving some linear system?

dusk meadow
#

Inverting the coordinate matrix of the Riemannian metric at a point.

#

I.e. computing g^{ij}.

cosmic karma
#

I’m not familiar with Riemannian gradient descent. Maybe I can give a better advice if I know ow how exactly the inverse plays out in the algorithm but with PD matrix, you can use LU factorization and then multiply the inverses of the factors which would be n^3 + n^2 complexity, or use Gauss-Seidel which is also n^3 flops. If the matrix is spd, Cholesky would be best.

dusk meadow
#

So, every point x in the domain is mapped smoothly to a PD matrix G(x). In each step of RGD, you have to invert G(x). However, in my case, G(x) is a pretty large matrix.

plucky kayak
#

if the algorithm doesn't use the inverse matrix itself, but merely a matrix-vector product, then it's more efficient to solve linear system than explicitly invert the matrix

cosmic karma