« first day (946 days earlier)      last day (2285 days later) » 

12:55 AM
@LuisMendo I also like the empty product factoid at the end of this Numberphile video. In essence, 1 is the result of the product of no primes.
 
 
9 hours later…
10:08 AM
@flawr this is why your method does better ^^
Piotr's method will give a gradient at ~45 deg direction when all nodes (but P) have the same value
 
 
1 hour later…
11:09 AM
Cool, it is nice to hear that!
 
As when I get values, I get them in elements, I was thinking on interpolating to nodes using the same technique (angular weights), so hopefully the gradient will match correctly the values
 
That might actually be a good idea, let us know whether it works:)
 
sure
I'll stop annoying you for a bit :D
 
You're certainly not annyoing me!
I like triangles :D
 
11:17 AM
@AnderBiguri I was talking about triangles, not about LSD!
 
wait... so LSD is not necessary for working with triangles?
that makes sense, it is annoying to be removing the lizards from the code all time
 
=P
BTW: Do you iterate over the nodes or over the elements?
 
for what?
the gradient? Firs elements, for \ , then nodes, for 1/2pi*sum(...
 
For calculating the gradient on the ndoes?
 
11:29 AM
maybe you can try to do it all within the loop over elements to speed it up a little bit
 
let me profile
hes, half the time is element loop, half is node loop
Essentially you mean that once computed the element gradient, take the nodes and update their value by nodegrad=nodegrad+elemgrad*angle/2pi
that makes sense, plus I do not need a list with each nodes neighbours
 
hi people.
According to you, which is the best book in numerical analysis of differential equations?
I have A. Iserles' book https://www.amazon.com/Numerical-Differential-Equations-Cambridge-Mathematics/dp/0521734908 (I'm a math student really interested in numerical analysis)
 
Does it have to be the best book, or is a good book enough?
 
11:45 AM
@Dev-iL a good book is enough ;)
I meant the best book in your opinion :)
 
I don't remember a specific book, but maybe this well-known general-purpose book has some useful links - instructor.sdu.edu.kz/~merey/…
 
@Dev-iL thanks. I've taken a (rapid) peek at the summary and it seems good
 
Which year are you in?
 
Cool. Enjoy :)
 
@AnderBiguri I'm a maht student (in Italy). I'm attending the 3 year
math*
 
11:53 AM
@Dev-iL "Engineering mathematics" When it doesn't work, hit it with a hammer. If it still doesn't work, hit it again.
 
@feddy Verona area :P from your profile yes
My brother lived in Padova for a while, went to visit, and went to Verona too
very pretty
Ah maths, a tough degree.... I should learn more I always get stuck when maths arise. I do what @Adriaan said, every time
 
yes really nice place @AnderBiguri :)
Haha, are u and engineer?
 
I really liked watching the city from Castel San Pietro
@feddy yup
 
@Adriaan Rather, What doesn't come by force, comes by more force
 
You seem to know my city better than me lol ;)
 
11:56 AM
(Cheated, googled "Verona hill")
 
I thought u were a numerical analyst
hahahha
 
I do numerical programming yes
all the time
My job could be done by a mathematician and is often done by matematicians
I just kind of managed to get the Phd on it and here I am, asking every tiny problem to the real mathematicians
 
Oh, i see :) You're the first kind engineer I know
(just joking :P )
 
ha, of course you are joking. I am not kind.
:P
 
His beard gives him a very high cuddleability factor
 
12:02 PM
@Adriaan its quite short now :(
 
Mine as well; had a one-sided trimming "accident", so it's cropped short for the time being
Nothing major; went from 10cm to 4 or so, instead of the desired 7
 
hahaha that happened once to me. Head of trimmer broke mid shave and got completely razored chunk. My gf looked at me weirdly for 2 days, as I shaved completelly
 
12:28 PM
@AnderBiguri yeah exactly:)
if you're interested in FEM and PDE I like recommending "Numerical Models for
Differential Problems" by Quarteroni.
 
@flawr Is that like the pizza? Quarteroni Staggioni?
 
@Adriaan it has pizza on the front:
and it does have a lot of pretty pictures:)
(including triangles)
 
:D pretty pictures
Probably using jet :(
 
not sure whether it is matlab in the first place
 
12:34 PM
@Adriaan it's "quattro stagioni" ;) ahah
 
jet is not MATLAB specific!
 
didn't know that, but makes sense
but jet is more rainbowy than parula
 
thanks @flawr, you're not the first people that recommends me that book :)
 
@feddy just know it is a little bit advanced but covers a wide range of topics in partial differential equations, but it doesn't really cover ODE
and I'm pretty sure you can find it in a high quality version on lib gen or so
 
@flawr what's "lib gen"? Maybe this? sites.google.com/site/themetalibrary/library-genesis
 
12:42 PM
exactly:)
 
12:55 PM
@AnderBiguri I think you should add an answer using that implicit GPU interpolation you mentioned, to this question.
 
1:17 PM
@flawr thanks :)
 
1:36 PM
@Dev-iL let me check
hum not sure if its useful
-2
Q: 6th Degree Polynomial and Chebyshev minmax Matlab

Sidiropoulos AndreasI have to find the 6th degree polynomial for the function $f(x)=xe^x$. After which the use of the Chebyshev min-max approach I have to use the list grade polynomial approach with respect to the fault 0.01 at [-1,1]. I don't think that I can use Taylor or Maclaurin. Any idea? I use only Matlab.

teacher responding student, or random nutjob?
 
1:54 PM
it must have been removed
b/c i only see the question
 
It said "I have eyes everywhere. Enjoy your summer,september is coming."
 
oh nice
 
2:09 PM
@AnderBiguri needs 1 more close vote
 
I voted
o/
 
\o
How's life in triangleland?
 
◁△▷△◁▷▷△◁△△▷
 
There is no down arrow there....
 
Just testing flawr answer which seems the best. Plus, I may use the same tipe of interpolation for the fucntion values in the nodes, hopefully filling the gap that that dude was telling me about
@biggi_ ▽ for you, and only you. Please do not share
 
2:21 PM
sounds great!
 
hows your life going
 
Fine, thanks. I was going to starve to death then I remembered I hadn't had breakfast yet. I just finished breakfast, so all's back to normal :D
 
hahaha
remember to feed
its.... basic
 
I guess :P
 
2:39 PM
@AnderBiguri I now tried proving that it actually converges to something like a gradient, but it seems hopeless with the usual methods.
 
I have no idea what the usual methods are even :/. But I did try some random examples and it gives good/reasonable results
both parabola and plane give quite consistent results, and when I used an image, it gives reasonable directions also. I am going to comment this tomorrow with my supervisor, who is a mathematician, see what comes out of it
 
Ok well there is a more or less trivial result: Any convex combination of the gradients of neighbouring triangles does converge to the actual gradient (converge in the sens of getting finer and finer meshes)
at least linearly in the triangle diameter (this is similar to the linear convergence of a one sided difference quotient for approximating the derivative)
 
So, if each value of the gradient in the element gets closer to the real value when the triangles are smaller, then its a good approximation
But while I can test that numerically, I assume for "proper" test, it needs to be shown mathematically, right?
 
right: the rought idea is that if we have a C1 function (meaning it is differentiable and it has continuous gradient) and we interpolate linearly
then there is always some point on each triangle where the gradient of the triangle is equal to the gradient of the function
so you probably need to assume that the function is a little bit more than C1 (more regular, e.g. the gradient is lipschitz continuous I think might suffice) then you can say that the smaller you make your triangles, the better the approximation becomes
or something like that...
 
2:56 PM
I am googling one by one each of the terms you mention
But I think I follow
 
it is maybe worth convincing yourself of the 1d analogues:)
 
I can understand them, I am not exposed to the terms so I need to google what they mean
@flawr Here I don't follow though.
perhaps because I donkt know the mentioned mate Lipschitz, reading about it
So, as long as my function derivative has a limit (is bounded) , the method approximates the gradient ?
 
I'm not sure it was just a gut feeling:) I'm gonna try to write down the 1d case
1 moment please:)
on hold music
oh wait, I have to speak to someone, might take a while :(
 
no prob, you are helping me loads
 
3:29 PM
ok let us consider the 1d case (the nd case usually uses the same ideas, but is a little bit more complicated to write down)
and first we consider one "triangle", or interval in our case
we want to interpolate a function f with some polynomial p of a given degree
let degree(p) = n
we do this by taking (n+1) points x0,x1,...,xn and fitting the polynomial through them
then the "standard" result in interpolation is that
f(x) - p(x) = f^(n+1)(y)/(n+1)! * w(x)
where f^(n+1) is the n+1 th deriative, and w(x) is the node polynomial w(x) = (x-x0)*(x-x1)*(x-x2)*...*(x-xn)
(the result is that there is some y in that interval such that this equation holds)
 
wait
Oh OK. So there is an y where f(x)-p(x)=0
 
for x = x0, x1,x2 ,x3 this holds obviously
since w(x1) = w(x2) = ... = 0
 
yes yes, of course, sorry, was thinking is small n :P
 
now if we want to have an inequality |f(x)-p(x)| <= ???
we can use the eequation from above and just use the maximum value of |f^(n+1)(x)| over all x in that interval
and similarly the maximum value of |w(x)| in that interval
then we get a straightforward upper bound
|f(x)-p(x)| <= max_{y} |f^(n+1)(y)| * max_{z} |w(z)|
so now we would obviously like that |f^(n+1)(y)| is bounded on our interval.
this is the case for example when f is (n+1) times coninuously differentiable, AND the interval is compact
 
So.... What we are trying to see is when a polynomial approximation of the function has the error bounded, so we can trust it. But it depends in f, which makes sense.
 
3:41 PM
right!
 
But I don't really have an f. In my case its attenuation coefficient of X-rays, so its not a real function
 
we can apply similar reasoning to the derivatives etc as you can imagine
@AnderBiguri yeah in practice nobody cares as you cannot prove that your x-ray image is differentiable, and it has a limited resolution anyway etc :)
 
:D maths confuse me :D
 
it would just be a little bit of a reassurance that in theory it would make sense:9
 
hahah yeah it does
however, this proves that any polynomial interpolation function will work for a bounded f in our interval
 
3:44 PM
@AnderBiguri for a bounded f^(n+1)
(which is stronger, it implies that f is bounded too)
 
How does that relate to e.g. that angle weighting you do in the nodes? Or does this only truly proves that the gradient method for the elements can be good
 
if for some reason our interval is not compact we need another condition: and lipschitz continuity of f^(n+1) is also sufficient to show that f^(n+1) is bounded
 
@flawr its the same thing, no?
 
@AnderBiguri not quite, but it doesn't really matter:)
 
"lipschitz continuity of f^(n+1) == f^(n+1) is bounded"
ok ;)
we should open another chat sometime not to spam the rest of the people :/ :/ :/ sorry @everyone
@flawr OK, so what have we proved? That the elements will have, generally, a good enough approximation of the gradient?
 
3:52 PM
@AnderBiguri one can see that if we make our interval smaller then max_z|w(z)| will become smaller too
 
I see. That shows convergence then
 
the next step is generalizing over not only just one interval but the whole domain we're working in, ususlly just done by maxing over the whole domain instead of one interval
right
in your 2d case we use a (piecewise) linear interpolation of the "actual" function
now we can (probably:) apply a similar theorem as the above in 2d
and say that our linear interpolatin will not be too bad (converge to the actual function)
and similarly that the error in the gradient is also not too bad
and since our gradient is constant within each element
it basically does not matter where within the element we compare the gradient of our interpolation to the true gradient
(we have an upper bound for both)
 
I see
 
4:12 PM
sorry that was a phone call:)
and this means we could choose any of the surrounding gradients at a given node and set that as our interpolated gradient
to still get the same error bound
and therefore we could also choose any convex combination of the surrounding gradients and still get the same error bound "for free"
but that doesn't mean there are all the same, maybe by choosing a certain convex combination one could get a better convergence
but taht would mean we need a different technique for proving that.
 
So, if polynomial interpolate -> there is an upper bound to the error we can have (as long as f^(n+1) is bounded) -> maximum error exist in nodes too -> we are not doing crazy stuff, our approximation is valid for small triangles
For a linear aproxomation (as you did in your post), then f^1 has to be bounded? so The gradient
 
@AnderBiguri our polynomial has degree 1
so we need f^2 to be bounded
 
oops yes
 
So we need f in C2
 
e.g. a parabolloid is OK
 
4:25 PM
well pretty much any function that you can write using elmentary function should be ok:) (just dont divide by zero:)
 
But, z=x^3 ->z'=3x^2->z''=6x, not bounded
 
your domain is finite (and compact) (I hope) therefore it is bounded
 
ah, true
so it has to be C2 only in the domain
I am though assuming the same logic for 1D applies for 2D (or even 3D), that true?
 
yeah, sorry for not mentioning that - as a math person I always think of the domain as part of the function:)
@AnderBiguri yeah pretty much, notation just gets weirder
 
neat. I just learned a lot
 
4:29 PM
I hope I didn't confuse too much!
 
just a bit, but I did got through :D
 
what is worth noting: these are arguments usually used in the FD-world, the FEM world uses quite a different theory (hilbert (function)-spaces and the lax milgram theorem in short) where you don't think of interpolating single nodes, but you consider a Hilbert space of functions, and for computing you just consider the space of piecewise linear function on your triangulation.
 
that is too much to process for the day :/
 
constructing your function on the basis of tent functions rings a bell
 
I have seen a lot of that for when I did EIT, but forgot most of it
not that I understood it 100%
 
4:49 PM
@AnderBiguri well it is not important, I just wanted to say that this was more theory borrowed from FD and not classical FEM
 
roger that
 
 
6 hours later…
10:46 PM
Using finite differences, how u write the jacobian matrix of u(x)*u'(x) ? If I call D the discretization matrix for the first derivative, I find out the expression diag(D*u)+diag(u)*D. It seems good, what do u think?
 
what exactly do you mean by u(x)*u'(x)? scalar function with 1 variable and the second factor is the derivative?
no, jacobian would be pointless
 
u is the solution of a differential system, and it's discretized with finite differences
 
@feddy what is the domain and codomain? is u(x) scalar? is x scalar?
 
11:01 PM
It's in a boundary value problem I'm trying to solve
for exampl, u''(x) + u(x)*u'(x)=0, u(0)=1, u(1)=3 (I just invented it)
 
so u(x) is a scalar as well as x? in that case the jacobian of u is just the derivative u'
 
oh yes
 
so the "jacobian" of u(x)*u'(x) is just the derivative u'(x)^2 + u(x)*u''(x)
 
I think we are having a misunderstanding
 
we probably are
flawr and I have reached the same conclusion so you must be the source of the confusion
 
11:06 PM
u're right, I'm sorry.
 
@AndrasDeak democracy ftw
 
I discretized the differential equation introducing m equally spaced nodes x_i, in the interval (a,b).
And using finite differences, I get the matrix A and B which applied to a vector u, gives me u'' and u'.
The equation becomes: A*u + spdiags(u,0,m,m)*(B*u)=0.
The zero of this equation involving matrices is the solution, and, in order to find it, I have to solve a non-linear system with newton.
So I call F=@(u) Au + spdiags(u)*(Bu), and the dF/du=A + diag(B*u)+diag(u)*B.
 

« first day (946 days earlier)      last day (2285 days later) »