#numerical-analysis

1 messages · Page 20 of 1

glad mantle
#

@wide spear wait sorry, I think we went on a different track from before, if we have that the limit of a sequence of triangular matrices is triangular then why are we not done by:
(LPL')_n = L_n P_n L'_n -> L_{inf} P_{inf} L'_{inf}

#

maybe what you brought up before with the condition number is why? you're thinking these triangular matrices explode in the limit?

wide spear
#

Do these limits exist?

#

Ah are you going to read Grigoriev 1981

glad mantle
#

however, I found another ref, which pointed me to a second ref of his published at a later date hype

wide spear
#

This?

glad mantle
#

oh wow

#

where did you find that

wide spear
#

I googled "Grigoriev 1981"

#

And then found it

glad mantle
#

lol I searched the title of what they gave in the ref

wide spear
#

I see 3 pages

glad mantle
# glad mantle

tfw it seems like it's basically just gaussian elimination with more words lmao

wide spear
#

Yes

#

Bruhat is Gaussian elimination with more words

glad mantle
#

literally tfw

wide spear
glad mantle
#

how's TwT and BwB

brave crypt
#

@short sky can you pin this?

glad mantle
#

the closure of TwT is the $\bigcup_{w \leq w}$

wide spear
#

oWo

pine jettyBOT
#

davidW

brave crypt
glad mantle
#

this is central wUw theory

wide spear
#

$\hat{\cdot}\overline{TwT}\hat{\cdot}=\bigcup_{Ow\leq wO}TwT'$

pine jettyBOT
#

Angetenar

glad mantle
#

@wide spear this proof is somehow even worse than the one in the second paper of his I posted above

wide spear
#

Rawr X3

glad mantle
#

it's literally gaussian elimination but with more cases

wide spear
#

Society has progressed past the need for abstract algebra

glad mantle
#

@wide spear do you understand what this partial order is

wide spear
#

No

#

Don't ask me about algebra

glad mantle
#

same

cosmic karma
#

How do I prove this? T_n is the n-degree chebyshev polynomial.

wide spear
#

Hmmmm

#

Does it work if you take the projection of x^n onto P_{n-1}?

#

Where the basis is given by the Chebyshev polynomials

cosmic karma
#

oh yeah i will try that. and since it's the orthogonal projection, it's the best approximation, right?

wide spear
#

Yeah something like that

cosmic karma
#

Thanks. I will try that

wide spear
#

"My question really would be then if I know how much the total of my heavy side function should be, is there a way to know how much I should inject? For example the total amount should be 25 ug/l after 50 seconds of injection. Is it just dividing the 25 by the 50 seconds? How can I proof this? Sorry if it’s a bit confusing..."

#

So if you want a concentration of 25 ug/l after 50 seconds

wide spear
#

You should calculate 25 mug/l*total volume/50 seconds

#

Right?

#

Assuming that the injected thing has no volume

vapid shore
#

yes

wide spear
#

Ok so that's how you can calculate the coefficient on the Heaviside function

vapid shore
#

the thing is I don't really have volume

#

I only have discharge on the mixing I guess I could find it from there

fleet sail
#

ok composite simpson for integral and stuff like splines for interpolation seem to be pretty useful

#

but when ppl use newton method do they just spam points

#

because basically for real life situation u have no guarantee of convergence

wide spear
#

Which newton's method

#

There are 50 of them

fleet sail
#

root finding

wide spear
#

Ah

#

There are many modern root finding algorithms

#

Newton's root finding algorithm is not used in practice

#

But it's a useful starting point

sage dew
#

in question b, i don't understand how to get started

#

i'm just beginning to do these types of problems

wide spear
#

What is norm{Ftilde-F}?

prime kraken
#

if it's the induced 2-norm on the matrix, it should be the largest singular value of \tilde{F} - F

wide spear
#

Well that's true

#

That isn't useful here though

prime kraken
#

is it not? since F and \tilde{F} are both of the form I - rank-1-matrix, if you subtract them, you get the difference of two rank-1 matrices

#

that is, at most, rank 2

#

so there are only 1 or 2 singular values to worry about, both functions of the outer product of a vector

#

that second singular value that shows up is precisely this perturbation on A they mention

wide spear
#

Hmmmm

#

Oh yes that is true

prime kraken
#

i'll have to leave it at that hand-wavy level, but my impression is that that would be a plausible way to go about it

wide spear
#

Yes

#

The way I had in mind was much more bash-y

#

No IQ

#

Only bash

sage dew
#

I'm so confused

#

i've learnt about stability a bit and yes i know linear algebra but i haven't studied about stability of operations involving matrices because that hasn't been taught yet

#

i'm referring to trefethen and bau, but is there any better/equivalent source to study it?

wide spear
#

I've heard good things about Trefethen but if you don't like it you can also check out Demmel's Linear Algebra, published by SIAM

sage dew
#

trefethen is a really good book, but i've read the suggested parts and still can't solve it hence :/

wide spear
#

Well checking out Demmel won't hurt

sage dew
#

yes, i will check it out, thank you!

balmy grotto
#

How would I incorporate maximal grad descent into mathematica

#

i managed to calculate the first iterate but its lookin like im gonna need to keep iterating to get g(0,0)=0

wide spear
#

What makes gradient descent maximal?

#

Has an implementation

balmy grotto
#

maximal as in we get to pick t the distance we move each iteration

wide spear
#

Ah ok

balmy grotto
#

I seen this stack post and to be frank

#

im lost

wide spear
#

The first answer in the linked post discusses this with variable step sizes

balmy grotto
#

Yeah i get that

#

i just dont wanna take something I dont understand how to use, ya feel

wide spear
#

I mean, can you figure out the code?

brave crypt
#

Reading mathematica code makes me sad, probably because I never read it

wide spear
fleet sail
#

how do they derive this

#

error term

wide spear
#

Looks like Taylor's theorem for an explicit form of the remainder of a Taylor series

fleet sail
#

wait so can you elaborate, all I can think of is taylor expanding f(x) = L_n(x)+R(x) at some point x in [a,b], and somehow showing R(x) is that junk

#

also i will check out ur talk XD

wide spear
#

Yeah something like that

fleet sail
#

still dont quite see it

#

ncm found proof from wiki

wide spear
brave crypt
#

I was having a hard time getting my queries to run on a dataset at work, I cranked up my cluster size to preprocess my data into something nicer, now things are running faster. Feelsgoodman

brave crypt
#

Out of curiosity, @wide spear , how free are you to use compute resources in a university (I guess it depends on the research group you are in or something)?

wide spear
#

So my uni has a few supercomputers

#

But you need to request an allocation at the beginning of the year

#

Once you have an allocation you can do whatever you want with it

#

Research groups usually get big allocations

random hornet
hollow ingot
#

mine bitcoin

wide spear
#

Also some research groups have their own clusters

#

Ah, faculty get 300k core-hours/year for free without needing to request anything

random hornet
#

What does 300k core-hours mean?

wide spear
#

1 core-hour is you get to use one compute core for one hour

random hornet
#

And how many cores does the supercomputer at your uni have?

wide spear
#

"As of April 2020, the system consists of 600 compute nodes in various configurations to support a wide diversity of research applications, with a total of over 15,300 cores and a peak performance of 540 teraFLOPS (CPU) and 1 petaFLOPS (GPU), and offers approximately 3.0 Petabytes of high-speed parallel storage."

brave crypt
#

what if a faculty member used their core-hours for mining bitcoin

random hornet
#

I guess they do keep a track of activities being undertaken, no?

brave crypt
#

lol

#

i mean what would happen

#

to that faculty member

wide spear
#

They would probably not get their allocation renewed

prime kraken
#

this is why tenure is important

hollow ingot
#

just say you're doing research on crypto

wide spear
#

There are faculty who do crypto research

#

They have far more important things to do than mine bitcoin

hollow ingot
#

what if your research is how to optimally mine bitcoin

wide spear
#

Closed problem

hollow ingot
#

😢

wide spear
#

@brave crypt can you provide some more details about the problem

brave crypt
wide spear
#

Yeah

#

For example, how large is a coffee ground?

#

How nicely mixed?

#

How much force goes into a shake?

#

What is the shape of the container?

brave crypt
#

Here is a pic of the grounds, normal on the left and decaf on the right. So something like on the order of 1mm.

I think this problem is about mixing, let's say I want mu(B cap T^k A) to be within mu(B)mu(A) epsilon, additively, or maybe 1+epsilon multiplicatively, for say epsilon about 0.05, uniformly over all B.

The way i shake it is to do it is similar to flipping an egg in a frying pan, although sort of different, not sure a good way to describe it.

The coffee filter is in this shape https://www.bedbathandbeyond.com/store/product/cuisinart-gold-tone-coffee-filter/1012198515

EDIT: er, nvm, uniformly over all B makes no sense

#

Er, the image got flipped, so left is right and right is left, not that it really matters

wide spear
#

Ok

#

My initial idea is to treat this as a sort of Brownian motion

#

The grounds are of negligible size essentially compared to the container

#

Then this just boils down to solving the heat equation for your domain, and seeing how long it takes to get to your epsilon

brave crypt
#

Maybe another thing to add is that I pour the normal grounds, then the decaf grounds (could be opposite, doesn't matter), so one is on top of the other

wide spear
#

Initial condition is 1 below a certain height and 0 above

#

Then you see how long it takes to approach 0.5 everywhere

#

Reflecting boundary conditions seem appropriate

brave crypt
#

Hm interesting, yeah I guess this could work

dark sinew
#

So my professor was showing that the error in Euler's method can actually be expressed as a IVP as well. I was wondering: what is the error of doing Euler's method on the error of Euler's method and so on and so on?

wide spear
#

Well, you can write down the IVP and calculate this "second order" error right?

dark sinew
#

True. I was trying to take the lazy way out and see if someone had an immediate answer. I'll try it and get back

wide spear
dark sinew
#

Any resources summarizing important results regarding taylor series particularly wrt approximation?

wide spear
#

All of them

dark sinew
#

So I guess then wikipedia is the way to go

wide spear
#

Not really but the joke is that Taylor series are used everywhere

dark sinew
#

so the IVP of the error term in eulers method is given by $$\frac{dE}{dt} = E - \frac{1}{2}e^{nh}$$ where $E(0) = 0$, $h$ is the step size, and $n$ is the number of steps.

pine jettyBOT
#

Trichloromethane

dark sinew
#

So shouldn't the lipshitz constant just be 1?

wide spear
#

Sure

dark sinew
#

And our global error $$\abs{e_n} \leq \frac{e^{\lambda nh} - 1}{2\lambda}Mh$$ where $M = \max{E''}$

pine jettyBOT
#

Trichloromethane

dark sinew
#

so we have it that $\abs{e_n} \leq \frac{e^{nh} - 1}{2}h$

pine jettyBOT
#

Trichloromethane

dark sinew
#

not sure where to go from here

wide spear
#

What did you want to do

dark sinew
#

I mean I know I can analytically solve the IVP error of eulers method

#

but I'm trying to find the IVP of the error using eulers method of the error of eulers method

wide spear
#

Forget about it being the error of something else

#

Consider it as a pde in its own right

dark sinew
#

yeah that's what im doing

spark dune
#

Anybody home? I'm going to repost what I had in computing software here...

#

I have 3D data that is very sparse-mostly NANs on the axis I want to interpolate-and I need to interpolate that into a 3D surface. The NAN data is exclusively one-dimensional: so I'm only looking for stuff on the z-axis. What would be a good method that I could use that is relatively basic and straightforward to implement? I'd be happy to improve later if I can. Currently, I'm using a very dumbed down averages method, but I can tell that's not going to do the trick? I've been doing my own research, but I'm kind of getting bogged down in the details, and I'm a novice that can't figure out what would strike a reasonable compromise between accuracy and ease of implementation.

#

I'm trying to avoid bringing a whole new library into it, just something I can code up quick and dirty. (C++).

wide spear
#

Can you elaborate a bit more

#

You have a function f(x,y) with only a few data points?

spark dune
#

OK, so I have a function f(x, y, z), and I need a nice, smooth surface rather than a scatter plot. And the data is quite sparse, though only the z-axis-the one I want to interpolate over-has NAN data.

#

So, doing my research: would a cubic spline be a good place to start? I'm completely new to this, so forgive any stupid questions on my part.

wide spear
#

By NAN data you mean that those data points don't exist right?

#

Have a look at bicubic interpolation

#

Cubic splines are in 1d

#

Bicubic is the natural generalization

spark dune
#

But I only want to interpolate over one axis. So cubic would be the way to go, right?

#

Anyway, thanks for confirming that, I know it's pretty simple question.

wide spear
#

Oh ok

#

Yeah cubic sounds fine then

spark dune
#

@wide spear Will it be able to handle sparse data, or is there something better for that?

wide spear
#

I mean in a sense, all interpolation is sparse in a sense right

#

You're trying to reconstruct a function with only a few data points

spark dune
#

Well, it's not just a function, but a surface, but yes

wide spear
fleet sail
#

lol

spark dune
#

@wide spear Did I say soemthing really stupid

wide spear
#

No

#

Sorry

#

Anticipation wrote something and then deleted it

#

So the stare was at Anticipation

brave crypt
brave crypt
#

I thought it was fake lol

#

yes, it's very creepy

random hornet
#

Lmfao

wide spear
#

Probably depicting jpeg

wide spear
#

Yeah

#

The old jpeg standard performs a low rank QR decomposition in the discrete cosine basis, and the new jpeg uses a wavelet transform which is a similar idea

hollow ingot
#

could also be low rank approx through svd or something

wide spear
#

SVD is too expensive to compute

#

And right now remains mostly of theoretical interest for most NLA

hollow ingot
#

yeah but i've seen it used in teaching lin alg a lot

#

i don't disagree that it's expensive

wide spear
#

There have been some faster algorithms recently but they have poor error analysis

#

I took Demmel's class, this was about low rank QR decomposition

hollow ingot
#

ah okay, that settles it then 🙂

brave crypt
#

I had a question about perturbation analysis: why do we do $(A+\delta A)\hat x = b + \delta b$ instead of just $A \hat x = b+\delta b$ (I think we do the latter too but why is it not sufficient/why do we also do the former?)

pine jettyBOT
wide spear
#

We just keep track of each place error is introduced right

#

Error is introduced in storing both A and b

brave crypt
#

Hm, I guess that makes sense. But also if hat x is a computed solution, then I think this would have a much larger error than the error in storing A (storing A would be an error of machine epsilon or whatever right?)

At least in A \hat x = b + \delta b, I imagined the delta b to be mostly about error introduced from hat x not being equal to x

wide spear
#

Machine epsilon varies quite a bit

#

In some modern ML applications, machine epsilon is O(10^-4) or something

#

But really you have $(A+\delta A)(x+\delta x)=b+\delta b)$ so $\delta x=A^{-1}(-\delta A\hat{x}+\delta b)$ so you can compute $\norm{\delta x}\leq\norm{A^{-1}}(\norm{\delta A}\norm{\hat{x}}+\norm{\delta b})$

pine jettyBOT
#

Angetenar

wide spear
#

And then this leads into condition numbers and stuff

brave crypt
#

I see (the storing A and b part makes sense to me, I was imagining A and b to be already in floating point, but I see this is not an assumption we are making)

wide spear
severe tusk
#

Reposting from the DS discord: In case anyone here is looking to upgrade GPUs and they just need OpenCL, the 6700XT is not better than the 5700XT. AMD's stack still not worth an update.

wide spear
fleet sail
#

btw angetenar what do u recommend best way to learn more NLA

#

i need to prep for future course

#

and to start applying stuff

fleet sail
wide spear
#

Demmel’s Linear Algebra is good

fleet sail
#

ah ive decided to use matrix computation golub

wide spear
chilly folio
#

hi guys. I was wondering, (I'm using matlab)
so, I decompose matrix A to USV using svd, then when I look at the Singular values, the largest is 10^26, the smallest is around 5, -> "cond(A)" would be 10^26/5
this is the problem. how can I solve a least square problem (Ax_pinv = b) when I have such A matrix to begin with. Because when I use pinv(A)*b, i get a very wrong result. with norm(A x_pinv - b)/norm(b) = close to 1
and strangely enough, when using QR decomposition, and backward triangular
norm(Ax_qr -b)/norm(b) would be 0.09, the result is reasonable.

does anyone have any idea what is the explanation, that qr can perform well but svd (which I though it would be better numerically) won't give me good relative error?
thanks!

wide spear
#

Yikes that condition number is very big

chilly folio
#

yes 😉

wide spear
#

Are you sure that A is invertible?

#

Ummm, the problem with SVD is that it performs a lot of computation and has poor error analysis

chilly folio
#

unfortunately I don't know that. but rank is 254 and the column is 529

wide spear
#

The SVD is too op because it solves a lot of problems, but because of the no free lunch theorem, it has drawbacks in other places

prime kraken
#

is the matrix supposed to be invertible?

chilly folio
#

yes it should be

wide spear
#

If you want to solve a least squares problem, then you should take a look at GMRES

#

10^26 is greater than 1/machine epsilon

#

So a singular value of 10^26 is worthless on computers

prime kraken
#

you could do a tikhonov regularization to get a close solution

wide spear
#

And I would think this means that it is non-invertible

#

Personally I would use GMRES for a least squares problem

prime kraken
#

iterative approaches are always a good idea, agreed

chilly folio
#

alright i'll take a look at GMRES. but the question remains the same. how could QR come out with a good result. (although when I solve the x, i'd get "with warning: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.026990e-24."

prime kraken
#

if you want a one-shot deal, a low rank approx with pseudo inverse or a tikhonov reg. would help

wide spear
#

QR does not require invertibility

#

And there are methods to make QR much better behaved numerically

#

Householder transformations and Givens rotations

prime kraken
#

to be fair, the SVD is done with givens rotations. the problem is that you try to invert it after, and that division by the singular values will mess you up

chilly folio
#

actually I'm looking for a way to compute the least square (so finding x) the fastest and better relative error. And I don't have enough reasoning why the QR would give me a good result, but using svd is not 😅

wide spear
#

GMRES for least squares

chilly folio
#

ok i'll take a look at gmres thanks guys!

prime kraken
#

aight

chilly folio
#

shoot, i just realised, i haven't told you that my matrix is not square. I just read wikipedia, it's assumed that in order to use gmres, matrix A should be square and invertible. However, my matrix A wouldn't be square and the system would be overdetermined. So I might stick to QR.
or is it possible to give preconditioning. So Matrix B = precond*A) then do gmres
to solve x, sooo

instead of
Ax = b,
it would be
precond * A *x = precond * b

wide spear
#

Ah so that's why you were using svd

chilly folio
#

xD

#

no, initially I use QR since it's the fastest

wide spear
#

Have a look at low-rank QR

#

GMRES is certainly faster than QR

#

For certain classes of matrices

chilly folio
#

well, I'm writing my bachelor's thesis, and I'm evaluating performance of several least square solvers for my project. including svd aswell. but when I tried svd, it performed not as I expected

#

alrite

#

thanks

wide spear
#

Yes SVD is rarely used in NLA

brave crypt
wide spear
balmy grotto
#

send halp

#

idk if this is dumb but i assumed that p^k=r^k+beta_k-1p^k

#

but i just can't get to the answer

wide spear
#

Well what do you get

balmy grotto
#

ill show one sec

orchid sequoia
#

@balmy grotto check again how A is being applied to p_k

#

i think that's it

balmy grotto
#

im not sure of the relation of A to p^k

#

don't think i was given one

orchid sequoia
#

i mean, (Ap_k = Ar_k + \beta_{k-1} Ap_{k-1})

pine jettyBOT
#

homeomorfismo

balmy grotto
#

i did that tho

#

then i expanded

orchid sequoia
#

but that whats missing in the second and fourth term

balmy grotto
#

ohh crap so i wrote it down wrong

orchid sequoia
#

yee

#

but now its done 😄

balmy grotto
#

you're a legend my guy @orchid sequoia

#

was starting at this one for a good hour or two

orchid sequoia
balmy grotto
#

i should really take things step by step

orchid sequoia
balmy grotto
#

I get that now

#

maybe i should only expand the left side

#

when i expand the left side only the term i want pops out

balmy grotto
#

okay i figured it out, was a sneaky one

fleet sail
#

does anyone know if this condition i wrote is ok

#

sigma is the relu function componentwise, maps everything negative to 0

#

lmao mean value thm in Rn i didnt even know it existed

#

also how would u find conditions for unique fixed point if u dont compute jacobians? ReLU makes it annoying to do analysis

brave crypt
#

maybe a direct argument?

orchid sequoia
#

@fleet sail i think you can show that sigma is Lipzchits for the inf-norm (without using MVT), so just bfpt

brave crypt
#

$g(x)=x$ means $\sigma(Ax+b)=x$. but we must have $x_i\geq 0$ for each $i$ since otherwise this equality is impossible. ah but fuck, hm

pine jettyBOT
brave crypt
#

i thought this means we must have Ax+b=x, but that would be bullshit math

fleet sail
#

Ah so you mean showing $| \sigma(x)-\sigma(y) | \leq | x-y |$ in the inf and 1 norm, and then u have $| \sigma(Ax+b)-\sigma(Ay+b)| \leq |Ax-Ay|$ which is lipshchitz if $|A| < 1$ in infnorm or 1norm

pine jettyBOT
#

Anticipation

orchid sequoia
#

Yes

fleet sail
#

thx

balmy grotto
#

so I showed that this was zero, and now i gotta complete the case where j < k

#

how would i go about showing this when j < k

#

do i have to use ineq somewhere

slender spindle
#

hello familia, anyone here have a good source on methods for fitting ODEs to data?

#

this can fit in a bunch of channels but ill ask here, hopefully that's chill.

wide spear
#

Yeah it's fine here

#

First of all, by fit, do you mean interpolation exact fitting or least squares type best fitting?

slender spindle
#

least squares type best fitting

wide spear
#

My immediate thought for the second type is to first come up with a form of an ode with unknown coefficients, find the general solution, then perform a fit on that

slender spindle
#

The ODE I need to fit is too nasty for that I think

wide spear
#

Hmmmm

slender spindle
#

it's a epidemic model with the standard stuff, vital dynamics, vaccination (discontinuous function), some other stuff

wide spear
#

How expensive is it for you to propagate your ode on your time domain

slender spindle
#

not that bad

wide spear
#

Ok yeah that won't be exactly solvable

#

Oh ok

#

You can turn this into a convex optimization problem

#

Fix the coefficients

#

Propagate

slender spindle
#

what I've done before is just put some constraint on the params based on calculated R or w/e and then sampled randomly from the parameter space

wide spear
#

Calculate the error

#

Take the gradient with respect to the coefficients

#

Update

#

Does this make sense?

slender spindle
#

stellar thanks man

#

yeah

wide spear
#

This is not too different from neural network training actually

bright palm
#

this is a silly question and not super technical but

#

looking at 8a, this should be S_2 right?

#

i do not get the value that they report

#

actually, none of those evaluated at 1 are equal to the value they got

#

,w -.0023-.0069-1.0046+3

#

,w .0399-0.007-1.0047+3

#

,w -0.0587+.8804-3.667+5.6623

#

so im curious what im doing wrong, or if this is just a dumb error

fleet sail
bright palm
#

1.28252

fleet sail
#

oh did you get 2.03?

bright palm
#

tda

#

yea

#

sorry this is an old exam

fleet sail
#

hm im not sure lol it seems like ur right

bright palm
#

thats why it looks that way

#

thanks for the heads up then lol

fleet sail
#

are the S_1's given or did you calculate them

bright palm
#

given

fleet sail
#

ah then yea i think ur right

bright palm
#

thanks

balmy grotto
raven hearth
#

I just read about Wigderson and Lovász's Abel Prize. Is there a breakdown I can read somewhere?

wide spear
#

A breakdown of what?

#

You can always start by reading the Abel Prize announcement, which discusses some work at a high level

#

Then, you can see their websites, which have lists of publications

#

Obviously reading all the publications will not be possible, but they also both have lists of survey articles that they've written which will provide a broader overview

#

As you read the survey papers, if anything stands out and interests you, then you can find whatever paper that corresponds to and read in further detail

light rover
#

hello

#

everyone

#

if the question asks for O notation

#

with h = 0.01 and f'(1)

#

can I just leave it as O(0.01)

#

or do I have to do something special

brave crypt
#

Huh?

light rover
#

uH

#

dis

wide spear
#

What

#

One never writes O(number)

#

It is always O(function)

light rover
#

i'm so confused

#

but the homework says h = 0.01

wide spear
#

Ok and?

light rover
#

I

#

don't know?

wide spear
#

You would just write $f'(x)=\frac{f(1.01)-f(1)}{0.01}+O(h)$

pine jettyBOT
#

Angetenar

wide spear
#

I think

light rover
#

thats...it?

wide spear
#

I mean do you know what f is?

light rover
#

yes

wide spear
#

Ah f'(1)

#

Well then you should evaluate it

light rover
#

okay but I don't touch O(h)

#

?

wide spear
#

No

light rover
#

why not

fleet sail
#

tbh idk why you can't cuz in a question our prof gives he writes this O(h^2)

#

but i guess strictly O(0.1^2) would mean O(1) so yea.,

wide spear
#

An error that is O(0.1^2) is meaningless

#

Any constant is O(0.1^2), regardless of how big it is

#

However, an error that is of order 10^-2 does have meaning

brave crypt
#

Overall, I think O(h) technically makes sense only if h is still a variable. Although I agree that "error on the order of 10^-2" totally makes sense

light rover
#

o..

#

thank u all

brave crypt
light rover
#

I have a question, for the second derivative of three point center difference

#

how would I go about estimating the error in O notation?

wide spear
#

Taylor series

light rover
#

thanks 😔

wide spear
#

Why 😔

#

If you need more help I can provide more help

light rover
#

Ajsjsk its okay you helped a lot

#

Taylor series was just something a long time ago I didn't quite remember it that well that's why

#

I appreciate

turbid jay
#

hey, I'm implementing subgradient descent for the SVM problem. No autodiff, so I have to compute the subgradient of the objective manually.
I don't know how to handle the maximum. Without the max, I think that the subdifferential sets would be: $\partial w = \frac{1}{m} \sum -y_ix_i + 2 \lambda \langle w, w \rangle$ and $\partial b = \frac{1}{m} \sum -y_i$ but this is not the correct solution

brave crypt
#

Something looks weird about indices, eg partial w should be a (set of) vectors right?

#

Eg I'm not sure what w^2 means

turbid jay
#

so partial w doesn't mean the partial derivative in this case. Not sure if it's abuse of notation, but partial w is the subdifferential. This is the set of all subgradients

#

that's what we have in the lecture, but also wikipedia uses ∂f(x0) . Maybe there's a better notation

pine jettyBOT
#

lyinch

turbid jay
#

w^2 was bad notation... Sum of elementwise square. I changed it to the dot product with itself now , but the bot doesn't update

brave crypt
#

Something like that, although derivative of the regularized term should be just 2 lambda w I think. But subgradjent of max(blah, 0) should be 0 if blah<0, normal derivative of blah if blah>0, and some crap if blah=0 (was there a chain rule for subgradjent?)

#

Eg subgradjent of max(x, 0) (with respect to x) would just be any number 0 to 1 at x=0

turbid jay
#

ah yes, you're right about the regularizer

#

the subgradient has a chain rule

#

that sounds easy, if I just need to check for max(a,0) whether a < 0 . But why is this correct?

brave crypt
#

Er, why is what correct?

turbid jay
#

why is this the "rule"

brave crypt
#

This is just a single variable calculus thing, you can draw the graph of max(x, 0) and the subderivative is clear. Then if chain rule holds everything should work out

#

,w Plot[Max[x, 0],{x, -3,3}]

turbid jay
#

I see, makes sense in the case where it's max(a,0)

#

thanks

brave crypt
#

Admittedly I'm not sure what the chain rule for subdifferentials looks like but I'm guessing it works out

turbid jay
#

I have a rule for conic and affine combinations. In this case it's an affine function

raven hearth
turbid jay
brave crypt
#

Ah I see, yeah this is good/nice

brave crypt
#

could one provide the resources for advection (transport, convection) equation for
unstructured 2d grid?
cant seem to find the proper resources
did the poisson and heat equation, they seemed to work.
trying to code up the transport one, getting weird results =\

#

diffusion did work

#

but in transport i either mess up with upwind or sth :\

wide spear
#

Poisson and heat are both pretty well behaved

#

Are there any constraints on what methods you can use?

#

Can you describe the manner in which upwind is not working well?

brave crypt
#

calculated the gf = rho * (u dot norm) FaceArea values for each face

#

and checking their values

#

used this scheme (w/o diffu term)

#

also tried with if statements

wide spear
#

Ah ok finite volume methods

brave crypt
#

righto 😐

wide spear
#

What weird results are you getting?

brave crypt
#

it also seem to diverge

wide spear
#

Have you tried a finer mesh?

brave crypt
#

well i could gimme a sec

#

gonna take ages

#

🙂 potato pc

wide spear
brave crypt
#

same thingy

wide spear
#

And do you know what it should be?

#

Everything moving to the right?

brave crypt
#

yep

wide spear
#

Are your boundary conditions implemented correctly?

brave crypt
#

every iteration i run over the faces set left to 1 others to 0

#

then recalc nodal values by interpolation

#

finer is kinda ok, but not sure yet, gonna take ages

brave crypt
wide spear
#

Advection is unstable

brave crypt
#

T_T

wide spear
#

There's something called the CFL condition which essentially says that if the ratio of your smallest mesh edge length to the time scale is too large, any numerical scheme will diverge

brave crypt
#

ye but i used 1e-9 time
and ~1e-1 edges

wide spear
#

Yeah that's too big

brave crypt
#

for finer mesh dt should be even smaller

wide spear
#

Oh wait

brave crypt
#

xD

wide spear
#

Maybe your time scale is too small

brave crypt
#

1e-5 same result

#

1e-4 diverge

wide spear
#

Hmmmm

#

What is your velocity scale

brave crypt
#

1

#

😄

#

waiting for the vectors to appear in the neighbouring cells 🙏

wide spear
#

Ok

brave crypt
#

oh that bottom left mofo

#

ANGERR

wide spear
#

The other thing you can do is make the mesh much coarser and calculate the first iteration by hand

#

Hopefully a coarser mesh will mean that it is easier to compute by hand

brave crypt
#

will leave the handcalc for the night cuz that time is kinda unproductive

#

can show u the code if u wish btw
in like 10 minutes

#

i remember my cfd and openmpi classes
1 day for writing the code
10 days for debugging

wide spear
#

Lolllll

#

Yeah debugging sucks

brave crypt
#

8 cores parallel 3d poisson equation AW

wide spear
brave crypt
#

with different topologies

#

assuming it diverged

#

left boundary is 1 for the faces

#

unit vectors seem to point in the right direction. but the values are tiny
still waiting for the cell values to diverge

#

probably might use the implicit methods <_<

wide spear
#

Try using a second order scheme instead of upwind perhaps

#

Lax-Wendroff or Lax-Friedrichs are both second order

balmy grotto
#

how could I prove 4 ?

wide spear
balmy grotto
#

ok, figured i asked here since I thought it had to do with my implementation

paper crow
#

Hi all. I hope I'm in the correct channel for my question
it's regarding this:

#

I'm not sure how to read the wN here
the paper it's from states that wN is the Nth primitive complex root of unity
but to my understanding that is a set of at most N roots of unity, right?
if X*r is a set of complex numbers
how do I multiply them by wN^-k(cmin,r)L?
so basically: assuming N, k, (cmin,r) and L are all known, how do I get the real and imaginary parts for wN^-k(cmin,r)L?

wide spear
#

You are taking the dot product of two vectors

#

Elementwise product, then sum together?

#

X_r[k] is a scalar right

paper crow
#

it's an array of complex numbers

wide spear
#

X_r is an array of complex numbers or X_r[k] is an array of complex numbers

paper crow
#

oh sorry

#

X_r is

#

it's the result of a Fourier transform

#

so basically a phase and magnitude

wide spear
#

Yes so X_r[k] is a scalar

#

So you compute $X_r[k]=\sum_{i=1}^N(X_r^*[k])i(w_N^{-kc{\min,r}L})_i$

pine jettyBOT
#

Angetenar

wide spear
#

Or you might want a conjugate on one of them

paper crow
#

My algebra is rather spotty. Where did that summation come from?

wide spear
#

You're taking the complex inner product of two vectors

paper crow
#

Okay, I'm coming from a CS background, I fear I might be in over my head here. So forgive me if I ask stupid questions

#

Can't I get the real and imaginary parts for $(wN^{-kc{\min,r}L})$ and just multiply the two complex numbers $X_r^*[k]$ and $wN^{-kc{\min,r}L}$?

pine jettyBOT
#

bastos80

wide spear
#

Didn't you say both of them are are vectors?

#

Or sets of values

paper crow
#

Ordered sets of complex numbers

wide spear
#

Yeah

#

Those are vectors

paper crow
#

I found a matlab implementation (that I feel isn't 100% correct) that solves it this way: Xr = Xr .* exp(1i2pi*(0:kmax+N/L-1)*(RingBufferIndex-r+1)*L/N);

wide spear
#

Ok?

#

That's the product of two vectors

paper crow
#

Ah ok. So it takes a range of 0 : kmax and multiplies each value it with 2 PI and the complex unit, then takes the exponent of that and then multiplies the two arrays

#

But I'm failing to find the summation in there.. is it implicit?

wide spear
#

Ah

#

Here Xr is still a vector

#

It has not been summed

paper crow
#

I see

#

So then i think I get it except for the $(wN^{-kc{\min,r}L})$

pine jettyBOT
#

bastos80

paper crow
#

How do I get that into a vector/complex number

#

in other words, what are the real and imaginary parts of that part

wide spear
#

Well do you know that w_N is

#

The N-th root of unity right

#

Then you take it to whatever power

paper crow
#

it is the Nth primitive complex root of unity

wide spear
#

Yes

paper crow
#

but from what I read that's multiple compex numbers

wide spear
#

Then we can write $w_N=e^{-\frac{2\pi i}{N}}$

pine jettyBOT
#

Angetenar

wide spear
#

Then you take it to whatever power

#

I'm not very familiar with the notation you have

paper crow
#

aha. that's the missing part of the puzzle I think.

#

bottom of page 2

#

I tried reading up on primitive complex roots and I think I get it

wide spear
#

Ok

#

I have no experience with actual ffts

paper crow
#

I just don't get the relation of them to $e^{-\frac{2\pi i}{N}}$

pine jettyBOT
#

bastos80

wide spear
#

$w_N=e^{-\frac{2\pi i}{N}}$

pine jettyBOT
#

Angetenar

wide spear
#

It's the primitive Nth root of unity

paper crow
#

so does that mean there's only one primitive Nth root of unity? Or can it be solved more than once

wide spear
#

There is only 1

paper crow
#

Weird

#

The material I read stated there are $\phi(n)$ primitive $n^{th}$ roots of unity

wide spear
#

There are N Nth roots of unity

paper crow
#

wow I butchered that tex

wide spear
#

You take w_N and raise them to powers 1 through N

#

However they are all generated by a single root

pine jettyBOT
#

bastos80

wide spear
#

What is phi?

paper crow
#

Euler's totient function

wide spear
#

Ah

#

Ok I've been using it in a slightly different way

paper crow
#

Did I misunderstand?

wide spear
#

No ok

#

Yeah that's a fine definition

#

Ok so w_N is the vector of primitive N-th roots of unity?

#

Maybe

#

Then you take the elementwise powers

paper crow
#

Yeah that wasn't completely clear to me either

#

It just states: wN is the Nth primitive complex root of unity

#

so, singular

wide spear
#

Ok

#

So w is a vector then and w_N is the N-th component of it

paper crow
#

Thanks for the help. I’ll try to implement it tomorrow. I’ll keep you posted.

wide spear
brave crypt
#

the methods of LW and LF would be an issue cuz the final problem is NS eqn 😐

brave crypt
#

aww, my gf calculations werre wrong, need to calc gf for each face when running over cells <<

#

was like this

#

then added it to calculation of advection term

#

seems working, waiting forever to finish running

paper crow
#

I have another question if that's ok...

#

This is applying frequency domain windowing on a FFT output

#

$a_m$ in my case are real constants of a Hamming window

pine jettyBOT
#

bastos80

paper crow
#

but I'm not that familiar with frequency domain windowing... do I just apply the regular $w[n] = a_0 - a_1 \cdot cos(\frac{2\pi n}{N})$ here?

pine jettyBOT
#

bastos80

paper crow
#

where the n is m from the earlier equation?

brave crypt
#

nice pfp

brave crypt
#

how to properly dieal with bc 😦

#

i had to nullify mines

wide spear
#

Anyways, what are your boundary conditions?

dry gulch
#

Can i ask about course of value recursion here? It should be computational maths afaik, but im not sure

wide spear
#

Is this course of values recursion for defining number theoretic functions recursively?

dry gulch
#

Yes, something like that

wide spear
dry gulch
#

alright, thanks)

grave sand
#

is there anyone with knowlegde of quantum computing, particularly grovers algorithm? i have a couple of questions to discuss

wide spear
#

If no one can help you here, you're probably better off asking in the physics or computer science discords

grave sand
#

good idea, thanks

brave crypt
wide spear
brave crypt
#

Resizing a matrix generally sounds like a weird thing to do

brave crypt
#

It's like one of those what will you do for a klondike bar type things, like for an FFT it's way worth it to resize it to a power of 2 instead of computing a DFT

#

Oh I just read modern FFT algorithms can do non power of 2, but the code is more complicated. So as long as you don't have to write your own you don't need to resize.

wide spear
#

Yes modern fft algorithms can handle non power of 2 sized matrices

tall solar
#

My whole thesis is above not resizing a multidimensional array

brave crypt
tall solar
#

Wait what does bot top mean

#

Tensor Completion Algorithms in Big Data Analytics - a cool survey

brave crypt
#

ah nvm, i got resizing and reshaping confused

grave sand
#

so im asked to use finite differences method to compute a 6th order pde. to do so, i use a 3 step center approximation. my boundary condition is a value at u(t,0) = u_0, and the fact that its first and second derivative at u(t,0) is 0. so my guess was to just use the same value for the first 3 points, but when i run my code, the values blow up quite quickly because these 3 values are the same, and there is some sort of discontinuity in the data

#

im struggling to put this in words, but basically i need to know how choose my starting values for a 3 step approximation

wide spear
#

Ok so you have x0 which is a boundary and you have x1 and x2 which are close to it

#

You know that u(t,x0)=u_0 so fine you set x0 to that

grave sand
#

yes

wide spear
#

Now, the first and second derivative at u(t,0) is 0

#

Oh also you should be using a 3 point assymetric approximation because you're at the boudnary

grave sand
#

for which approximation exactly? for the pde or for u(t,x_1), u(t,x_2)

wide spear
#

For the first and second derivatives

grave sand
#

sorry im not following

wide spear
#

So for example

#

u'(t,0)=(-3u(t,0)+4u(t,h)-u(t,2h))/(2h) right

grave sand
#

ahh and the derivative i know

wide spear
#

And u''(t,0)=(u(t,0)-2u(t,h)+u(t,2h))/h^2

#

So from this, you get a system of equations

grave sand
#

perfect

wide spear
#

Which you will solve

#

Etc....

grave sand
#

my mistake was to trying to approximate u(t,x_1) by taylor in u(t,x_0)

#

but this makes more sense

#

well thanks, ill see if that works

#

oh one more, why do i need to use a 3 point assymetric at the boundary?

wide spear
#

Well you said you were using a 3 point symmetric approximation for the derivatives right

#

So 3 point asymmetric

#

Actually

grave sand
#

7 point i guess? x_{i-3}, x_{i-2} ,/dots, x_{i+3}

wide spear
#

Yikes 7 points

grave sand
#

its a 6th order derivative...

wide spear
#

I see

#

That's a very high order derivative

#

Anyways

grave sand
#

so still 3 point?

wide spear
#

I guess you can use a 4 point

#

Because this way it's like half of your 7 point scheme

grave sand
#

i have to do some analysis on the stability later, but i figured id start with the implementation

#

but then i have 3 unknowns and only 2 equations, not?

#

because only u''(t,0) is known

wide spear
#

Didn't you say the first and second derivatives at the boundary were 0

grave sand
#

yes sorry

#

still

wide spear
#

Anyways

#

You have a bunch more equations for everything else right

#

The interior terms

#

So it's a big system of equations

#

Not just at the boundaries

grave sand
#

okay

#

i see

#

thanks !

pine jettyBOT
#

DvaNapasa

brave crypt
#

area is a polygon, cant seem to apply Gauss-Ostrogradski thm(

#

$\int_{S}\nabla s \cdot \hat n dS$

pine jettyBOT
#

DvaNapasa

brave crypt
#

$\int_{A}\nabla s \cdot \hat n dA$

pine jettyBOT
#

DvaNapasa

brave crypt
grave sand
grave sand
#

so when i choose a 4 point approximation to get u(t,x_1) and u(t,x_2), they end up even further away from u(t,x_3), which leads to even bigger problems

#

somehow u(t,x_1) and u(t,x_2) need to be inbetween u(t,x_0) and u(t,x_3)

wide spear
#

Are you doing interpolation?

brave crypt
#

consider taylor series expansion around the point of your interest @grave sand
`multuply each equation by some coefficient
and find the coeffs

#

page 3

grave sand
wide spear
#

Oh my bad

#

What do you mean by "they end up further away"

grave sand
#

yea let me give you more details about the boundary

#

so the initial conditions are u(0,x) = e^{-x^2/16}

#

so it starts at 1 and goes to 0 as x increases

#

u(t,0) = 1

#

and the derivatives are 0 are mentioned

wide spear
#

How many derivatives are 0

grave sand
#

u', and u''

#

so the first timestep is fine, because U(0,x) is 'smooth' (steady decrease)

wide spear
#

Don't you have a 6th order derivative?

grave sand
#

let me send you a screen shot

#

question B)

#

the general PDE has a 6th derivative

#

but the boundary conditions are that u'(t,0) and u''(t,0) are 0

wide spear
#

Ok

#

And what is going wrong

grave sand
#

so calculating the first timestep is fine, because u(0,x_i) is 'smooth' as in nicely decreasing and regular

#

but for u(t_1,x_1) and u(t_1,x_2) we discussed which values to choose

#

if i do a 2 point approximation for u'(t_1,x_0), u''(t_1,x_0), i get that u(t_1,x_1) =u(t_1,x_2)=1

#

so then my data looks like u(t_1,x) =[1,1,1,0.9,0.88,0,86,...]

#

do you follow until now?

wide spear
#

I think you need a 3 point approximation for u''

grave sand
#

yes, sorry 3 point

#

but that still gives me that its all the same value (which makes sense as the derivative is 0)

wide spear
#

Ok sure

grave sand
#

now when i run my 7 point approximation in the next timestep, i use the first 7 datapoints

#

but theres a jump from 1 to 0.9

#

so my values just explode

wide spear
#

What do you mean by a jump

grave sand
#

so you see 0.9 is 'close' to 0.88 and 0.86

wide spear
#

Ah I see

grave sand
#

maybe i can show you some of the actual points

wide spear
#

You might want to use more points at the endpoints then

#

Use 7 points perhaps

grave sand
#

i tried that, but then x_1 and x_2 were above 1

#

so the gap got even bigger

#

well im not sure if i did this correct

grave sand
wide spear
#

Yes

#

Ok let's try 3 points for u' and u''

#

So 0=3u0-4u1+u2

#

And 0=u0-2u1+u2

grave sand
#

yes

#

but that gives you u0=u1=u2

wide spear
#

Ok

#

Now let's try 4 points for u' and u''

grave sand
#

would you be able to go in a voice channel quickly? (its also ok if you dont have time, i have teachers for this very reason)

wide spear
#

I am unable to

grave sand
#

okay

wide spear
#

u'=0=-11u0+18u1-9u2+2u3

#

u''=0=2u0-5u1+4u2-u3

grave sand
#

okay, so what i did is i used the values for u_3 i got from my normal approximation (with the data from the perivous time step)

#

is that correct?

wide spear
#

Sure

grave sand
#

but then the values for u1 and u2 were slighly above 1

wide spear
#

Why is that bad

#

Does it blow up?

grave sand
#

yes, quickly

wide spear
#

Ok

#

5 points next

#

u'=0=-25u0+48u1-36u2+16u3-3u4

grave sand
#

so will it work at some point you think?

#

if i keep using more points

wide spear
#

u''=0=35u0-104u1+114u2-56u3+11u4

#

Hopefully it will

grave sand
#

okay

#

let me see if i can get it to work

#

any other ideas in case this doesnt work?

wide spear
#

An implicit scheme instead of an explicit one perhaps

grave sand
#

for space or time?

wide spear
#

But it wants a FTFD

#

So they probably don't want you to do this

#

Have you considered shrinking dx and dt

#

That usually helps

grave sand
#

yea i thought so too, but i think my matlab does some weird stuff

wide spear
#

Well matlab sucks

grave sand
#

maybe ill try with python

#

i think it wasnt accurate anymore at some point

#

anyways, thanks for the help

wide spear
fleet sail
#

ok someone says

#

$\grad f = -2A^t(Y-AX)$

pine jettyBOT
#

Anticipation

fleet sail
#

if f is defined to be $f(X) = |Y-AX|_2^2$, (least square stuff)

wide spear
#

Are X and Y vectors?

fleet sail
#

yea

pine jettyBOT
#

Anticipation

fleet sail
#

i tried computing the grad and somehow got something else

#

idk where im wrong

wide spear
#

Not quite

#

I don't have a good way of notating where I think the mistake is

fleet sail
#

but u know whic line?

wide spear
#

But in between the first and second so

#

You lose some entries of A

fleet sail
#

oh wait i see it its

#

i missed the a_i1's here

#

and also added an extra x1

wide spear
#

Yes

fleet sail
#

ok now that makes sense

fleet sail
#

wait for R^d how do you use hessian to determine if its min or saddle or max

#

f:R^d->R

prime kraken
#

the hessian must be positive or negative (semi) definite

fleet sail
#

oh ok, and also for example for this one

fleet sail
#

how do you know gradf = 0 correspond to min

prime kraken
#

that's a quadratic form, should be positive definite

#

lemme get my tablet and write out some steps

#

i saw you did these things working with the scalars and using sums

#

i'll do it directly over the matrices and vectors, of you don't mind

fleet sail
#

yea sure i think i can understand

prime kraken
#

are these real or complex vectors?

#

(and the matrix, too)

fleet sail
#

real

prime kraken
#

k

#

you can double check if i did something stupid, but that should be ok

#

could divide by 2 after finding the gradient, but that shouldn't hurt

#

this means least squares problems are convex

#

the least squares solution matches the pseudo inverse

fleet sail
#

thanks i wil have a lookd

fleet sail
#

that is pretty cool

prime kraken
#

tbh the notation for these things is not agreed upon

#

but i have seen that used fairly often

fleet sail
#

im tryingt o justify why it appears u can just do 1D calculus with this notation

prime kraken
#

it's consistent with the notion that

#

the reason it appears that way is that the individual entries of the vector x appear by themselves in the sums

#

so when you take partial derivatives w.r.t. one entry, all the other entries become 0

#

alternatively, take the gradient you already have and notice that the hessian is the jacobian of the gradient

#

if you wanna stick to scalars

fleet sail
#

i just found $\grad x^TA^Ty = (A^Ty)^T$ lol what

pine jettyBOT
#

Anticipation

prime kraken
#

that's kinda weird, gradient w.r.t. x, sure, but not x^T which is what you want

brave crypt
#

You probably already know but wikipedia has a nice list of formulas https://en.m.wikipedia.org/wiki/Matrix_calculus#Identities

In mathematics, matrix calculus is a specialized notation for doing multivariable calculus, especially over spaces of matrices. It collects the various partial derivatives of a single function with respect to many variables, and/or of a multivariate function with respect to a single variable, into vectors and matrices that can be treated as sin...

fleet sail
#

oh was just being dumb thinking of gradient in rows

#

also thx i never did much matrix calc before

prime kraken
#

as pointed out by 8da, wikipedia has a lot of nice stuff

#

i used flavor 3. in there

#

which is really 1. in a trench coat

fleet sail
#

ok i understand this is lit

fleet sail
# prime kraken

thanks, also want to make sure things like $\grad x^TAx = 2Ax$ is just applying identities that you are used to right? as in you proved it once (by element-wise) and never have to do it again.

pine jettyBOT
#

Anticipation

prime kraken
#

yes

#

you can always reach the same result by doing it with scalars

#

and if at any point you don't remember some matrix calculus identity, even with multilinear stuff, you can always express it as a sum and do it like that

fleet sail
#

yea ic thx

paper crow
#

Hi there! Anyone here with DFT/FFT experience? I'm implementing a phase vocoder and I've run into a bit of a snag

#

This is the relevant part of the paper

#

I get the $Z_u$ part

pine jettyBOT
#

bastos80

paper crow
#

But how would one cumulate the phase rotations? Multiplying $Z_u$ with the next $\Delta \omega R$ seems odd

pine jettyBOT
#

bastos80

burnt scaffold
#

heey guys, new here. i want to work on some implementations for the newton method in R^n -> R^n case. and i am looking for a good test function that needs some more steps to converge
does anyone of a good test example or a place to find one?

wide spear
#

Newton's method for finding roots?

burnt scaffold
#

yees

wide spear
#

Ok

#

f(x)=x+abs(x)^(4/3) should converge slowly

#

Newton's method does not display quadratic convergence for this

#

You can modify the exponent to get a wide range of convergence speeds

burnt scaffold
#

can i extend that nicely to a R^n -> R^n case

wide spear
#

Oh um

#

f(x)=x+abs(x)^(4/3)*(1,1,...,1) should work

burnt scaffold
#

i am working on a dampened newton method and want to test some stuff for r^2 -> r^2 case first before trying to proof anything

wide spear
#

Anyways

#

This converges slowly because x^(4/3) is not differentiable at 0

tall solar
#

Any cool numerical subjects to look out for?

wide spear
#

All of them

tall solar
#

But what if I already took a grad class on numerical analysis and numerical linear algebra. I feel like the only cool thing in numerical is krylov subspaces, can't think of anything else

wide spear
#

Well I don't know what you find cool

#

I think all of it is cool

tall solar
#

Sure that's true.

#

But like the things feel like their already all done.

tall solar
#

Woah so I've seen stuff about generalizing ft but that's a numerical topic??

#

This is really cool 😎.

#

Now this is the sort if stuff I wanna learn about lol

wide spear
#

It sounds like your interested in computational algebra and not classical numerical analysis

tall solar
#

Maybe I dont understand the distinction enough. But I don't think it's specific to computational algebra. I just want a cool applied topic tbh

wide spear
#

Based on what you have said is interesting

tall solar
#

Yeah I see what you're saying

I think of approximation theory, discretization methods for pdes, and system solvers when I think of numerical

I probably don't have a firm understanding of what exactly is classical numerical analysis

#

I feel like you have a Santa bag of cool stuff dude wth

wide spear
#

It sounds like you just need to see modern numerical analysis research

tall solar
#

Agreed 🙃

#

Yeah, the things you shared are good starting points for some Google searches.

tall solar
#

Posted this in category theory cause I was curious above whether the diagram on the middle bottom right is related to category theory (probably isn't). It's cool nontheless

wide spear
tall solar
#

I deleted the other post sorry for spamming lol. BUT THIS IS APPLIED MATH 🐮

brave crypt
#

Is it just me, or does polar of a set sounds like a really weird thing? Eg, it is not even translation invariant. And I fail to see that C convex implies double polar of C is itself. First polar can be empty except for origin if C contains a ball around the origin, then double polar is the whole ambient space R^n

wide spear
#

So usually it's called the polar set

#

And it's something in functional analysis

#

There's something called the bipolar theorem

#

Which says that the bipolar of a set is the weak closure of the convex balanced hull of the set

#

The graphic is not correct as written

#

In particular, the images seem to be in reference to dual polyhedra

brave crypt
#

Hm

wide spear
#

The "balanced" part addresses translation invariance

#

And the bipolar of a convex set is not necessarily itself

#

Also the definition given is not correct

#

If $X$ is a topological vector space with a continuous dual $X'$ and $<x,x'>=x'(x)$ then $A^{\circ}=\left{x'\in X':\sup_{a\in A}\abs{<a,x'>}\leq1\right}$

pine jettyBOT
#

237387148

wide spear
#

This is the correct definition of a polar set

brave crypt
#

I looked it up in wikipedia, it looks like the definition in the graphic is called a polar cone

wide spear
#

Yeah

#

Anyways

#

The graphic is a hot mess

#

Oh also

#

The images display dual polyhedra

#

Which are neither polar cones nor polar sets

#

No memes here

tall solar
#

Understood lol

brave crypt
#

I think ange was joking

wide spear
#

This graphic presents several important concepts in convex/functional analysis, mis-names them, shows examples of other things, and then tries to present some deep connections between them

brave crypt
#

any FVM people here?
code-debugging issues 😐

brave crypt
#

@wide spear oof

tall solar
wide spear
brave crypt
wide spear
#

What do you mean

brave crypt
#

@wide spear voice?)

wide spear
#

No

brave crypt
#

i cry

brave crypt
#

Diverging results

wide spear
#

Ok so you have a finite volume method

#

What pde are you applying it to

#

Have you tried randomly changing signs/making the mesh size smaller

brave crypt
#

yes did

#

same result

#

when i add the divergence of the velocity field to the rhs the poisson equation goes to infinity

#

mathematically RHS

wide spear
#

What is the left hand side?

brave crypt
#

tangential flux in first loop and divergence of v inthe second

#

lhs is grad dot (grad pressure)

#

im using gauss seidel

#

i have the perfectly working code for the poisson equation with zero rhs i.e. soource term

#

@wide spear i mean probs the whole method is not applicable to the fvm
i did it in finite difference
therre also might be some checkerboard pressure oscillations that lead to this issue but idk

brave crypt
#

I'm stupid @wide spear
@warm otter
Did not apply Neumann bdry to the walls dp/dn=FluxWall=0
Getting kinda ok result for now
Still diverging

#

But the pressure distribution is uniform
Except for the initial sudden peak

#

Will send screens in the evening
Left pc to calc
Will be done in 4-5 hrs

olive wing
#

I'm solving a symbolic regression problem using genetic programming. I know that a target formula should be invariant under a certain transformation on its variables. How can I use this information to improve the quality or speed of the algorithm?

#

For example, assume I'm trying to rediscover the Heron's formula from school geometry (area $S$ of a triangle whose sides have lengths $a, b, c$ is given by $$S = \sqrt{p (p-a) (p-b) (p-c)}$$ where $p = \frac{a+b+c}{2}$). I know in advance that changing the order of the sides $a, b, c$ won't change the area, so if I write $S = f(a, b, c)$, $f$ has to be a symmetric function. If there were no square root (which isn't a problem I think), I could use the fact that every symmetric polynomial can be expressed as a polynomial in elementary symmetric polynomials. In this example it suggests new variables $s_1 = a + b + c, s_2 = a b + b c + c a, s_3 = a b c$. Now I can try to construct a formula using these new variables instead, and hopefully get a better result, because now I always construct formulas that describe symmetric functions, so at the very least I reduce the search space.

Another example of invariant that could be used is homogeneity. In the example above, if I write $F(a, b, c, S) = 0$, I can say in advance that $F$ should be invariant under transformation $\varphi: (a, b, c, S) \rightarrow (k a, k b, k c, k^2 S)$. Using homogenization and dehomogenization procedures, I can eliminate variable $c$ and then work with formulas as usual, adding $c$ back into the final result. The benefit is one less variable to search over.

pine jettyBOT
#

uoSqoɔɐſ

olive wing
#

Any ideas on a more general approach?

For example, is there a general way to decompose formulas into ''symmetric'' and ''residual'' parts such that symmetric part is invariant under a transformation, and residual part is minimal in some sense? We could remove residual part to restrict ourselves to ''good'' formulas. Or we could try to measure the residual part and add this value as an error term into fitness function, thus forcing the algorithm to prefer ''better'' formulas. For example, if we want homogeneous polynomials of degree 2 over $x$ and $y$, a polynomial $x^2 + 3 x y + 6 x + 2$ can be decomposed as a sum of $x^2 + 3 x y$ and $6 x + 2$.

pine jettyBOT
#

uoSqoɔɐſ

nova cedar
#

hmm what sort of formulas are you wanting to find in general outside of heron's formula?

#

the more information you give it about symmetry and so on is sort of cheating isn't it?

brave crypt
#

Are you familiar with stuff like computational algebraic geometry and grobner basis? Admittedly I'm not very familiar myself but it sounds related

olive wing
#

School geometry formulas in general sense, like when some values on a picture are known and we want to find some unknown one. For example, to derive a length of a cevian in a triangle with known sides which splits its side in a given ratio.

#

well, I don't think it's cheating if we can see the symmetry beforehand

nova cedar
#

sure, but where do you decide to draw the line for what you can see beforehand?

#

if you look long enough you can just derive the formula yourself and side step the whole process

olive wing
#

Yeah, I'm kinda familiar with groebner bases. That was another thing to think about :) I just wanted to use genetic programming because trigonometry formulas are usually rather simple in a sense that you usually use only arithmetic operations, square/cubic roots and rarely get a degree higher than 2-4.

#

@nova cedar let's say that the more I see, the better for me. Indeed, there are some results like with determinant formula when the symmetries found are enough to make the fitting formula unique. But there are no general approach to do that afaik, and I want a computational solution to think less anyway.

brave crypt
wide spear
#

JacobSon, looking into Galois theory and computational algebraic geometry may be of interest to you

wide spear
#

Oh hello stanford student

#

No

#

Can't you just do regression and find the best zipf parameters and see how good the fit is