# Numerics

**URL:** https://discourse.julialang.org/c/domain/numerics/20.md?page=12

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 13

---

## [Smoothed Spline Interpolation compatible with ForwardDiff?](https://discourse.julialang.org/t/smoothed-spline-interpolation-compatible-with-forwarddiff/104344)

<div class="topic-metadata">

**Author:** [@MHaensel](https://discourse.julialang.org/u/MHaensel)\
**Replies:** 6\
**Last updated:** [October 23, 2023, 5:22am UTC](https://discourse.julialang.org/t/smoothed-spline-interpolation-compatible-with-forwarddiff/104344 "2023-10-23T05:22:13Z")

</div>

Hi, I am wondering whether someone has insights on the following: I have a complicated function inside which I perform smoothed (1-D) Cubic Spline interpolation using an irregular grid. Right now I am using the Dierckx…

---

## [Help with numerically unstable algorithm](https://discourse.julialang.org/t/help-with-numerically-unstable-algorithm/104911)

<div class="topic-metadata">

**Author:** [@enweg](https://discourse.julialang.org/u/enweg)\
**Replies:** 13\
**Last updated:** [October 20, 2023, 12:12pm UTC](https://discourse.julialang.org/t/help-with-numerically-unstable-algorithm/104911 "2023-10-20T12:12:44Z")

</div>

Hi, I have this small algorithm that is supposed to create a matrix based on random eigenvalues and eigenvectors. Since the last few rows of the matrix need to satisfy some criteria, I end up with essentially the follow…

---

## [Need to find out all eigenvalues and vectors of large Hermitian matrices](https://discourse.julialang.org/t/need-to-find-out-all-eigenvalues-and-vectors-of-large-hermitian-matrices/105048)

<div class="topic-metadata">

**Author:** [@AliceandBob](https://discourse.julialang.org/u/AliceandBob)\
**Replies:** 1\
**Last updated:** [October 17, 2023, 5:25am UTC](https://discourse.julialang.org/t/need-to-find-out-all-eigenvalues-and-vectors-of-large-hermitian-matrices/105048 "2023-10-17T05:25:40Z")

</div>

Hi. I need to find out ALL the eigenvalues and eigenvectors of large Hermitian matrices. Half of the entries are zeros so maybe it is worth using the sparse matrix. I am now using eigen() from the standard library Linear…

---

## [Update par after every time step](https://discourse.julialang.org/t/update-par-after-every-time-step/104884)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 3\
**Last updated:** [October 12, 2023, 6:28am UTC](https://discourse.julialang.org/t/update-par-after-every-time-step/104884 "2023-10-12T06:28:48Z")

</div>

When I use DifferentialEquations.jl to solve a set of stiff coupled ODEs, my function is something like function f!(du, u, par, t) V = g(u, par) # calculate V based on u and some other parameters du .= ??? # some…

---

## [Bring back to life Julia 0.4 code](https://discourse.julialang.org/t/bring-back-to-life-julia-0-4-code/104820)

<div class="topic-metadata">

**Author:** [@berceanu](https://discourse.julialang.org/u/berceanu)\
**Replies:** 3\
**Last updated:** [October 11, 2023, 11:23am UTC](https://discourse.julialang.org/t/bring-back-to-life-julia-0-4-code/104820 "2023-10-11T11:23:01Z")

</div>

I am trying to port an older Julia 0.4 code that uses ODE.jl and I find it stumbles on this line tout, aout = ode45((t,a)-\>F(t,a, N,p,q,m₀,n₀,J,σ,Ω,κ,f), a₀, \[0., 10\]) The code is a single, small file. The error I get …

---

## [Set parameter dependent time steps using OrdinaryDiffEq](https://discourse.julialang.org/t/set-parameter-dependent-time-steps-using-ordinarydiffeq/104759)

<div class="topic-metadata">

**Author:** [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Replies:** 2\
**Last updated:** [October 9, 2023, 6:09pm UTC](https://discourse.julialang.org/t/set-parameter-dependent-time-steps-using-ordinarydiffeq/104759 "2023-10-09T18:09:24Z")

</div>

Hi, I have a question about how to set time-dependent time steps (or maximum time steps) for solving an ODE. For a quick demo, say we are dealing with this simple ODE: using OrdinaryDiffEq f(u, p, t) = 1.01 \* p \* u u0…

---

## [Where is backslash (\\) implemented?](https://discourse.julialang.org/t/where-is-backslash-implemented/104693)

<div class="topic-metadata">

**Author:** [@SupernovaTitanium](https://discourse.julialang.org/u/SupernovaTitanium)\
**Replies:** 9\
**Last updated:** [October 8, 2023, 8:08am UTC](https://discourse.julialang.org/t/where-is-backslash-implemented/104693 "2023-10-08T08:08:15Z")

</div>

Hi, I’m new to Julia. Recently, I’ve used the backslash (\\) operator to solve a linear system. However, I don’t know how it is implemented. I wanted to know it so I traced the code. I am able to locate to line 1110 at j…

---

## [(Insanely-) Higher Order Derivatives](https://discourse.julialang.org/t/insanely-higher-order-derivatives/104455)

<div class="topic-metadata">

**Author:** [@NitinGupta](https://discourse.julialang.org/u/NitinGupta)\
**Replies:** 36\
**Last updated:** [October 6, 2023, 10:29pm UTC](https://discourse.julialang.org/t/insanely-higher-order-derivatives/104455 "2023-10-06T22:29:58Z")

</div>

What’s the recommended way to obtain insanely high order derivatives of a complex valued (terribly complicated) function in Julia? Presently, I’m using TaylorSeries and it works fantastically. However, I need to compute…

---

## [Using SciMLOperators in LinearSolve](https://discourse.julialang.org/t/using-scimloperators-in-linearsolve/104596)

<div class="topic-metadata">

**Author:** [@j35](https://discourse.julialang.org/u/j35)\
**Replies:** 0\
**Last updated:** [October 4, 2023, 11:52pm UTC](https://discourse.julialang.org/t/using-scimloperators-in-linearsolve/104596 "2023-10-04T23:52:32Z")

</div>

I’m trying to use FunctionOperators from SciMLOperators, to solve a linear problem using matrix free method. But I’m getting wrong result. What am I doing wrong here? Thanks in advance. Here is the MWE. using SparseArr…

---

## [Output automatic time steps taken by solvers while specifying \`saveat\`](https://discourse.julialang.org/t/output-automatic-time-steps-taken-by-solvers-while-specifying-saveat/104578)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 1\
**Last updated:** [October 4, 2023, 6:26pm UTC](https://discourse.julialang.org/t/output-automatic-time-steps-taken-by-solvers-while-specifying-saveat/104578 "2023-10-04T18:26:06Z")

</div>

Many solvers in OrdinaryDiffEq.jl for solving stiff ODEs use automatic time-stepping. From what I understand, if I specify saveat, then sol.t is the time steps I specify in saveat, and if I leave saveat untouched, then s…

---

## [Solving PDEs over distributions](https://discourse.julialang.org/t/solving-pdes-over-distributions/104480)

<div class="topic-metadata">

**Author:** [@smartalecH](https://discourse.julialang.org/u/smartalecH)\
**Replies:** 1\
**Last updated:** [October 1, 2023, 11:49pm UTC](https://discourse.julialang.org/t/solving-pdes-over-distributions/104480 "2023-10-01T23:49:18Z")

</div>

Suppose I have an arbitrary PDE solver I’ve built. This solver solves simple linear problems that look like Ax=b. Now suppose I specify a distribution of source terms (the b vector). This could be a straightforward prob…

---

## [Cholesky with sparse matrices](https://discourse.julialang.org/t/cholesky-with-sparse-matrices/72494)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 8\
**Last updated:** [September 29, 2023, 6:31am UTC](https://discourse.julialang.org/t/cholesky-with-sparse-matrices/72494 "2023-09-29T06:31:02Z")

</div>

Should the following example work? julia\> using LinearAlgebra julia\> using SparseArrays julia\> # 10x10 sparse matrix A = sprand(10, 10, 1.0) 10×10 SparseMatrixCSC{Float64, Int64} with 100 stored entries: 0.904…

---

## [Imposing constraints on solutions by DifferentialEquations.jl](https://discourse.julialang.org/t/imposing-constraints-on-solutions-by-differentialequations-jl/104255)

<div class="topic-metadata">

**Author:** [@NitinGupta](https://discourse.julialang.org/u/NitinGupta)\
**Replies:** 29\
**Last updated:** [September 27, 2023, 2:56pm UTC](https://discourse.julialang.org/t/imposing-constraints-on-solutions-by-differentialequations-jl/104255 "2023-09-27T14:56:39Z")

</div>

I have N linearly coupled ODEs that DifferentialEquations.jl is able to solve - but with a huge amount of error. I detect the error because the solutions are supposed to follow a particular constraint at all time steps b…

---

## [How to solve volterra integral equation of second kind?](https://discourse.julialang.org/t/how-to-solve-volterra-integral-equation-of-second-kind/94332)

<div class="topic-metadata">

**Author:** [@Jian\_ZUO](https://discourse.julialang.org/u/Jian_ZUO)\
**Replies:** 21\
**Last updated:** [September 19, 2023, 8:39am UTC](https://discourse.julialang.org/t/how-to-solve-volterra-integral-equation-of-second-kind/94332 "2023-09-19T08:39:00Z")

</div>

Hi everyone, I need to solve a Volterra integral equation as follows: Here f(y) and K(x, y) are known functions (nonlinear) As an example, take f(y) = 3x^3; K(x, y) = 1 - exp(x). I saw this post about solving Volt…

---

## [Definition of an integral function whose argument is the upper limit of integration](https://discourse.julialang.org/t/definition-of-an-integral-function-whose-argument-is-the-upper-limit-of-integration/103946)

<div class="topic-metadata">

**Author:** [@aburousan](https://discourse.julialang.org/u/aburousan)\
**Replies:** 2\
**Last updated:** [September 18, 2023, 2:01pm UTC](https://discourse.julialang.org/t/definition-of-an-integral-function-whose-argument-is-the-upper-limit-of-integration/103946 "2023-09-18T14:01:55Z")

</div>

Hi, I want to define a function let’s say, $$ f(x) = \\int\_0^x u^2 du /(e^{u^2+16} +1)^{\\frac{3/2}}$$ How can I do this?, A naive approach is to use a loop and just each time calculate the whole thing. But is there any…

---

## [Finding the minimizer region of a function](https://discourse.julialang.org/t/finding-the-minimizer-region-of-a-function/103819)

<div class="topic-metadata">

**Author:** [@yosuga](https://discourse.julialang.org/u/yosuga)\
**Replies:** 14\
**Last updated:** [September 17, 2023, 6:45pm UTC](https://discourse.julialang.org/t/finding-the-minimizer-region-of-a-function/103819 "2023-09-17T18:45:26Z")

</div>

As an example, let f be a polynomial, f(z,w) = z + z^-1 + w - w^-1 + 2zw - 5, where z = exp(x\[1\]+iθ\[1\]), w = exp(x\[2\]+iθ\[2\]), x,θ ∈ R^2 Then we can define the Ronkin function as follows. function R(x) function …

---

## [ChainRules for functions that "destroy their input arguments](https://discourse.julialang.org/t/chainrules-for-functions-that-destroy-their-input-arguments/103857)

<div class="topic-metadata">

**Author:** [@lkdvos](https://discourse.julialang.org/u/lkdvos)\
**Replies:** 1\
**Last updated:** [September 16, 2023, 10:31pm UTC](https://discourse.julialang.org/t/chainrules-for-functions-that-destroy-their-input-arguments/103857 "2023-09-16T22:31:38Z")

</div>

Some functions have the behaviour of using their inputs as workspace, and by doing so their documented behaviour is that they destroy the input. As an example, things like svd! work in such fashion. While in general, mu…

---

## [Examples of FINUFFT?](https://discourse.julialang.org/t/examples-of-finufft/103708)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 4\
**Last updated:** [September 9, 2023, 9:51pm UTC](https://discourse.julialang.org/t/examples-of-finufft/103708 "2023-09-09T21:51:16Z")

</div>

I’m trying to learn some basic Non-Uniform FFT. I want to see if I can get a frequency spectrum of a laser pulse with a NUFFT type 1 using the FINUFFT.jl library. Here’s the example: using FFTW using FINUFFT c = 2.99…

---

## [Generalized matrix\*vector operation](https://discourse.julialang.org/t/generalized-matrix-vector-operation/103683)

<div class="topic-metadata">

**Author:** [@SantiagoOrtiz](https://discourse.julialang.org/u/SantiagoOrtiz)\
**Replies:** 1\
**Last updated:** [September 9, 2023, 1:32am UTC](https://discourse.julialang.org/t/generalized-matrix-vector-operation/103683 "2023-09-09T01:32:10Z")

</div>

Hi everyone, Take the following matrix and vector: vij = \[-2 -2 -2; 1 0 0; 0 1 0; 0 0 1; 1 1 1\] xj = \[0.1 0.15 0.1\] This operation will work, resulting in a vector (as expected): vij\*xj' However, if the matrix is re…

---

## [How Preconditioners work for multiple eigenpairs](https://discourse.julialang.org/t/how-preconditioners-work-for-multiple-eigenpairs/103456)

<div class="topic-metadata">

**Author:** [@Neo](https://discourse.julialang.org/u/Neo)\
**Replies:** 4\
**Last updated:** [September 3, 2023, 6:16am UTC](https://discourse.julialang.org/t/how-preconditioners-work-for-multiple-eigenpairs/103456 "2023-09-03T06:16:25Z")

</div>

I am using Preconditioners.jl to precondition the eigensolver lobpcg in IterativeSolvers.jl. But the preconditioners didn’t worked for more than one vectors. Any ideas? This works when I need only one eigenpair. using …

---

## [Numerical solutions of eigenvalue problems with linear constrains](https://discourse.julialang.org/t/numerical-solutions-of-eigenvalue-problems-with-linear-constrains/103325)

<div class="topic-metadata">

**Author:** [@swish47](https://discourse.julialang.org/u/swish47)\
**Replies:** 6\
**Last updated:** [September 1, 2023, 2:34pm UTC](https://discourse.julialang.org/t/numerical-solutions-of-eigenvalue-problems-with-linear-constrains/103325 "2023-09-01T14:34:35Z")

</div>

As an example, one need to search the least or the least second eigenvalue and corresponded eigenvector of matrix A, under constraint Bx=c, where B is coefficient matrix, x is eigenvector under search, and c is a constan…

---

## [Instability with Gauss-Hermite quadrature](https://discourse.julialang.org/t/instability-with-gauss-hermite-quadrature/103408)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 0\
**Last updated:** [August 31, 2023, 2:48pm UTC](https://discourse.julialang.org/t/instability-with-gauss-hermite-quadrature/103408 "2023-08-31T14:48:10Z")

</div>

Hello, I would like to approximate the log-density of a univariate distribution \\pi\_0 with a basis of Hermite polynomials. To compute the coefficients of the expansion, I am using the Gauss-Hermite quadrature. I am gett…

---

## [Promote on ArbFloat issue?](https://discourse.julialang.org/t/promote-on-arbfloat-issue/102839)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 5\
**Last updated:** [August 30, 2023, 9:27pm UTC](https://discourse.julialang.org/t/promote-on-arbfloat-issue/102839 "2023-08-30T21:27:25Z")

</div>

I am trying to make sure that all of my ArbFloats are with the same precision. I do not understand why promote works like that: a = ArbFloat(2, digits=200) typeof(a) # ArbFloat{691} typeof.(promote(a, ArbFloat(0.0))) #…

---

## [Printing exact decimal representations](https://discourse.julialang.org/t/printing-exact-decimal-representations/103365)

<div class="topic-metadata">

**Author:** [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)\
**Replies:** 2\
**Last updated:** [August 30, 2023, 12:06pm UTC](https://discourse.julialang.org/t/printing-exact-decimal-representations/103365 "2023-08-30T12:06:36Z")

</div>

I don’t think there is, but it would be great if there was one.

---

## [Solving Poisson PDE in an arbitrary 2D geometry, under different types of both internal and external boundary conditions](https://discourse.julialang.org/t/solving-poisson-pde-in-an-arbitrary-2d-geometry-under-different-types-of-both-internal-and-external-boundary-conditions/103130)

<div class="topic-metadata">

**Author:** [@Zeljko](https://discourse.julialang.org/u/Zeljko)\
**Replies:** 6\
**Last updated:** [August 29, 2023, 1:10pm UTC](https://discourse.julialang.org/t/solving-poisson-pde-in-an-arbitrary-2d-geometry-under-different-types-of-both-internal-and-external-boundary-conditions/103130 "2023-08-29T13:10:21Z")

</div>

Fairly new to Julia, and I am trying to solve a 2D PDE problem of the form: with finite differences where the 2D domain may not necessarily be a pure rectangle (e.g., a cross-like shape, or rectangle with internal rec…

---

## [State and Parameter vectors for SciML applications](https://discourse.julialang.org/t/state-and-parameter-vectors-for-sciml-applications/69463)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 5\
**Last updated:** [August 28, 2023, 9:05am UTC](https://discourse.julialang.org/t/state-and-parameter-vectors-for-sciml-applications/69463 "2023-08-28T09:05:33Z")

</div>

New State & Parameter Vector Types I’m hoping for others’ thoughts on this idea, including suggestions, alternatives, rotten fruit, etc. All input is welcome. The “Problem” Users have tried to add unit handling to their…

---

## [Making Float16 LU better in generic\_lu.jl](https://discourse.julialang.org/t/making-float16-lu-better-in-generic-lu-jl/102612)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 3\
**Last updated:** [August 26, 2023, 3:11pm UTC](https://discourse.julialang.org/t/making-float16-lu-better-in-generic-lu-jl/102612 "2023-08-26T15:11:18Z")

</div>

I finally stumbled across generic\_lufact! here. This seems to be where Float16 goes to die. I made a copy and threaded the critical loop and things got a lot better for half precision work on my Mac. Threading this fun…

---

## [Setting up implicit solvers to beat the performance of explicit solvers](https://discourse.julialang.org/t/setting-up-implicit-solvers-to-beat-the-performance-of-explicit-solvers/102392)

<div class="topic-metadata">

**Author:** [@JordiBolibar](https://discourse.julialang.org/u/JordiBolibar)\
**Replies:** 10\
**Last updated:** [August 24, 2023, 4:16pm UTC](https://discourse.julialang.org/t/setting-up-implicit-solvers-to-beat-the-performance-of-explicit-solvers/102392 "2023-08-24T16:16:45Z")

</div>

We are trying to benchmark implicit solvers for an ice flow diffusivity PDE. So far we’ve stuck to explicit ones, but now we would like to cover all of them. Since many implicit solvers from DifferentialEquations.jl requ…

---

## [Memory allocation, left-division operator](https://discourse.julialang.org/t/memory-allocation-left-division-operator/103111)

<div class="topic-metadata">

**Author:** [@AdaemmerP](https://discourse.julialang.org/u/AdaemmerP)\
**Replies:** 5\
**Last updated:** [August 24, 2023, 8:50am UTC](https://discourse.julialang.org/t/memory-allocation-left-division-operator/103111 "2023-08-24T08:50:22Z")

</div>

Why does the left-division operator allocates comparatively that much memory? # Data x = \[ones(1000) rand(1000)\] y = rand(1000) # Benchmark I (left-divison) @btime ($x \\ $y) 4.089 μs (29 allocations: 91.67 KiB) 2-ele…

---

## [How to increase precision of solution using Roots.jl and ArbNumerics.jl](https://discourse.julialang.org/t/how-to-increase-precision-of-solution-using-roots-jl-and-arbnumerics-jl/102850)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 28\
**Last updated:** [August 18, 2023, 8:59pm UTC](https://discourse.julialang.org/t/how-to-increase-precision-of-solution-using-roots-jl-and-arbnumerics-jl/102850 "2023-08-18T20:59:06Z")

</div>

I am trying to increase precision for a numeric solution using Roots.jl using ArbFloat (of ArbNumerics.jl). But, when I decrease the tolerance, the outcome does not change. I keep comparing it to the numerical solution…

[Previous page](https://discourse.julialang.org/c/domain/numerics/20.md?page=11)

[Next page](https://discourse.julialang.org/c/domain/numerics/20.md?page=13)
