# Numerics

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

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

**Page:** 28

---

## [In place GEMM](https://discourse.julialang.org/t/in-place-gemm/56260)

<div class="topic-metadata">

**Author:** [@Xijiang\_Yu](https://discourse.julialang.org/u/Xijiang_Yu)\
**Replies:** 6\
**Last updated:** [March 7, 2021, 11:26pm UTC](https://discourse.julialang.org/t/in-place-gemm/56260 "2021-03-07T23:26:04Z")

</div>

My LHS is huge and needs to be constructed by parts/sub-matrix. e.g., lhs = \[ b11 b12 b21 b22\] Is there a way to specify the results into a sub-matrix, e.g., b22, to save memory? I believe gemm in Julia is also b…

---

## [Gradient of NN not changing with different inputs](https://discourse.julialang.org/t/gradient-of-nn-not-changing-with-different-inputs/56435)

<div class="topic-metadata">

**Author:** [@edwinb-ai](https://discourse.julialang.org/u/edwinb-ai)\
**Replies:** 2\
**Last updated:** [March 3, 2021, 8:12pm UTC](https://discourse.julialang.org/t/gradient-of-nn-not-changing-with-different-inputs/56435 "2021-03-03T20:12:28Z")

</div>

While playing around with some neural networks (NN) I found out this using Flux using Random using Zygote using ForwardDiff Random.seed!(9120) n = 1 m = 5 hidden = 10 x, y = rand(m), rand(n) # some data model = Flux.…

---

## [Non-linear latency of sparse-dense matrix multiplication](https://discourse.julialang.org/t/non-linear-latency-of-sparse-dense-matrix-multiplication/56424)

<div class="topic-metadata">

**Author:** [@albin](https://discourse.julialang.org/u/albin)\
**Replies:** 11\
**Last updated:** [March 3, 2021, 5:37pm UTC](https://discourse.julialang.org/t/non-linear-latency-of-sparse-dense-matrix-multiplication/56424 "2021-03-03T17:37:52Z")

</div>

Hello, I’m measuring the latency of mul!(C, A, B), where C and B are dense and A is sparse, and I’m seeing something surprising: the latency isn’t linear in the number of operations required. Does anyone know why this i…

---

## [Update QR factorization by adding a column for orthogonal matching pursuit](https://discourse.julialang.org/t/update-qr-factorization-by-adding-a-column-for-orthogonal-matching-pursuit/56368)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 0\
**Last updated:** [March 2, 2021, 9:44pm UTC](https://discourse.julialang.org/t/update-qr-factorization-by-adding-a-column-for-orthogonal-matching-pursuit/56368 "2021-03-02T21:44:36Z")

</div>

Hello, I am working on the orthogonal matching pursuit algorithm to select a sparse set of features to solve Ax = b. In this algorithm, we add in a greedy fashion a new column (i.e. feature) at each step. The residual …

---

## [Implementation for accessing Cholesky factors](https://discourse.julialang.org/t/implementation-for-accessing-cholesky-factors/56219)

<div class="topic-metadata">

**Author:** [@ksil](https://discourse.julialang.org/u/ksil)\
**Replies:** 2\
**Last updated:** [March 2, 2021, 3:53am UTC](https://discourse.julialang.org/t/implementation-for-accessing-cholesky-factors/56219 "2021-03-02T03:53:42Z")

</div>

Hi everyone! I’ve been a Julia user for several years, but this is my first time posting here, so apologies if this has been asked somewhere before. I was curious about Julia’s implementation of Cholesky factorization —…

---

## [Discrete inverse Laplace transform (constrains and regularisation)](https://discourse.julialang.org/t/discrete-inverse-laplace-transform-constrains-and-regularisation/55580)

<div class="topic-metadata">

**Author:** [@MatFi](https://discourse.julialang.org/u/MatFi)\
**Replies:** 8\
**Last updated:** [February 21, 2021, 10:44am UTC](https://discourse.julialang.org/t/discrete-inverse-laplace-transform-constrains-and-regularisation/55580 "2021-02-21T10:44:31Z")

</div>

I want to conduct an Inverse Laplace Transform (ILT) on sampled data. I am aware of InverseLaplace.jl, but sadly it doesn’t work well on discrete (sampled) data due to a missing interface and regularization. So I decide…

---

## [How to test multiple parameters with SDE?](https://discourse.julialang.org/t/how-to-test-multiple-parameters-with-sde/55089)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 1\
**Last updated:** [February 14, 2021, 5:03pm UTC](https://discourse.julialang.org/t/how-to-test-multiple-parameters-with-sde/55089 "2021-02-14T17:03:45Z")

</div>

Hello, I would like to find the minimal amount of phages required to distinguish a bacterial population. I have run this model: using DifferentialEquations function growth!(du, u, p, t) μ, κ, φ, ω, η, β = p #=…

---

## [Truncating Floats into a specific Int size](https://discourse.julialang.org/t/truncating-floats-into-a-specific-int-size/55207)

<div class="topic-metadata">

**Author:** [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Replies:** 2\
**Last updated:** [February 13, 2021, 2:24pm UTC](https://discourse.julialang.org/t/truncating-floats-into-a-specific-int-size/55207 "2021-02-13T14:24:43Z")

</div>

Hi all. julia\> floor(Int, convert(Float64, typemax(Int))) ERROR: InexactError: trunc(Int64, 9.223372036854776e18) I understand why this happens. What I’m looking for here is a nice way of truncating the pathological ca…

---

## [Iterator over Floats](https://discourse.julialang.org/t/iterator-over-floats/55110)

<div class="topic-metadata">

**Author:** [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Replies:** 1\
**Last updated:** [February 12, 2021, 8:21am UTC](https://discourse.julialang.org/t/iterator-over-floats/55110 "2021-02-12T08:21:03Z")

</div>

So I’ve been working on special functions, and to help with that I’ve created this class that implements an Iterator of Float values. struct FloatIterator{T}\<:AbstractVector{T} min::T max::T FloatIterator{T}…

---

## [Solving ODE system with PINN](https://discourse.julialang.org/t/solving-ode-system-with-pinn/54750)

<div class="topic-metadata">

**Author:** [@Honza9723](https://discourse.julialang.org/u/Honza9723)\
**Replies:** 7\
**Last updated:** [February 7, 2021, 2:27am UTC](https://discourse.julialang.org/t/solving-ode-system-with-pinn/54750 "2021-02-07T02:27:04Z")

</div>

Dear All, I am trying to solve system of two ordinary differential equations. 𝝫’(x) = (λ-1/v(x))f(x) v’(x) = x^3(λf(x)/(λf(x)x-2𝝫(x)))^2 With boundary conditions 𝝫(x\_low) = 0 𝝫(x\_high) = 0 v(x) and 𝝫(x) are unknow…

---

## [Sparse vectors and BigFloat Heisenbug](https://discourse.julialang.org/t/sparse-vectors-and-bigfloat-heisenbug/54707)

<div class="topic-metadata">

**Author:** [@mbesancon](https://discourse.julialang.org/u/mbesancon)\
**Replies:** 4\
**Last updated:** [February 6, 2021, 10:14am UTC](https://discourse.julialang.org/t/sparse-vectors-and-bigfloat-heisenbug/54707 "2021-02-06T10:14:28Z")

</div>

I have in some weird side effect with structs of sparse vectors of BigFloats, where operating on a copy of the sum seems to change the struct itself. In spirit, the structure of the code looks like below. After a copyin…

---

## [Solve function for non full rank systems of equations](https://discourse.julialang.org/t/solve-function-for-non-full-rank-systems-of-equations/54611)

<div class="topic-metadata">

**Author:** [@Andres\_Legarra](https://discourse.julialang.org/u/Andres_Legarra)\
**Replies:** 4\
**Last updated:** [February 5, 2021, 1:27pm UTC](https://discourse.julialang.org/t/solve-function-for-non-full-rank-systems-of-equations/54611 "2021-02-05T13:27:05Z")

</div>

Typical OLS ( X'X a = X'y ) with 2 or more dummy (or cross-classified) effects are not full rank and they have infinite solutions. (Minimal example below.) They are conceptually solved using generalized inverses, to obta…

---

## [Julia SVD results differing from MATLAB](https://discourse.julialang.org/t/julia-svd-results-differing-from-matlab/54151)

<div class="topic-metadata">

**Author:** [@djov5](https://discourse.julialang.org/u/djov5)\
**Replies:** 5\
**Last updated:** [February 2, 2021, 4:34pm UTC](https://discourse.julialang.org/t/julia-svd-results-differing-from-matlab/54151 "2021-02-02T16:34:11Z")

</div>

I’ve been scratching my head about this for some time now and thought of asking to see if anyone has a fix for this. I am converting a code from MATLAB into Julia and it requires the use of svd and eig multiple times. I …

---

## [Methods to diagonalize a Matrix{BigFloat}?](https://discourse.julialang.org/t/methods-to-diagonalize-a-matrix-bigfloat/4571)

<div class="topic-metadata">

**Author:** [@lbenet](https://discourse.julialang.org/u/lbenet)\
**Replies:** 22\
**Last updated:** [January 26, 2021, 4:46am UTC](https://discourse.julialang.org/t/methods-to-diagonalize-a-matrix-bigfloat/4571 "2021-01-26T04:46:09Z")

</div>

Does anyone know about methods (or packages) that allow to diagonalize a Matrix{BigFloat}? So far, I have only found (in IterativeSolvers.jl) that powm and invpowm do work with Matrix{BigFloat}, but using them I get onl…

---

## [DoubleFloats plans for fft](https://discourse.julialang.org/t/doublefloats-plans-for-fft/53921)

<div class="topic-metadata">

**Author:** [@Jaime\_Araneda](https://discourse.julialang.org/u/Jaime_Araneda)\
**Replies:** 5\
**Last updated:** [January 25, 2021, 9:33pm UTC](https://discourse.julialang.org/t/doublefloats-plans-for-fft/53921 "2021-01-25T21:33:26Z")

</div>

Hi, I would like to use fft’s under DoubleFloats. Is it possible to use plans to optimize the calculations? Many thanks! Jaime

---

## [PINN with two boundary conditions](https://discourse.julialang.org/t/pinn-with-two-boundary-conditions/53813)

<div class="topic-metadata">

**Author:** [@Honza9723](https://discourse.julialang.org/u/Honza9723)\
**Replies:** 2\
**Last updated:** [January 23, 2021, 10:54am UTC](https://discourse.julialang.org/t/pinn-with-two-boundary-conditions/53813 "2021-01-23T10:54:12Z")

</div>

Hi, I am working on a physically informed neural network solution of ODE with two boundary conditions. In a standard initial value problem, let’s say y(x) - y’(x) = 0 with y(0) = 1, I would use approximation in a form y…

---

## [A thick restarded Lanczos method with deflation/locking?](https://discourse.julialang.org/t/a-thick-restarded-lanczos-method-with-deflation-locking/53788)

<div class="topic-metadata">

**Author:** [@Bruno\_Amorim](https://discourse.julialang.org/u/Bruno_Amorim)\
**Replies:** 0\
**Last updated:** [January 22, 2021, 4:31pm UTC](https://discourse.julialang.org/t/a-thick-restarded-lanczos-method-with-deflation-locking/53788 "2021-01-22T16:31:06Z")

</div>

First some context: In the search for efficient eigensolvers for inner eigenvalues of hermitian matrices, I came across the following papers: \[1512.08135\] A Thick-Restart Lanczos algorithm with polynomial filtering for…

---

## [Only the explicit Euler method successfully solves my ODE](https://discourse.julialang.org/t/only-the-explicit-euler-method-successfully-solves-my-ode/53704)

<div class="topic-metadata">

**Author:** [@ash](https://discourse.julialang.org/u/ash)\
**Replies:** 8\
**Last updated:** [January 21, 2021, 8:17pm UTC](https://discourse.julialang.org/t/only-the-explicit-euler-method-successfully-solves-my-ode/53704 "2021-01-21T20:17:00Z")

</div>

I realize this is not a very good question due to the nature of the problem, but I have to try since I’ve spent hours debugging this. I am interested in solving a set of ODEs that can be written as follows: using Ellipt…

---

## [Finding roots of a complex transcedental function](https://discourse.julialang.org/t/finding-roots-of-a-complex-transcedental-function/53407)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 0\
**Last updated:** [January 15, 2021, 9:01pm UTC](https://discourse.julialang.org/t/finding-roots-of-a-complex-transcedental-function/53407 "2021-01-15T21:01:28Z")

</div>

I am trying to do root-finding on a complex function. The function is a 3x3 matrix in the Laplacian domain. I would like to find the values of “s”, where the determinant of this matrix is zero. I am not sure what the …

---

## [ForwardDiff: "No Method Matching" Error](https://discourse.julialang.org/t/forwarddiff-no-method-matching-error/53311)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 9\
**Last updated:** [January 15, 2021, 12:19am UTC](https://discourse.julialang.org/t/forwarddiff-no-method-matching-error/53311 "2021-01-15T00:19:25Z")

</div>

I’m testing out the ForwardDiff package for the first time, but unfortunately I’m getting a “No Method Matching” error that I can’t figure out. I was successful in making the following test example by mimicking the one …

---

## [Tensor contractions with symmetries](https://discourse.julialang.org/t/tensor-contractions-with-symmetries/52980)

<div class="topic-metadata">

**Author:** [@Nellatur](https://discourse.julialang.org/u/Nellatur)\
**Replies:** 3\
**Last updated:** [January 13, 2021, 4:48pm UTC](https://discourse.julialang.org/t/tensor-contractions-with-symmetries/52980 "2021-01-13T16:48:12Z")

</div>

I have some tensor contractions, e.g., A\[abcd\] B\[cdef\] = C\[abef\], where A\[abcd\] = A\[badc\] and B\[cdef\] = B\[dcfe\]. I did not find information about symmetry in einsum in NumPy. Is there any Julia package can handle tensor …

---

## [Eigenvalue calculation differs between Julia and MATLAB](https://discourse.julialang.org/t/eigenvalue-calculation-differs-between-julia-and-matlab/31185)

<div class="topic-metadata">

**Author:** [@ElectronicTeaCup](https://discourse.julialang.org/u/ElectronicTeaCup)\
**Replies:** 25\
**Last updated:** [January 8, 2021, 5:16pm UTC](https://discourse.julialang.org/t/eigenvalue-calculation-differs-between-julia-and-matlab/31185 "2021-01-08T17:16:24Z")

</div>

I am determining the eigenvectors of some matrices, however, the result appears a little different between Julia and MATLAB. I’m porting some code onto Julia and want the exact output as I would see in MATLAB/OCTAVE. Any…

---

## [Derivative with respect to specified element of a vector](https://discourse.julialang.org/t/derivative-with-respect-to-specified-element-of-a-vector/53045)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 2\
**Last updated:** [January 8, 2021, 3:34pm UTC](https://discourse.julialang.org/t/derivative-with-respect-to-specified-element-of-a-vector/53045 "2021-01-08T15:34:58Z")

</div>

For example, I have the following function function test\_fun(state) x, y = state # 2 values \[x\*y^2\] end state = \[2,3\] test\_fun(state) I’d like to find the mixed derivative \\frac{d^2f}{dxdy} for vector case. I…

---

## [Gauss-Legendre Quadrature performance](https://discourse.julialang.org/t/gauss-legendre-quadrature-performance/52958)

<div class="topic-metadata">

**Author:** [@Nellatur](https://discourse.julialang.org/u/Nellatur)\
**Replies:** 5\
**Last updated:** [January 7, 2021, 12:26pm UTC](https://discourse.julialang.org/t/gauss-legendre-quadrature-performance/52958 "2021-01-07T12:26:34Z")

</div>

Hi, I found a benchmark set with Julia and other languages at https://modelingguru.nasa.gov/docs/DOC-2676 It seems that the Gauss-Legendre Quadrature case Julia is slower than Python :frowning: I also found GitHub - …

---

## [Tensor contration efficiency](https://discourse.julialang.org/t/tensor-contration-efficiency/52897)

<div class="topic-metadata">

**Author:** [@Nellatur](https://discourse.julialang.org/u/Nellatur)\
**Replies:** 4\
**Last updated:** [January 6, 2021, 7:35pm UTC](https://discourse.julialang.org/t/tensor-contration-efficiency/52897 "2021-01-06T19:35:21Z")

</div>

I saw some benchmark between NumPy and BLAS from C++ regarding matrix-matrix multiplication (a special case of tensor contraction) https://stackoverflow.com/questions/7596612/benchmarking-python-vs-c-using-blas-and-nump…

---

## [List comprehension and integration of a function](https://discourse.julialang.org/t/list-comprehension-and-integration-of-a-function/52747)

<div class="topic-metadata">

**Author:** [@Nkrause](https://discourse.julialang.org/u/Nkrause)\
**Replies:** 5\
**Last updated:** [January 4, 2021, 5:15pm UTC](https://discourse.julialang.org/t/list-comprehension-and-integration-of-a-function/52747 "2021-01-04T17:15:24Z")

</div>

I’m currently attempting to integrate a function in Julia using QuadGK() of the following form. It’s computing the potential of a ring of charge in space. \\phi=\\int\_0^{2\\pi} \\frac{1}{\\sqrt{(x-cos(t))^2+(y-sin(t))^2+z^2)…

---

## [How to solve Lambert W function?](https://discourse.julialang.org/t/how-to-solve-lambert-w-function/52538)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 17\
**Last updated:** [December 29, 2020, 3:48pm UTC](https://discourse.julialang.org/t/how-to-solve-lambert-w-function/52538 "2020-12-29T15:48:07Z")

</div>

I have this equation Nₜ₊₁ = Nₜ exp\[μ(1-Nₜ/K)\] I would like to solve it the other way round: knowing Nₜ₊₁, I would like to estimate Nₜ. This is in the form y = x exp(a(1−x/k)) From this post looks like the solution is…

---

## [LAPACK error from quadgk integration](https://discourse.julialang.org/t/lapack-error-from-quadgk-integration/52533)

<div class="topic-metadata">

**Author:** [@Nkrause](https://discourse.julialang.org/u/Nkrause)\
**Replies:** 5\
**Last updated:** [December 29, 2020, 2:02am UTC](https://discourse.julialang.org/t/lapack-error-from-quadgk-integration/52533 "2020-12-29T02:02:03Z")

</div>

I’m trying to integrate the following formula. It computes an electric potential at a point from a circular ring of charge. \\phi=\\int\_0^{2\\pi} \\frac{1}{\\sqrt{(x-cos(t))^2+(y-sin(t))^2+z^2)}}dt I’ve implemented the func…

---

## [Quadgk integration](https://discourse.julialang.org/t/quadgk-integration/52489)

<div class="topic-metadata">

**Author:** [@Nkrause](https://discourse.julialang.org/u/Nkrause)\
**Replies:** 2\
**Last updated:** [December 28, 2020, 2:56am UTC](https://discourse.julialang.org/t/quadgk-integration/52489 "2020-12-28T02:56:21Z")

</div>

Hello, I’ve got a function I’m trying to integrate, it’s a single variable for a position in space (an electric potential at that point). I’d like to pass my function a position, and have it evaluate the integral at that…

---

## [Custom function for eigenvectors designed for my sparse matrix can't beat eigen](https://discourse.julialang.org/t/custom-function-for-eigenvectors-designed-for-my-sparse-matrix-cant-beat-eigen/52008)

<div class="topic-metadata">

**Author:** [@physicophilic](https://discourse.julialang.org/u/physicophilic)\
**Replies:** 17\
**Last updated:** [December 27, 2020, 7:54pm UTC](https://discourse.julialang.org/t/custom-function-for-eigenvectors-designed-for-my-sparse-matrix-cant-beat-eigen/52008 "2020-12-27T19:54:04Z")

</div>

I have a matrix of the form Jy = \[\[ 0 -im\*N1 0 0 ....... \] \[im\*N1 0 -im\*N2 0 ..... \] \[0 im\*N2 0 -im\*N3 ....\] ..................................…

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

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