Hot answers tagged

54

Julia, at this point (May 2019, Julia v1.1 with v1.2 about to come out) is quite mature for scientific computing. The v1.0 release signified an end to yearly code breakage. With that, a lot of scientific computing libraries have had the time to simply grow without disruption. A broad overview of Julia packages can be found at pkg.julialang.org. For core ...


28

If not, is it possible to give a rough order-of-magnitude estimate for how long I should wait before considering it again? My rough, order-of-magnitude estimate of how long it takes computational science languages to mature is around a decade. Example 1: SciPy started in 2001 or so. In 2009, Scipy 0.7.0 was released, and the ODE integrator had an interface ...


23

I believe Julia is worth learning. I have used it to produce a few research finite element codes, and produce them very quickly. I have been over all very pleased with my experience. Julia has enabled a workflow for me that I have found difficult to achieve with other languages. You may use it as a prototyping language like MATLAB, but unlike MATLAB when ...


11

Yes, lots of people have. Automatic Jacobian sparsity handling shows up in the second tutorial of DifferentialEquations.jl, where it's able to run sparsity detection on normal Julia code to get the sparse form and perform coloring to then specialize the matrix computations. Then the tutorial ends by showing how you can swap out linear solvers for Newton-...


8

From my experience Julia isn't ready for (scientific) everyday use yet (I'm talking about the stabilized version 0.4 of march 2016). The language itself is nice, feature rich and consistent; a refreshing step forward from both matlab and python. There are certainly uses cases where Julia is a good choice even at this early stage. But if you need reliable and ...


7

When one says an algorithm is of order $O(n)$, that may mean that the complexity is given by: $c + b*n$. With every new element you add you increase in runtime (effectively). What mathematically minded people often forget is that these statements do not include how large the constants are. That of course carries over to $O(n²)$ and such. I can not answer ...


6

I think the question is just too subjective to answer. In the end, there are excellent C++ libraries for nearly everything that has to do with the solution of PDEs, whereas they are largely missing in the Julia environment. Examples that come to mind are PETSc/Trilinos for linear algebra, deal.II/libmesh/FEniCS for discretizations, etc. You will have to ...


5

I would've posted this in a comment, but I unfortunately don't have enough reputation. This answer (https://stackoverflow.com/a/42610074/9796552) should provide enough to help you achieve what you want. In short, you can use Julia's Sys module which contains functions dedicated to retrieving system information.


4

Looks like everything is working relatively OK? Your matrix is of order 1e10, so residuals of 1e-4 are actually close to machine precision. The convergence criterion is indeed violated, but not by much; not sure what's going on there, are you sure Arpack really guarantees it or is it a best effort kind of thing? It surprises me that you get different results ...


4

That depends on whether $f$ is differentiable with respect to $x$ and $y$, and whether the function is convex/concave in $x$/$y$. In the simplest case, you can just write down the necessary optimality conditions $$ \begin{pmatrix} \nabla_x f(\bar x,\bar y) \\ \nabla_y f(\bar x,\bar y) \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix} $$ for the saddle ...


4

It seems that this is tied to how Julia generates random numbers; I've opened a discussion on the Julia Language site. The current implementation of Julia's random number generator for the default range [0,1) for floats (in other words, calling simply rand()) always produces a 0 in the least significant bit for some reason or another (unlike MATLAB, for ...


3

The parameter can be any type, so here I pass in a time-dependent function for p and use it in the differential equation: # Packages library(tidyverse) library(diffeqr) library(JuliaCall) diffeq_setup() # Drift function f <- function(u,p,t){ du1 = p(t) return(c(du1)) } # Diffusion function g <- function(u,p,t){ du1 = 0 # note that there is ...


3

It's hard to get around the allocations implicit to SymPy in this case. It wants to allocate the matrix, so the easiest thing to do would be, as you show, build individual scalar functions. But then composing those together can be a bit of a hassle, since you don't want to put them into an array since they are all different types and that would then ruin the ...


3

This is not a good way to do modern programming for many reasons. First of all, as you pointed out, this kind of code is hard to read and maintain. Secondly, this tends to be done in old versions of Fortran for reasons which are no longer a problem. Namely, old versions of Fortran didn't have ways to "bundle together" objects. If you made different arrays ...


2

It's an entire programming language with a large community, so it's pretty much impossible to dig up all examples of its usage in these fields, but I can point to a few resources to get you started. These are ones that come to mind, but note I'm not a theoretical or quantum chemist so I am not very familiar with this area. QuantumOptics.jl has a community ...


1

OK, so with new version in edit: it's not your fault, it's https://github.com/JuliaLinearAlgebra/Arpack.jl/issues/87. You can either call Arpack manually yourself, or even better use a pure-julia solver (KrylovKit.jl and IterativeSolvers.jl are good choices)


1

I have to options to extract data from Excel documents: ExcelReaders Taro Once you have the data you can use Gadfly.


Only top voted, non community-wiki answers of a minimum length are eligible