6 ms·
Sure! But it's a bit surprising that they do not use the language-provided linear solver and write simply f=A\b
by enriquto 5y ago
Sure! But it's a bit surprising that they do not use the language-provided linear solver and write simply f=A\b
- infogulch 5y agoWow! It seems you have the magical capacity to ingest the reference to an equation and instantly derive an intuition for how it works and what it's useful for. Learning technology this advanced has never been seen before by humankind, I hope you share it with the rest of us!
- burnished 5y agoEverything being referenced is stuff you'd learn in a typical technical education as part of either calculus or statistics. Your reply comes off as of defensive in a way that implies that you're shocked some one would know any of this stuff.
- cpp_frog 5y agoNumerical solutions of PDE are hardly studied in a typical technical education in calculus (it requires more theoretical machinery) or statistics (PDEs in statistics is somewhat narrow and specialized).
- infogulch 5y agoMy reply stems from enriquto's misunderstanding of the purpose of the article, which is the "typical technical education" itself. It's like they are wondering why the article even exists, and isn't just a one line reference to the julia docs. Clearly there's nothing wrong with already having specific knowledge of a subject, but questioning the purpose of technical education because you already have it is bizarre. Maybe an analogy would better explain my perspective. I imagine that enriquto would greatly appreciate my latest article, reproduced in its entirety below: # Learn how to write a JSON parser > j = JSON.parse("[1,2]") Fin.
- enriquto 5y agoSorry for the misunderstanding, then. It was not at all my purpose to disparage this article. It is a lovely article and very clearly written and illustrated. I'll state my point following your json parser example. If you write an article about the implementation of several json parsers, you may still want to call JSON.parse at the end, as a sanity check that your implementation is working. The function is right there and you may as well say that! In the present case, since the author has already set-up explicitly Poisson equation as a linear system of equations, it would make sense to call julia's built-in solver. (If only to marvel that it is much, much faster than the simple methods shown before, thus it must make some really fancy stuff inside!)
- infogulch 5y agoI agree with your point that it may be valuable to the reader to also mention common libraries or built-ins that solve the same problem that was discussed in the article somewhere near the end. More generally, linking to sources, docs, related work, or next steps can be very nice for readers to further their education. Framing your original comments with "the author should also mention... a standard solver like CHOLMOD" or "a standard solver like CHOLMOD ... as a sanity check that your implementation is working" as you described would have had a good chance of preventing our communication misfire and avoiding my (perhaps unnecessarily strong) snark.
- alisonkisk 5y agoIt's your job to control your snark, not anyone else's job.
- alisonkisk 5y agoPlease stop attacking other commenters. instead of attacking (the same person, twice!), try to understand what is being said, or ask questions.
- SonicScrub 5y agoThe goal of the article is educate on the mathematics, not a tutorial on how best to do mathematical modelling with Julia. An article like that is better served explaining the inner workings of the Black Box, rather than just using the Black Box.
- phkahler 5y agoBut they should mention the black box after the educational part.
- SonicScrub 5y agoWhy? The goal of the article is not to be a Julia tutorial. Julia is just a convenient demonstrator. Better to make the code as language independent as possible.
- icegreentea2 5y agoWait, how does this work? I'm really rusty, what would the f, A and b correspond to here?
- enriquto 5y agoIt's the common way to solve a linear system in octave, matlab and julia. You have an invertible square matrix A, a vector b of the same dimension, and you want to find a vector x such that "A*x=b". Then you write "x=A\b", which is like "x=A^(-1)*b" but does not get to compute the full inverse matrix (which is useless).
- hasmanean 5y agoDon’t forget APL. I can’t say for sure but I imagine this \ operator came from there.
- mbauman 5y agoIt's not some obscure symbol; it's just division. It just so happens that we typically "divide" matrices from the left when solving equations like this (and matrix "division" isn't commutative) so instead of `a/b` it's `b\a`.
- hasmanean 5y agoYes I know. It’s a solve operator…it’s equivalent to division only in the infinite precision world. The \ operator differs from the / operator in that it doesn’t compute an inverse … it solves the system of equations. Solver algorithms are more numerically stable ( in that you’re much less likely to have large errors due to wacky input data).
- mbauman 5y agoYes, I know. :) I'd just say that solving the system of equations is the best way to divide by a matrix — that's why I put air quotes around "divide" above. In Julia, right-dividing matrices (with `A/B`) actually does the smart adjoint-commuting thing to left-divide it and do the solve (with `(B'\A')'`).
- deleted 5y ago[deleted]