# Numerics

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

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

**Page:** 11

---

## [Methods to solve system of linear equations with equiality constraint](https://discourse.julialang.org/t/methods-to-solve-system-of-linear-equations-with-equiality-constraint/110403)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 4\
**Last updated:** [February 19, 2024, 3:00pm UTC](https://discourse.julialang.org/t/methods-to-solve-system-of-linear-equations-with-equiality-constraint/110403 "2024-02-19T15:00:02Z")

</div>

Hello, everyone. I want to solve a system of linear equations Ax = b with some linear equality constraints. A is square but non-symmetric. The equation corresponds to a linearized stationary Boltzman equation, and the…

---

## [Solving linear system with sum of kronecker products](https://discourse.julialang.org/t/solving-linear-system-with-sum-of-kronecker-products/109253)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 21\
**Last updated:** [February 18, 2024, 11:35am UTC](https://discourse.julialang.org/t/solving-linear-system-with-sum-of-kronecker-products/109253 "2024-02-18T11:35:39Z")

</div>

Suppose I have ((A \\otimes B) + (C \\otimes D))x = v where A and C and B and D have the same size, respectively. Suppose also that I particularly want to avoid instantiating the Kronecker products since they are large. …

---

## [Would it be worth it to move to DifferentialEquation.jl?](https://discourse.julialang.org/t/would-it-be-worth-it-to-move-to-differentialequation-jl/110297)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 4\
**Last updated:** [February 16, 2024, 3:39pm UTC](https://discourse.julialang.org/t/would-it-be-worth-it-to-move-to-differentialequation-jl/110297 "2024-02-16T15:39:23Z")

</div>

Hey, I have an application that is taking a bit long, but looking at profview i am wondering if it would be actually worth it to move it to DE.jl. Here are the specifics: I have a pre-setted grid with a lot of time po…

---

## [Result of exponentials are (sometimes) different from Matlab](https://discourse.julialang.org/t/result-of-exponentials-are-sometimes-different-from-matlab/110241)

<div class="topic-metadata">

**Author:** [@simonw1](https://discourse.julialang.org/u/simonw1)\
**Replies:** 5\
**Last updated:** [February 15, 2024, 1:43pm UTC](https://discourse.julialang.org/t/result-of-exponentials-are-sometimes-different-from-matlab/110241 "2024-02-15T13:43:40Z")

</div>

I’m trying to port an algorithm originally written in matlab to Julia and I’m getting a weird error. For some values and some exponents, the results of raising the value to the exponent differs between matlab and Julia.…

---

## [Better way to name or inherit parameters with NonlinearSolve.jl?](https://discourse.julialang.org/t/better-way-to-name-or-inherit-parameters-with-nonlinearsolve-jl/110213)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 3\
**Last updated:** [February 14, 2024, 7:08pm UTC](https://discourse.julialang.org/t/better-way-to-name-or-inherit-parameters-with-nonlinearsolve-jl/110213 "2024-02-14T19:08:05Z")

</div>

I am using NonlinearSolve.jl for simple interval root finding. It is working well, but the way I am handling parameters is sticking out to me like a code smell. Is there a better way to pack and unpack the parameter ve…

---

## [Gradient of ODESystem containing a loop](https://discourse.julialang.org/t/gradient-of-odesystem-containing-a-loop/110103)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 2\
**Last updated:** [February 12, 2024, 2:38pm UTC](https://discourse.julialang.org/t/gradient-of-odesystem-containing-a-loop/110103 "2024-02-12T14:38:32Z")

</div>

Hi! I am trying to take the gradient of an ODESystem containing a loop using either Zygote or ForwardDiff. Both seem to fail when I do so. Here is a minimal working example (taken from a previous JuliaForum post) using…

---

## [Implementing semi-implicit Fourier spectral method](https://discourse.julialang.org/t/implementing-semi-implicit-fourier-spectral-method/109686)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 1\
**Last updated:** [February 10, 2024, 7:40pm UTC](https://discourse.julialang.org/t/implementing-semi-implicit-fourier-spectral-method/109686 "2024-02-10T19:40:44Z")

</div>

I’m trying to implement the semi-implicit Fourier spectral method described here. It is basically a fourth-order phase-field equation, the linear fourth order operator is treated implicitly and the nonlinear operator ter…

---

## [Finding the rank of an augmented matrix](https://discourse.julialang.org/t/finding-the-rank-of-an-augmented-matrix/109988)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 2\
**Last updated:** [February 9, 2024, 4:09pm UTC](https://discourse.julialang.org/t/finding-the-rank-of-an-augmented-matrix/109988 "2024-02-09T16:09:29Z")

</div>

I want to determine if a system of equations has no solutions. According to Wikipedia a system of equations has no solutions if its augmented matrix has higher rank than its coefficient matrix. In Julia the natural way…

---

## [No method matching default\_algorithm in SDDEProblem; SDEProblem and DDEProblem work](https://discourse.julialang.org/t/no-method-matching-default-algorithm-in-sddeproblem-sdeproblem-and-ddeproblem-work/109749)

<div class="topic-metadata">

**Author:** [@cjoshliu](https://discourse.julialang.org/u/cjoshliu)\
**Replies:** 3\
**Last updated:** [February 6, 2024, 10:00pm UTC](https://discourse.julialang.org/t/no-method-matching-default-algorithm-in-sddeproblem-sdeproblem-and-ddeproblem-work/109749 "2024-02-06T22:00:27Z")

</div>

Hi, I tried running the example from the SDDE solvers documentation using DifferentialEquations function hayes\_modelf(du, u, h, p, t) τ, a, b, c, α, β, γ = p du .= a .\* u .+ b .\* h(p, t - τ) .+ c end function h…

---

## [Computing the Action of the Resolvent Operator (Stationary PDE)](https://discourse.julialang.org/t/computing-the-action-of-the-resolvent-operator-stationary-pde/109585)

<div class="topic-metadata">

**Author:** [@DrPapa](https://discourse.julialang.org/u/DrPapa)\
**Replies:** 0\
**Last updated:** [February 1, 2024, 5:17pm UTC](https://discourse.julialang.org/t/computing-the-action-of-the-resolvent-operator-stationary-pde/109585 "2024-02-01T17:17:09Z")

</div>

I am interested in computing the action of the resolvent operator R\_A = \\left(zI-A\\right)^{-1} at a range of z\\in\\mathbb{C}, where Ag= F\\cdot\\nabla g, and F:\\mathbb{R}^n\\rightarrow\\mathbb{R}^n Neumman boundary con…

---

## [How to actually take hessian in Zygote](https://discourse.julialang.org/t/how-to-actually-take-hessian-in-zygote/109531)

<div class="topic-metadata">

**Author:** [@KapilKhanal](https://discourse.julialang.org/u/KapilKhanal)\
**Replies:** 1\
**Last updated:** [February 1, 2024, 9:01am UTC](https://discourse.julialang.org/t/how-to-actually-take-hessian-in-zygote/109531 "2024-02-01T09:01:42Z")

</div>

for a simple function like this, why can’t hessian(((a, b),) -\> a\[1\]\*b\[2\] + a\[2\]\*b\[1\], \[\[2,1\], \[3,4\]\]) It throws BoundsError: attempt to access ForwardDiff.Dual{Nothing, Any, 2} at index \[2\] biut for hessian(((a, b,c…

---

## [Issues with Convergence in Differential Equation Solver Using Dual Numbers](https://discourse.julialang.org/t/issues-with-convergence-in-differential-equation-solver-using-dual-numbers/108871)

<div class="topic-metadata">

**Author:** [@vivekag7](https://discourse.julialang.org/u/vivekag7)\
**Replies:** 7\
**Last updated:** [January 30, 2024, 5:32pm UTC](https://discourse.julialang.org/t/issues-with-convergence-in-differential-equation-solver-using-dual-numbers/108871 "2024-01-30T17:32:10Z")

</div>

Hello Julia Community, I’m currently working on a differential equation problem related to ice flow modeling and encountering some issues with convergence when using Dual numbers. The problem converges as expected with F…

---

## [Why does my cubature of ODESolution break down with finite limits?](https://discourse.julialang.org/t/why-does-my-cubature-of-odesolution-break-down-with-finite-limits/108736)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 18\
**Last updated:** [January 24, 2024, 11:04am UTC](https://discourse.julialang.org/t/why-does-my-cubature-of-odesolution-break-down-with-finite-limits/108736 "2024-01-24T11:04:34Z")

</div>

I want to find the multi-dimensional integral of a scalar-valued function with vector argument defined on a rectangle (basically, product of truncated PDFs). The argument of the function comes from solving a system of OD…

---

## [@Printf with DecFP / Dec128](https://discourse.julialang.org/t/printf-with-decfp-dec128/108996)

<div class="topic-metadata">

**Author:** [@JonT](https://discourse.julialang.org/u/JonT)\
**Replies:** 2\
**Last updated:** [January 19, 2024, 10:08pm UTC](https://discourse.julialang.org/t/printf-with-decfp-dec128/108996 "2024-01-19T22:08:42Z")

</div>

I’m seeing two different outputs for Dec128 numbers println() vs @printf: (Julia v1.10.0 with DecFP v1.3.2) using Printf, Quadmath, DecFP C = log2(big(ℯ)) # \\euler \<tab\> to get symbol d = convert(Dec128, C) println("C …

---

## [Zygote silently fails on CircularArrays.jl](https://discourse.julialang.org/t/zygote-silently-fails-on-circulararrays-jl/87321)

<div class="topic-metadata">

**Author:** [@trakjohnson](https://discourse.julialang.org/u/trakjohnson)\
**Replies:** 2\
**Last updated:** [January 19, 2024, 12:54pm UTC](https://discourse.julialang.org/t/zygote-silently-fails-on-circulararrays-jl/87321 "2024-01-19T12:54:15Z")

</div>

It seems that Zygote silently fails when differentiating a function that takes and outputs CircularArrays, using a Zygote.Buffer to allow mutation. Here’s a comparison with ForwardDiff: using Zygote, ForwardDiff, Circul…

---

## [LU factorization and non-square matrices](https://discourse.julialang.org/t/lu-factorization-and-non-square-matrices/108834)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 6\
**Last updated:** [January 19, 2024, 10:23am UTC](https://discourse.julialang.org/t/lu-factorization-and-non-square-matrices/108834 "2024-01-19T10:23:09Z")

</div>

The documentation for \\ says For non-triangular square matrices, an LU factorization is used. For rectangular A the result is the minimum-norm least squares solution computed by a pivoted QR factorization of A and a r…

---

## [Problem implementing perpendicular Neumann boundary conditions using MethodOfLines.jl](https://discourse.julialang.org/t/problem-implementing-perpendicular-neumann-boundary-conditions-using-methodoflines-jl/108925)

<div class="topic-metadata">

**Author:** [@aharbick](https://discourse.julialang.org/u/aharbick)\
**Replies:** 0\
**Last updated:** [January 17, 2024, 7:37pm UTC](https://discourse.julialang.org/t/problem-implementing-perpendicular-neumann-boundary-conditions-using-methodoflines-jl/108925 "2024-01-17T19:37:21Z")

</div>

I am currently bug-fixing a more complicated set of equations I am trying to solve using MethodOfLines.jl and I have narrowed down the current issue I am facing to a particular term which involves a perpendicular Neumann…

---

## [Guide to numerical integration methods?](https://discourse.julialang.org/t/guide-to-numerical-integration-methods/108704)

<div class="topic-metadata">

**Author:** [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)\
**Replies:** 10\
**Last updated:** [January 16, 2024, 11:03pm UTC](https://discourse.julialang.org/t/guide-to-numerical-integration-methods/108704 "2024-01-16T23:03:20Z")

</div>

To pile on with a related question, as a EE without a particularly deep math background, @stevengj do you have any handy references for the different integration methods and their advantages/pitfalls? I find myself writ…

---

## [Some eigenpairs from a large, sparse, nonsymmetric matrix: Julia vs Matlab](https://discourse.julialang.org/t/some-eigenpairs-from-a-large-sparse-nonsymmetric-matrix-julia-vs-matlab/93742)

<div class="topic-metadata">

**Author:** [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Replies:** 22\
**Last updated:** [January 12, 2024, 4:18am UTC](https://discourse.julialang.org/t/some-eigenpairs-from-a-large-sparse-nonsymmetric-matrix-julia-vs-matlab/93742 "2024-01-12T04:18:21Z")

</div>

In the course of working through a book on frequency domain finite difference solutions for electromagnetics, I have been converting the supplied Matlab programs to Julia. For the problem of determining the modes of an …

---

## [Quadratures and cubatures with Dirac deltas](https://discourse.julialang.org/t/quadratures-and-cubatures-with-dirac-deltas/108683)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 11\
**Last updated:** [January 11, 2024, 6:46pm UTC](https://discourse.julialang.org/t/quadratures-and-cubatures-with-dirac-deltas/108683 "2024-01-11T18:46:46Z")

</div>

Are there ways to compute cubatures of functions that include the Dirac delta function?

---

## [Reduce(logaddexp,x) has arbitrarily better accuracy than logsumexp(x)](https://discourse.julialang.org/t/reduce-logaddexp-x-has-arbitrarily-better-accuracy-than-logsumexp-x/108229)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 11\
**Last updated:** [January 2, 2024, 4:01am UTC](https://discourse.julialang.org/t/reduce-logaddexp-x-has-arbitrarily-better-accuracy-than-logsumexp-x/108229 "2024-01-02T04:01:31Z")

</div>

It occurred to me this morning that logsumexp is associative and commutative and can be calculated with a simple reduce. We could write logsumexp(x) = reduce(logaddexp,x) Isn’t that pretty! So how does that compare t…

---

## [PreallocationTools.jl with nested ForwardDiff and sparsity pattern detection errors](https://discourse.julialang.org/t/preallocationtools-jl-with-nested-forwarddiff-and-sparsity-pattern-detection-errors/107897)

<div class="topic-metadata">

**Author:** [@asterycs](https://discourse.julialang.org/u/asterycs)\
**Replies:** 6\
**Last updated:** [January 1, 2024, 9:05pm UTC](https://discourse.julialang.org/t/preallocationtools-jl-with-nested-forwarddiff-and-sparsity-pattern-detection-errors/107897 "2024-01-01T21:05:57Z")

</div>

Hello! I’m trying to combine sparsity pattern detection with a nested ForwardDiff call together with PreallocationTools. A contrived, minimal example is below: using ForwardDiff using PreallocationTools using Symbolics…

---

## [Trouble with NeuralODE and Metal](https://discourse.julialang.org/t/trouble-with-neuralode-and-metal/107826)

<div class="topic-metadata">

**Author:** [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Replies:** 3\
**Last updated:** [December 28, 2023, 10:17pm UTC](https://discourse.julialang.org/t/trouble-with-neuralode-and-metal/107826 "2023-12-28T22:17:17Z")

</div>

I’m trying to do the canned basic neural ODE demo using Metal. First off, I was getting errors even with gdev=cpu\_device(), but I guessed at wrapping the solve() and prob\_neuralode() outputs with Array(), and then it se…

---

## [Matrix type for inversion](https://discourse.julialang.org/t/matrix-type-for-inversion/108107)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 2\
**Last updated:** [December 28, 2023, 9:22am UTC](https://discourse.julialang.org/t/matrix-type-for-inversion/108107 "2023-12-28T09:22:53Z")

</div>

Hi, I would like to solve a linear system A x=b where A is band by block. The bandwith can be big (~10). An example of such matrix is for example the one in the trapezoid method. I can do a LU decomposition to solve th…

---

## [SparseSparse for inverting structured sparse matrices](https://discourse.julialang.org/t/sparsesparse-for-inverting-structured-sparse-matrices/105715)

<div class="topic-metadata">

**Author:** [@loisel](https://discourse.julialang.org/u/loisel)\
**Replies:** 4\
**Last updated:** [December 27, 2023, 2:48pm UTC](https://discourse.julialang.org/t/sparsesparse-for-inverting-structured-sparse-matrices/105715 "2023-12-27T14:48:33Z")

</div>

Hello, A few days ago, I discovered in this discussion that there is seemingly no way of inverting structured sparse matrices in Julia. We say that a matrix A is morally block diagonal if there are permutation matrices P…

---

## [Complex exponentiation: 1^x ≈ 2](https://discourse.julialang.org/t/complex-exponentiation-1-x-2/107994)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 6\
**Last updated:** [December 24, 2023, 11:38pm UTC](https://discourse.julialang.org/t/complex-exponentiation-1-x-2/107994 "2023-12-24T23:38:47Z")

</div>

I have a mind worm, and I’m trying to figure out how we might express this in Julia. Examine the following REPL log including complex exponentiation. julia\> x = -1im \* log(2)/(2π) 0.0 - 0.1103178000763258im julia\> 1…

---

## [How to analyze sensitivity w.r.t. the initial values?](https://discourse.julialang.org/t/how-to-analyze-sensitivity-w-r-t-the-initial-values/107580)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 9\
**Last updated:** [December 21, 2023, 5:40pm UTC](https://discourse.julialang.org/t/how-to-analyze-sensitivity-w-r-t-the-initial-values/107580 "2023-12-21T17:40:21Z")

</div>

I want to run sensitivity analysis w.r.t. the initial conditions: using DifferentialEquations, Optimization, OptimizationPolyalgorithms, SciMLSensitivity, Zygote function harm\_osc\_matrix(t::Real, p::Vector) …

---

## [Where can I find certain matrix multiplication optimizations?](https://discourse.julialang.org/t/where-can-i-find-certain-matrix-multiplication-optimizations/107868)

<div class="topic-metadata">

**Author:** [@meisel](https://discourse.julialang.org/u/meisel)\
**Replies:** 2\
**Last updated:** [December 20, 2023, 6:24pm UTC](https://discourse.julialang.org/t/where-can-i-find-certain-matrix-multiplication-optimizations/107868 "2023-12-20T18:24:38Z")

</div>

Hi, there are a couple matrix multiplication optimizations that would have a big impact on the performance of my project. They are: Automatic coalescing of additions with multiplications, since \*gemm APIs typically all…

---

## [How to find solution from certain index in DifferentialEquations.jl](https://discourse.julialang.org/t/how-to-find-solution-from-certain-index-in-differentialequations-jl/107766)

<div class="topic-metadata">

**Author:** [@aoifehealy](https://discourse.julialang.org/u/aoifehealy)\
**Replies:** 2\
**Last updated:** [December 18, 2023, 1:37pm UTC](https://discourse.julialang.org/t/how-to-find-solution-from-certain-index-in-differentialequations-jl/107766 "2023-12-18T13:37:07Z")

</div>

Hi there, I have a DiffrentialEquations.jl solution from a model I created using ModelingToolkit.jl where u has a number of different columns. Is there a way of displaying the results of just the columns of a specified…

---

## [Sparse A\\B](https://discourse.julialang.org/t/sparse-a-b/107725)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 2\
**Last updated:** [December 17, 2023, 4:10am UTC](https://discourse.julialang.org/t/sparse-a-b/107725 "2023-12-17T04:10:11Z")

</div>

What is the best way to solve A\\B where A and B are sparse, and where the result is also known to be sparse? Right now it seems I have to do sparse(A \\ Matrix(B)).

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

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