# Numerics

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

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

**Page:** 8

---

## [Best way to implement and solve an ODE with a linearized RHS?](https://discourse.julialang.org/t/best-way-to-implement-and-solve-an-ode-with-a-linearized-rhs/117297)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 2\
**Last updated:** [July 21, 2024, 4:33pm UTC](https://discourse.julialang.org/t/best-way-to-implement-and-solve-an-ode-with-a-linearized-rhs/117297 "2024-07-21T16:33:22Z")

</div>

Say, I have a system \\dot{u} = f(u(t),t). I want to linearize the RHS at u(t\_{n}) and have \\dot{u} = f(u(t\_n),t\_n) + f\_{u}'(u(t\_n),t\_n)\\cdot(u(t)-u(t\_{n})). In terms of DifferentialEquations.jl I can define f(u,p,t) whe…

---

## [3D interpolation in Julia](https://discourse.julialang.org/t/3d-interpolation-in-julia/117035)

<div class="topic-metadata">

**Author:** [@jgr](https://discourse.julialang.org/u/jgr)\
**Replies:** 21\
**Last updated:** [July 20, 2024, 6:25am UTC](https://discourse.julialang.org/t/3d-interpolation-in-julia/117035 "2024-07-20T06:25:02Z")

</div>

I am doing 3D interpolation with the nodes being \[x,y,z\], where x is a 1\*nx vector, y is 1\*ny,1\*nx, the corresponding values to be interpolated is V which is a nx\*ny\*nz matrix. I use Dierckx for 1d/2d interpolation, but …

---

## [Problem on solving periodic solution of ODE using orthogonal polynomial pseudo-arclength method](https://discourse.julialang.org/t/problem-on-solving-periodic-solution-of-ode-using-orthogonal-polynomial-pseudo-arclength-method/117177)

<div class="topic-metadata">

**Author:** [@cc2024](https://discourse.julialang.org/u/cc2024)\
**Replies:** 4\
**Last updated:** [July 18, 2024, 3:33pm UTC](https://discourse.julialang.org/t/problem-on-solving-periodic-solution-of-ode-using-orthogonal-polynomial-pseudo-arclength-method/117177 "2024-07-18T15:33:41Z")

</div>

a simple Duffing equation: dx/dt=xt dxt/dt=F0u-a1x1-a1tx1t-a3x1^3 du/dt=-omegav+u(1-u^2-v^2) dv/dt=omegau+v(1-u^2-v^2) parameters: \[omega;F0;a1t;a3\]=\[2;0.01;1;0.008;0.75\] initial state point: \[x0;xt0;u0;v0\]=\[0;0;1…

---

## [Finding \*all\* the eigenvalues of a sparse matrix?](https://discourse.julialang.org/t/finding-all-the-eigenvalues-of-a-sparse-matrix/116895)

<div class="topic-metadata">

**Author:** [@rafaelbailo](https://discourse.julialang.org/u/rafaelbailo)\
**Replies:** 24\
**Last updated:** [July 18, 2024, 9:22am UTC](https://discourse.julialang.org/t/finding-all-the-eigenvalues-of-a-sparse-matrix/116895 "2024-07-18T09:22:44Z")

</div>

Seems that LinearAlgebra.jl does not work with sparse matrices, and the libraries that do (e.g. Arpack.jl, ArnoldiMethod.jl, KrylovKit.jl) all use iterative methods, which are not efficient to find all the eigenvalues. S…

---

## [Large interpolation error for exponential integrators in DifferentialEquations](https://discourse.julialang.org/t/large-interpolation-error-for-exponential-integrators-in-differentialequations/117047)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 2\
**Last updated:** [July 16, 2024, 7:11am UTC](https://discourse.julialang.org/t/large-interpolation-error-for-exponential-integrators-in-differentialequations/117047 "2024-07-16T07:11:10Z")

</div>

I was recently working with SplitODEProblem using exponential integrators and I noticed a huge error when doing the interpolation of the solution, which I think is wrong. I began to notice this since, by default, the so…

---

## [How can I get specific values out of JuMP's variables?](https://discourse.julialang.org/t/how-can-i-get-specific-values-out-of-jumps-variables/116795)

<div class="topic-metadata">

**Author:** [@ToPo](https://discourse.julialang.org/u/ToPo)\
**Replies:** 4\
**Last updated:** [July 9, 2024, 8:00am UTC](https://discourse.julialang.org/t/how-can-i-get-specific-values-out-of-jumps-variables/116795 "2024-07-09T08:00:02Z")

</div>

I want to use my own function as the objective function and optimize it using JuMP.jl. In this function, I use JuMP variables internally as Vector{Float64} to make the calculation more efficient. However, the type of J…

---

## [Trying to solve a large system of highly stiff differential equations](https://discourse.julialang.org/t/trying-to-solve-a-large-system-of-highly-stiff-differential-equations/114728)

<div class="topic-metadata">

**Author:** [@balaji\_sriram](https://discourse.julialang.org/u/balaji_sriram)\
**Replies:** 13\
**Last updated:** [June 6, 2024, 12:57pm UTC](https://discourse.julialang.org/t/trying-to-solve-a-large-system-of-highly-stiff-differential-equations/114728 "2024-06-06T12:57:11Z")

</div>

Hi. I have a system of differential equations containing 62500 simultaneous equations. The system dynamics are linear and of the form: \[dU/dt\] = \[Jacobian\]x\[U\]. The jacobian is sparse (non-zero vals ~ 0.6%) and banded.…

---

## [DataInterpolations.jl and Zygote.jl](https://discourse.julialang.org/t/datainterpolations-jl-and-zygote-jl/113208)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 18\
**Last updated:** [July 8, 2024, 12:30am UTC](https://discourse.julialang.org/t/datainterpolations-jl-and-zygote-jl/113208 "2024-07-08T00:30:49Z")

</div>

Hi everyone, I am trying to differentiate through an interpolation (as offered by DataInterpolations.jl. Here is a MWE x = Array(LinRange(0,10,101)) a = 1 b = 2 c = 3 p(a,b,c) = a.+b.\*x.+c.\*x.^2 gradient(b -\> sum(p(a,b…

---

## [Using orthogonal collocation method solve PDE of adsorption chromatography model](https://discourse.julialang.org/t/using-orthogonal-collocation-method-solve-pde-of-adsorption-chromatography-model/114413)

<div class="topic-metadata">

**Author:** [@Stephen](https://discourse.julialang.org/u/Stephen)\
**Replies:** 4\
**Last updated:** [July 4, 2024, 8:44am UTC](https://discourse.julialang.org/t/using-orthogonal-collocation-method-solve-pde-of-adsorption-chromatography-model/114413 "2024-07-04T08:44:21Z")

</div>

Chromatographic equation with diffusion： \\frac{\\partial c}{\\partial t} + \\frac{1 - \\epsilon}{\\epsilon} \\frac{\\partial q}{\\partial t} + u \\frac{\\partial c}{\\partial x} = D \\frac{\\partial^2 c}{\\partial x^2} \\frac{\\part…

---

## [Alternatives to inv() in Julia](https://discourse.julialang.org/t/alternatives-to-inv-in-julia/116514)

<div class="topic-metadata">

**Author:** [@usaer](https://discourse.julialang.org/u/usaer)\
**Replies:** 4\
**Last updated:** [July 3, 2024, 9:08am UTC](https://discourse.julialang.org/t/alternatives-to-inv-in-julia/116514 "2024-07-03T09:08:06Z")

</div>

Hi, I wanted to ask if there more optimal way w.r.t to Performance to find the inverse of a matrix than inv() from Linear Algebra package

---

## [Set as zero low values in symbolic expressions](https://discourse.julialang.org/t/set-as-zero-low-values-in-symbolic-expressions/114793)

<div class="topic-metadata">

**Author:** [@GiorgioSimonini](https://discourse.julialang.org/u/GiorgioSimonini)\
**Replies:** 3\
**Last updated:** [July 3, 2024, 6:59am UTC](https://discourse.julialang.org/t/set-as-zero-low-values-in-symbolic-expressions/114793 "2024-07-03T06:59:14Z")

</div>

Hello everyone, I am seeking a way to simplify a symbolic expression setting as zero floating point numbers that are below a certain threshold. For example the expression ‘1e-17\*x + y’ should return ‘y’. I tried to us…

---

## [Finding roots of an integral equation](https://discourse.julialang.org/t/finding-roots-of-an-integral-equation/116503)

<div class="topic-metadata">

**Author:** [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Replies:** 4\
**Last updated:** [July 2, 2024, 11:26am UTC](https://discourse.julialang.org/t/finding-roots-of-an-integral-equation/116503 "2024-07-02T11:26:14Z")

</div>

Hey out there! I am trying to solve to following problem. g(x) = \\int\_0^x f(y) dy - a I would like to find the roots. This should be easily solveable by Newtons Method, like the following: g'(x) = f(x) using …

---

## [Issue with StaticArrays in Boundary Value Problems](https://discourse.julialang.org/t/issue-with-staticarrays-in-boundary-value-problems/115024)

<div class="topic-metadata">

**Author:** [@RafaelDHR](https://discourse.julialang.org/u/RafaelDHR)\
**Replies:** 2\
**Last updated:** [June 28, 2024, 10:36am UTC](https://discourse.julialang.org/t/issue-with-staticarrays-in-boundary-value-problems/115024 "2024-06-28T10:36:11Z")

</div>

Greetings, Recently I’ve been using the amazing DifferentialEquations package. However, few days ago I noticed that the package used for Boundary Value Problems BoundaryValueDiffEq has some issues when using Static Arra…

---

## [Slow cubature](https://discourse.julialang.org/t/slow-cubature/116120)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 21\
**Last updated:** [June 25, 2024, 12:46am UTC](https://discourse.julialang.org/t/slow-cubature/116120 "2024-06-25T00:46:35Z")

</div>

I’m trying the perform a numerical integration over 4-dimensions. Here is a self-contained example: import HCubature using StaticArrays: SMatrix using StaticArrays: SVector using LinearAlgebra: Symmetric using LinearAlg…

---

## [Convergence of gmres from IterativeSolvers in minimal examples](https://discourse.julialang.org/t/convergence-of-gmres-from-iterativesolvers-in-minimal-examples/115852)

<div class="topic-metadata">

**Author:** [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Replies:** 7\
**Last updated:** [June 23, 2024, 2:55pm UTC](https://discourse.julialang.org/t/convergence-of-gmres-from-iterativesolvers-in-minimal-examples/115852 "2024-06-23T14:55:07Z")

</div>

Hi all, I’m trying to see if I can apply gmres in a domain specific problem I have, where I need to solve a system Ax=b where A is a non-symmetric square block tridiagonal matrix. I have not managed to get this to work,…

---

## [Error while simulating electrostatic problem for a multi-dielectric system using Gridap](https://discourse.julialang.org/t/error-while-simulating-electrostatic-problem-for-a-multi-dielectric-system-using-gridap/116044)

<div class="topic-metadata">

**Author:** [@balaji\_sriram](https://discourse.julialang.org/u/balaji_sriram)\
**Replies:** 5\
**Last updated:** [June 22, 2024, 5:27pm UTC](https://discourse.julialang.org/t/error-while-simulating-electrostatic-problem-for-a-multi-dielectric-system-using-gridap/116044 "2024-06-22T17:27:00Z")

</div>

I am trying to solve an electrostatic poissons equation with 2 different materials. I am trying to compute the electric potential for a sphere (ϵr= 10) embedded inside a box (ϵr= 1). I am getting the below error at th…

---

## [Preconditioner for Block PSD linear system](https://discourse.julialang.org/t/preconditioner-for-block-psd-linear-system/114519)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 2\
**Last updated:** [June 22, 2024, 5:17am UTC](https://discourse.julialang.org/t/preconditioner-for-block-psd-linear-system/114519 "2024-06-22T05:17:07Z")

</div>

Hello, I am interested in solving the linear system M x = b with an iterative method, where M is positive definite (PD) with the following block structure: M = \\begin{bmatrix} \\Sigma\_a & 0\\\\ 0 & \\Sigma\_b \\end{bmatrix…

---

## [Hcubature\_count?](https://discourse.julialang.org/t/hcubature-count/115878)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 6\
**Last updated:** [June 20, 2024, 7:07am UTC](https://discourse.julialang.org/t/hcubature-count/115878 "2024-06-20T07:07:03Z")

</div>

Is there a \_count equivalent for hcubature in the same way that quadgk\_count is for quadgk? Thx.

---

## [Automatic State Transition Matrix](https://discourse.julialang.org/t/automatic-state-transition-matrix/115657)

<div class="topic-metadata">

**Author:** [@afossa](https://discourse.julialang.org/u/afossa)\
**Replies:** 3\
**Last updated:** [June 15, 2024, 10:02am UTC](https://discourse.julialang.org/t/automatic-state-transition-matrix/115657 "2024-06-15T10:02:53Z")

</div>

Hello, When solving an ODE with the DifferentialEquations package, is there a way to automatically retrieve the state transition matrix, i.e. the sensitivity of the solution w.r.t. the initial conditions, along the enti…

---

## [Implementing two different noise processes in a differential equation](https://discourse.julialang.org/t/implementing-two-different-noise-processes-in-a-differential-equation/101908)

<div class="topic-metadata">

**Author:** [@absorbtion](https://discourse.julialang.org/u/absorbtion)\
**Replies:** 1\
**Last updated:** [June 15, 2024, 10:01am UTC](https://discourse.julialang.org/t/implementing-two-different-noise-processes-in-a-differential-equation/101908 "2024-06-15T10:01:47Z")

</div>

Hi! I’m trying to implement the 3-dim complex valued DE du/dt = (alpha(t) + beta(t))\*u(t) alpha(t) is a 3-dim OU process and beta(t) is a 1-dim OU process (mean 0) with a given covariance E\[beta(t)beta(s)\] = f(s,t). I…

---

## [Accelerating repeated eigenvalue searches](https://discourse.julialang.org/t/accelerating-repeated-eigenvalue-searches/114989)

<div class="topic-metadata">

**Author:** [@bremez](https://discourse.julialang.org/u/bremez)\
**Replies:** 31\
**Last updated:** [June 14, 2024, 2:08pm UTC](https://discourse.julialang.org/t/accelerating-repeated-eigenvalue-searches/114989 "2024-06-14T14:08:23Z")

</div>

I need to compute the eigenvalues of 2N\\times2N (N ~ 1000) complex, hermitian, dense, matrices, the number of matrices being ~100. They have the following properties: All matrices M\_i take the form M\_i = A + D\_i, where…

---

## [Is there a possibility of transcoding QNDF?](https://discourse.julialang.org/t/is-there-a-possibility-of-transcoding-qndf/114757)

<div class="topic-metadata">

**Author:** [@Pugolas](https://discourse.julialang.org/u/Pugolas)\
**Replies:** 4\
**Last updated:** [June 7, 2024, 6:42pm UTC](https://discourse.julialang.org/t/is-there-a-possibility-of-transcoding-qndf/114757 "2024-06-07T18:42:15Z")

</div>

I am currently working on a \*\*C++\*\*project that requires solving large rigid differential equations. I have learned that QNDF in OrdinariDiffEq.jl is very good at it. Is it possible to complete code conversion based on o…

---

## [Incorrect interpolation on non regular grid](https://discourse.julialang.org/t/incorrect-interpolation-on-non-regular-grid/115161)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.julialang.org/u/Jakub_Mitura)\
**Replies:** 1\
**Last updated:** [June 4, 2024, 11:16am UTC](https://discourse.julialang.org/t/incorrect-interpolation-on-non-regular-grid/115161 "2024-06-04T11:16:51Z")

</div>

I am trying to interpolate a point in 3-dimensional array with arbitrary spacing (distance between each point in real world coordinates). I had used scaled interpolation from Interpolations.jl . However as code below sho…

---

## [Periodic boundary conditions with MethodOfLines not working](https://discourse.julialang.org/t/periodic-boundary-conditions-with-methodoflines-not-working/115123)

<div class="topic-metadata">

**Author:** [@dbox](https://discourse.julialang.org/u/dbox)\
**Replies:** 1\
**Last updated:** [June 4, 2024, 7:37am UTC](https://discourse.julialang.org/t/periodic-boundary-conditions-with-methodoflines-not-working/115123 "2024-06-04T07:37:05Z")

</div>

I’m trying to use a basic advection/diffusion equation with MethodOfLines.jl. I have an initial condition which is a Gaussian shaped density, and I’m struggling to get periodic boundary conditions to work. My initial …

---

## [Is there any easy-to-use parallel linear solver in Julia?](https://discourse.julialang.org/t/is-there-any-easy-to-use-parallel-linear-solver-in-julia/95867)

<div class="topic-metadata">

**Author:** [@maphdze](https://discourse.julialang.org/u/maphdze)\
**Replies:** 5\
**Last updated:** [June 3, 2024, 10:02pm UTC](https://discourse.julialang.org/t/is-there-any-easy-to-use-parallel-linear-solver-in-julia/95867 "2024-06-03T22:02:13Z")

</div>

I am wondering that if there are some easy-to-use parallel linear solvers in Julia? I have tried MUMPS.jl, but if you want to parallelize it, you have to use MPI.jl, then other parts of the code will be executed ‘number…

---

## [Mismatch between nextfloat(0.0) and eps(Float64)](https://discourse.julialang.org/t/mismatch-between-nextfloat-0-0-and-eps-float64/115104)

<div class="topic-metadata">

**Author:** [@Guillermo\_C](https://discourse.julialang.org/u/Guillermo_C)\
**Replies:** 6\
**Last updated:** [June 3, 2024, 6:21pm UTC](https://discourse.julialang.org/t/mismatch-between-nextfloat-0-0-and-eps-float64/115104 "2024-06-03T18:21:14Z")

</div>

Dear Julia community, I am testing the representation of floating point values in my machine. This is the behavior I am seeing: julia\> x = 0.0 0.0 help?\> x (...) x is of type Float64 (...) julia\> nextfloat(x) 5.0e-324 …

---

## [Using du in system of ODEs](https://discourse.julialang.org/t/using-du-in-system-of-odes/114590)

<div class="topic-metadata">

**Author:** [@cgreysongaito](https://discourse.julialang.org/u/cgreysongaito)\
**Replies:** 3\
**Last updated:** [May 29, 2024, 10:42am UTC](https://discourse.julialang.org/t/using-du-in-system-of-odes/114590 "2024-05-29T10:42:20Z")

</div>

I am numerically solving a system of odes. One of the equations uses two other odes within the system of odes. However, I get different results depending on the order of the equations in the function. For MWEtest1!, ωₘ, …

---

## [Integration packages to calculate the first N Fourier coefficients](https://discourse.julialang.org/t/integration-packages-to-calculate-the-first-n-fourier-coefficients/114787)

<div class="topic-metadata">

**Author:** [@ccmejia](https://discourse.julialang.org/u/ccmejia)\
**Replies:** 3\
**Last updated:** [May 27, 2024, 6:54pm UTC](https://discourse.julialang.org/t/integration-packages-to-calculate-the-first-n-fourier-coefficients/114787 "2024-05-27T18:54:58Z")

</div>

I am trying to calculate the first N Fourier coefficients for sampled data (harmonic + gaussian like). The Riemann sum was my first approach, however I think the results are not enough accurate. Therefore, I am trying t…

---

## [The general cause of the error that "Enzyme could not find shadow for value" in Enzyme.jl](https://discourse.julialang.org/t/the-general-cause-of-the-error-that-enzyme-could-not-find-shadow-for-value-in-enzyme-jl/114719)

<div class="topic-metadata">

**Author:** [@ToPo](https://discourse.julialang.org/u/ToPo)\
**Replies:** 4\
**Last updated:** [May 27, 2024, 11:48am UTC](https://discourse.julialang.org/t/the-general-cause-of-the-error-that-enzyme-could-not-find-shadow-for-value-in-enzyme-jl/114719 "2024-05-27T11:48:55Z")

</div>

When the reverse mode of Enzyme.jl was run, the following error was displayed. What are the main causes of the following error messages? Does anyone know the general reason for what causes it? “mutable struct” is crea…

---

## [Jordan norm in julia](https://discourse.julialang.org/t/jordan-norm-in-julia/114500)

<div class="topic-metadata">

**Author:** [@swsw](https://discourse.julialang.org/u/swsw)\
**Replies:** 6\
**Last updated:** [May 23, 2024, 6:06am UTC](https://discourse.julialang.org/t/jordan-norm-in-julia/114500 "2024-05-23T06:06:22Z")

</div>

Is there a way to do jordan decomposition or find out the jordan norm of a n\*n matrix in julia? I see the following one but the function jordan\_form is not available in SymPy.jl. Any insight?

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

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