# Numerics

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

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

**Page:** 5

---

## [Solution not converging for advection PDE](https://discourse.julialang.org/t/solution-not-converging-for-advection-pde/123349)

<div class="topic-metadata">

**Author:** [@Alma\_Thindberg](https://discourse.julialang.org/u/Alma_Thindberg)\
**Replies:** 9\
**Last updated:** [March 25, 2025, 1:05pm UTC](https://discourse.julialang.org/t/solution-not-converging-for-advection-pde/123349 "2025-03-25T13:05:01Z")

</div>

using Pkg #Pkg.add("ModelingToolkit") #Pkg.add("MethodOfLines") #Pkg.add("DomainSets") #Pkg.add("OrdinaryDiffEq") Pkg.add("NonlinearSolve") using ModelingToolkit, MethodOfLines, DomainSets, OrdinaryDiffEq, LinearAlge…

---

## [Numeric antiderivative for a noncontinuous function using ODEProblem](https://discourse.julialang.org/t/numeric-antiderivative-for-a-noncontinuous-function-using-odeproblem/126751)

<div class="topic-metadata">

**Author:** [@nilsbecker](https://discourse.julialang.org/u/nilsbecker)\
**Replies:** 7\
**Last updated:** [March 21, 2025, 2:10pm UTC](https://discourse.julialang.org/t/numeric-antiderivative-for-a-noncontinuous-function-using-odeproblem/126751 "2025-03-21T14:10:52Z")

</div>

Hi, I need an indefinite integral interpolation, to be constructed once and evaluated many times. Basically, I want to solve the outer ODE \\dot f(t) = A(t) b(t), where the inner integral A(t)=\\int\_0^t a(t')dt' is to be s…

---

## [Using filter in Poisson solver](https://discourse.julialang.org/t/using-filter-in-poisson-solver/127129)

<div class="topic-metadata">

**Author:** [@Sagar\_123](https://discourse.julialang.org/u/Sagar_123)\
**Replies:** 0\
**Last updated:** [March 19, 2025, 10:05am UTC](https://discourse.julialang.org/t/using-filter-in-poisson-solver/127129 "2025-03-19T10:05:36Z")

</div>

Hello! I am trying to implement a filter on poisson solver matrix for periodic grid. So, I have x and y grid where y is periodic, hence I can decouple in y using fft. Now, if I were to apply a filter around a particular …

---

## [What are the effects of maxtypeoffset! and maxtypedepth! in Enzyme?](https://discourse.julialang.org/t/what-are-the-effects-of-maxtypeoffset-and-maxtypedepth-in-enzyme/127039)

<div class="topic-metadata">

**Author:** [@ToPo](https://discourse.julialang.org/u/ToPo)\
**Replies:** 0\
**Last updated:** [March 17, 2025, 4:19am UTC](https://discourse.julialang.org/t/what-are-the-effects-of-maxtypeoffset-and-maxtypedepth-in-enzyme/127039 "2025-03-17T04:19:31Z")

</div>

I use automatic differentiation by Enzyme.jl. What are the functions of the two APIs, maxtypeoffset! and maxtypedepth! ? I want to use these APIs to stabilize the operation of the Enzyme.jl. maxtypeoffset! What is …

---

## [How to improve the Thomas algorithm for block tridiagonal matrices](https://discourse.julialang.org/t/how-to-improve-the-thomas-algorithm-for-block-tridiagonal-matrices/126894)

<div class="topic-metadata">

**Author:** [@karei](https://discourse.julialang.org/u/karei)\
**Replies:** 16\
**Last updated:** [March 17, 2025, 4:02am UTC](https://discourse.julialang.org/t/how-to-improve-the-thomas-algorithm-for-block-tridiagonal-matrices/126894 "2025-03-17T04:02:38Z")

</div>

I did some searching but it seems that Julia doesn’t implement a specific algorithm for block tridiagonal matrices. So I implemented one myself. I would like to know: Have I missed some existing algorithm implementatio…

---

## [Cholesky Decomposition combined with ForwardDiff.jl](https://discourse.julialang.org/t/cholesky-decomposition-combined-with-forwarddiff-jl/126892)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 6\
**Last updated:** [March 16, 2025, 7:11pm UTC](https://discourse.julialang.org/t/cholesky-decomposition-combined-with-forwarddiff-jl/126892 "2025-03-16T19:11:57Z")

</div>

Short version: I would like to use automatic differentiation on my user defined function that includes a Cholesky decomposition. However, I get the following error: ERROR: Function iszero requires primal value(s). A dua…

---

## [How to solve a nonlinear problem](https://discourse.julialang.org/t/how-to-solve-a-nonlinear-problem/126877)

<div class="topic-metadata">

**Author:** [@andrea\_bertozzi](https://discourse.julialang.org/u/andrea_bertozzi)\
**Replies:** 5\
**Last updated:** [March 13, 2025, 9:27am UTC](https://discourse.julialang.org/t/how-to-solve-a-nonlinear-problem/126877 "2025-03-13T09:27:41Z")

</div>

I have the following code and I am trying to solve a nonlinear problem using MAT using NonlinearSolve using FiniteDifferences include("../src/Tether\_quasistatic.jl") function get\_init\_cond(filename) vars = matread(…

---

## [How to obtain U^-1 factor from sparse Cholesky factorization?](https://discourse.julialang.org/t/how-to-obtain-u-1-factor-from-sparse-cholesky-factorization/126887)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 2\
**Last updated:** [March 12, 2025, 8:14pm UTC](https://discourse.julialang.org/t/how-to-obtain-u-1-factor-from-sparse-cholesky-factorization/126887 "2025-03-12T20:14:17Z")

</div>

Given a dense positive semi-definite symmetric matrix A, we can easily obtain the U^{-1} factor from the Cholesky factorization object: julia\> using LinearAlgebra julia\> A = Symmetric(\[2 1; 1 2\]) 2×2 Symmetric{Int64, M…

---

## [Generalised eigenvalue problem with BigFloat](https://discourse.julialang.org/t/generalised-eigenvalue-problem-with-bigfloat/126197)

<div class="topic-metadata">

**Author:** [@fionah](https://discourse.julialang.org/u/fionah)\
**Replies:** 11\
**Last updated:** [March 12, 2025, 12:33pm UTC](https://discourse.julialang.org/t/generalised-eigenvalue-problem-with-bigfloat/126197 "2025-03-12T12:33:40Z")

</div>

I am trying to solve the generalised eigenvalue problem in arbitrary precision, using the BigFloat data type. using LinearAlgebra using GenericLinearAlgebra setprecision(128) println(eigen(Hermitian(rand(BigFloat, 2, …

---

## [Poisson solver using BSpline Galerkin method on a 2D grid](https://discourse.julialang.org/t/poisson-solver-using-bspline-galerkin-method-on-a-2d-grid/126524)

<div class="topic-metadata">

**Author:** [@Sagar\_123](https://discourse.julialang.org/u/Sagar_123)\
**Replies:** 8\
**Last updated:** [March 6, 2025, 10:00pm UTC](https://discourse.julialang.org/t/poisson-solver-using-bspline-galerkin-method-on-a-2d-grid/126524 "2025-03-06T22:00:15Z")

</div>

Hello! I am trying to implement a poisson solver (in a reduced form) using BSplines and Galerkin method. Form of the equation is : where \\phi is potential and differential operation is in 2D : Now, if I were to ex…

---

## [Interpolate 2d function](https://discourse.julialang.org/t/interpolate-2d-function/96914)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 14\
**Last updated:** [March 4, 2025, 4:29pm UTC](https://discourse.julialang.org/t/interpolate-2d-function/96914 "2025-03-04T16:29:32Z")

</div>

I want to interpolate 2d data. I have a function f(x, y) that is sampled as follows. For any y value in some array y\_arr, I have the a set of points x\_arr. Note that x\_arr is different for any y, and even the boundaries …

---

## [Solving a matrix least-squares with LinearSolve.jl](https://discourse.julialang.org/t/solving-a-matrix-least-squares-with-linearsolve-jl/126367)

<div class="topic-metadata">

**Author:** [@smallpondtom](https://discourse.julialang.org/u/smallpondtom)\
**Replies:** 2\
**Last updated:** [February 28, 2025, 2:28pm UTC](https://discourse.julialang.org/t/solving-a-matrix-least-squares-with-linearsolve-jl/126367 "2025-02-28T14:28:51Z")

</div>

Hi. I’ve been trying out LinearSolve.jl for a bit, and I happened to notice that this package is generally for \\min \\| \\mathbf{Ax} - \\mathbf{b} \\|\_2^2 where \\mathbf{b},\\mathbf{x} are vectors. My problem, on the other…

---

## [Implicit differentiation of rootfinding problem (w/ numerical issues)](https://discourse.julialang.org/t/implicit-differentiation-of-rootfinding-problem-w-numerical-issues/126293)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 13\
**Last updated:** [February 26, 2025, 3:01pm UTC](https://discourse.julialang.org/t/implicit-differentiation-of-rootfinding-problem-w-numerical-issues/126293 "2025-02-26T15:01:40Z")

</div>

I have written an algorithm that solves x = \\log\\left( \\sum\_i \\exp(a\_i + z\_i y) \\right) for y given x, a\_i, z\_i. It uses Newton’s method, which is the trivial part, the difficulty was getting a cheap but reasonable in…

---

## [Forward Automatic Differentiation & FFTs](https://discourse.julialang.org/t/forward-automatic-differentiation-ffts/126036)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 13\
**Last updated:** [February 22, 2025, 10:18pm UTC](https://discourse.julialang.org/t/forward-automatic-differentiation-ffts/126036 "2025-02-22T22:18:37Z")

</div>

I need to understand if there is a combination of packages that is able to wdo what I need. I need to do some FFTs, differentiate through them both in Forward and Backward mode with one of the Julia AD engines (it might…

---

## [Using ApproxFun.jl to solve a Volterra equation of the second kind](https://discourse.julialang.org/t/using-approxfun-jl-to-solve-a-volterra-equation-of-the-second-kind/40203)

<div class="topic-metadata">

**Author:** [@chisquared](https://discourse.julialang.org/u/chisquared)\
**Replies:** 4\
**Last updated:** [February 21, 2025, 5:35pm UTC](https://discourse.julialang.org/t/using-approxfun-jl-to-solve-a-volterra-equation-of-the-second-kind/40203 "2025-02-21T17:35:00Z")

</div>

I’m trying to learn how to solve Volterra equations of the second kind using ApproxFun.jl. For example, consider the following equation, where u is an unknown function on \[0,1/2\]. The closest similar example I could …

---

## [Differentiating through non-negative least squares solver?](https://discourse.julialang.org/t/differentiating-through-non-negative-least-squares-solver/125641)

<div class="topic-metadata">

**Author:** [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Replies:** 9\
**Last updated:** [February 19, 2025, 10:55am UTC](https://discourse.julialang.org/t/differentiating-through-non-negative-least-squares-solver/125641 "2025-02-19T10:55:18Z")

</div>

Hi, I’m wondering if there’s a better way to get the gradient of a function like this one: using NonNegLeastSquares, DifferentiationInterface import FiniteDiff function f(aa, b) A = reshape(aa, size(b, 1), :) x…

---

## [Difficulty when differentiating with DifferentiationInterface.jl and Mooncake.jl](https://discourse.julialang.org/t/difficulty-when-differentiating-with-differentiationinterface-jl-and-mooncake-jl/125982)

<div class="topic-metadata">

**Author:** [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Replies:** 3\
**Last updated:** [February 17, 2025, 5:23pm UTC](https://discourse.julialang.org/t/difficulty-when-differentiating-with-differentiationinterface-jl-and-mooncake-jl/125982 "2025-02-17T17:23:25Z")

</div>

Hello everyone. I am stuck with the following problem for which I have created below a MWE. It concerns automatic differentiation using DifferentiationInterface.jl together with Mooncake.jl. From the error message I get,…

---

## [ForwardDiff + Adaptive ODE Solvers: Timestep Issue Leads to Incorrect Derivatives](https://discourse.julialang.org/t/forwarddiff-adaptive-ode-solvers-timestep-issue-leads-to-incorrect-derivatives/125870)

<div class="topic-metadata">

**Author:** [@abavoil](https://discourse.julialang.org/u/abavoil)\
**Replies:** 5\
**Last updated:** [February 14, 2025, 3:08pm UTC](https://discourse.julialang.org/t/forwarddiff-adaptive-ode-solvers-timestep-issue-leads-to-incorrect-derivatives/125870 "2025-02-14T15:08:36Z")

</div>

Hello dear Julia community, TLDR; Passing dual numbers (ForwardDiff.jl) into an adaptative-step ODE solver (OrdinaryDiffEq.jl) affects the timestep choice, making the derivative incorrect. Let’s say we have a function …

---

## [Terminate Nonlinearsolve when residual does not decrease](https://discourse.julialang.org/t/terminate-nonlinearsolve-when-residual-does-not-decrease/125732)

<div class="topic-metadata">

**Author:** [@pavaninguva](https://discourse.julialang.org/u/pavaninguva)\
**Replies:** 4\
**Last updated:** [February 13, 2025, 11:45pm UTC](https://discourse.julialang.org/t/terminate-nonlinearsolve-when-residual-does-not-decrease/125732 "2025-02-13T23:45:39Z")

</div>

Hi! I am trying to terminate the solution of a nonlinear equation system when the residual does not decrease with successive iterations. I have tried two approaches: Trying to access the residuals during each iteratio…

---

## [Zygote and ODESolution Manipulation/Indexing Compatibility](https://discourse.julialang.org/t/zygote-and-odesolution-manipulation-indexing-compatibility/125668)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 3\
**Last updated:** [February 10, 2025, 5:07pm UTC](https://discourse.julialang.org/t/zygote-and-odesolution-manipulation-indexing-compatibility/125668 "2025-02-10T17:07:45Z")

</div>

I’m trying to write fairly complicated loss functions which tend to require manipulation of the ODESolution object. I would like to perform reverse mode differentiation using Zygote.jl over my loss function so I can obt…

---

## [How to use Pardiso with single-precision matrices](https://discourse.julialang.org/t/how-to-use-pardiso-with-single-precision-matrices/125520)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 5\
**Last updated:** [February 4, 2025, 9:06pm UTC](https://discourse.julialang.org/t/how-to-use-pardiso-with-single-precision-matrices/125520 "2025-02-04T21:06:44Z")

</div>

I would like to ask if it is possible to run Pardiso from the LinearSolve library using single precision matrices. I am running using SparseArrays, LinearSolve, MKL, Pardiso prob = LinearProblem(A, b) sol = LinearSolve.…

---

## [Computing ODE sensitivities with sparse Jacobians in solver](https://discourse.julialang.org/t/computing-ode-sensitivities-with-sparse-jacobians-in-solver/125536)

<div class="topic-metadata">

**Author:** [@Neodym](https://discourse.julialang.org/u/Neodym)\
**Replies:** 3\
**Last updated:** [February 4, 2025, 6:31pm UTC](https://discourse.julialang.org/t/computing-ode-sensitivities-with-sparse-jacobians-in-solver/125536 "2025-02-04T18:31:17Z")

</div>

Hey there, I’m trying to compute the derivatives of a function involving an ODE solution. This works if I use dense Jacobians in the ODE solver. However, the Jacobian is actually sparse (PDE discretization, stiff) and …

---

## [Approximate implicit function on real line](https://discourse.julialang.org/t/approximate-implicit-function-on-real-line/125421)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [February 3, 2025, 2:31pm UTC](https://discourse.julialang.org/t/approximate-implicit-function-on-real-line/125421 "2025-02-03T14:31:38Z")

</div>

I have a family of functions y(x) defined implicitly by x = \\log\\left(\\sum\_{i=1}^N \\exp(a\_i + y b\_i) \\right) where 0 \< b\_1 \< \\dots \< b\_N can be assumed. It is easy to find the solution numerically (eg with Newton’s m…

---

## [Multivariate polynomial regression of discrete data in L-infinity norm](https://discourse.julialang.org/t/multivariate-polynomial-regression-of-discrete-data-in-l-infinity-norm/125369)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 16\
**Last updated:** [January 31, 2025, 1:10am UTC](https://discourse.julialang.org/t/multivariate-polynomial-regression-of-discrete-data-in-l-infinity-norm/125369 "2025-01-31T01:10:55Z")

</div>

Hi everyone, Does anyone know of a Julia package that implements polynomial approximations (preferably Chebyshev polynomials) given data on a multivariate function with a L-infinity norm? Specifically, I have x, f(x) p…

---

## [Solving a system of multivariate polynomials (or finding extrema)](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [January 30, 2025, 9:12pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451 "2025-01-30T21:12:45Z")

</div>

I have a multivariate (in practice, 2–5 dimensions) function approximated with Chebyshev polynomials. I would like to find all the local extrema of the approximation. This is equivalent to solving the system obtained fro…

---

## [Incorrect mean in the EnsembleSummary plot?](https://discourse.julialang.org/t/incorrect-mean-in-the-ensemblesummary-plot/125325)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 1\
**Last updated:** [January 29, 2025, 5:51pm UTC](https://discourse.julialang.org/t/incorrect-mean-in-the-ensemblesummary-plot/125325 "2025-01-29T17:51:48Z")

</div>

I have the following snippet: module mwe using OrdinaryDiffEq using Plots using Distributions using Statistics tspan = (0.0, 10.0) Δt = 0.5 g(u, p, t) = p\[1\] \* t x0 = 0.0 # base problem prob\_x = ODEProblem(g, x0, tsp…

---

## [Can remake be used with specific ODEProblem types?](https://discourse.julialang.org/t/can-remake-be-used-with-specific-odeproblem-types/110135)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 3\
**Last updated:** [January 29, 2025, 10:36am UTC](https://discourse.julialang.org/t/can-remake-be-used-with-specific-odeproblem-types/110135 "2025-01-29T10:36:43Z")

</div>

When I try to remake a SecondOrderODEProblem with remake(secondorderprob; u0 = x\[1\], du0 = x\[2\]) I get Unrecognized keyword arguments found. The only allowed keyword arguments to \`solve\` are: (:dense, :saveat, …

---

## [Solving AX=B with a matrix B of right-hand sides](https://discourse.julialang.org/t/solving-ax-b-with-a-matrix-b-of-right-hand-sides/125282)

<div class="topic-metadata">

**Author:** [@B4rtel](https://discourse.julialang.org/u/B4rtel)\
**Replies:** 1\
**Last updated:** [January 27, 2025, 9:12pm UTC](https://discourse.julialang.org/t/solving-ax-b-with-a-matrix-b-of-right-hand-sides/125282 "2025-01-27T21:12:19Z")

</div>

Hi, is your answer also the same for the case AX=B i.e. when X and B are matrices instead of vectors?

---

## [ForwardDiff.jacobian failed to differentiate a code and gives a wrong result](https://discourse.julialang.org/t/forwarddiff-jacobian-failed-to-differentiate-a-code-and-gives-a-wrong-result/125225)

<div class="topic-metadata">

**Author:** [@fduchenne](https://discourse.julialang.org/u/fduchenne)\
**Replies:** 8\
**Last updated:** [January 27, 2025, 2:35pm UTC](https://discourse.julialang.org/t/forwarddiff-jacobian-failed-to-differentiate-a-code-and-gives-a-wrong-result/125225 "2025-01-27T14:35:06Z")

</div>

Dear Julia users, I have a complex ODE systems in which I use Gaussian overlaps, and I obtain wrong results when I estimate the Jaccobian of my ODE system using ForwardDiff.jacobian. I get a diagonal matrix, with zero f…

---

## [Help with continuation using BifurcationKit.jl](https://discourse.julialang.org/t/help-with-continuation-using-bifurcationkit-jl/124965)

<div class="topic-metadata">

**Author:** [@iclo3](https://discourse.julialang.org/u/iclo3)\
**Replies:** 4\
**Last updated:** [January 21, 2025, 9:15am UTC](https://discourse.julialang.org/t/help-with-continuation-using-bifurcationkit-jl/124965 "2025-01-21T09:15:49Z")

</div>

Hello all, Relatively new to BifurcationKit (I have used other continuation software in the past). I’ve been able to get a 2D system (quite similar to the 3D system I’m having trouble with) to work, so any help or advic…

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

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