# Numerics

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

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

**Page:** 20

---

## [Question on how to define equation system in DiffEq using Matrix form](https://discourse.julialang.org/t/question-on-how-to-define-equation-system-in-diffeq-using-matrix-form/85286)

<div class="topic-metadata">

**Author:** [@kwwong333](https://discourse.julialang.org/u/kwwong333)\
**Replies:** 1\
**Last updated:** [August 4, 2022, 10:42am UTC](https://discourse.julialang.org/t/question-on-how-to-define-equation-system-in-diffeq-using-matrix-form/85286 "2022-08-04T10:42:39Z")

</div>

Hello Guys, Previously, we handled CFD problems involving algebraic equations in the form of a matrix using a simple self-coded and stupid solver :). After reading the capability of Diffeq, we would like to move into Di…

---

## [Problem with SymPy. Symbolic calculation of Sturm chains (Sturm sequence) for polynomials](https://discourse.julialang.org/t/problem-with-sympy-symbolic-calculation-of-sturm-chains-sturm-sequence-for-polynomials/84921)

<div class="topic-metadata">

**Author:** [@mendeli](https://discourse.julialang.org/u/mendeli)\
**Replies:** 2\
**Last updated:** [August 3, 2022, 4:44pm UTC](https://discourse.julialang.org/t/problem-with-sympy-symbolic-calculation-of-sturm-chains-sturm-sequence-for-polynomials/84921 "2022-08-03T16:44:54Z")

</div>

I was using sympy.sturm() to calculate the Sturm functions of a polynomial and came across an error for a 4th degree polynomial using SymPy begin @vars x # Polynomial coefficients c4 = Sym\[1; -4; 8; -8; 4\] # Probl…

---

## [Is there any way to optimize array additions and multiplications with transposes?](https://discourse.julialang.org/t/is-there-any-way-to-optimize-array-additions-and-multiplications-with-transposes/80268)

<div class="topic-metadata">

**Author:** [@Geositta](https://discourse.julialang.org/u/Geositta)\
**Replies:** 27\
**Last updated:** [August 2, 2022, 8:06am UTC](https://discourse.julialang.org/t/is-there-any-way-to-optimize-array-additions-and-multiplications-with-transposes/80268 "2022-08-02T08:06:32Z")

</div>

The question is related to python - Optimizing array additions and multiplications with transposes - Stack Overflow Given A is an array, I want to evaluate sum += p(A) \* factor(p) where p is a permutation/transpose, fa…

---

## [Any conjugate gradient method allowing a custom inner product?](https://discourse.julialang.org/t/any-conjugate-gradient-method-allowing-a-custom-inner-product/84982)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 5\
**Last updated:** [July 30, 2022, 5:57am UTC](https://discourse.julialang.org/t/any-conjugate-gradient-method-allowing-a-custom-inner-product/84982 "2022-07-30T05:57:01Z")

</div>

Is there any conjugate gradient (CG) implementation in Julia allowing one to specify the inner product (with a fixed symmetric and positive definite matrix M, say)? In my use case, I know my system matrix A is symmetric…

---

## [Control of Time-Step size in OrdinaryDiffEq](https://discourse.julialang.org/t/control-of-time-step-size-in-ordinarydiffeq/84949)

<div class="topic-metadata">

**Author:** [@Whyborn](https://discourse.julialang.org/u/Whyborn)\
**Replies:** 4\
**Last updated:** [July 29, 2022, 11:39pm UTC](https://discourse.julialang.org/t/control-of-time-step-size-in-ordinarydiffeq/84949 "2022-07-29T23:39:52Z")

</div>

Hi, I am trying to use OrdinaryDiffEq for the time integration of a hyperbolic PDE system in a finite-volume context. I want to control the size of the time-step through a CFL condition, rather than by some error norm. …

---

## [Growing cell population using callback](https://discourse.julialang.org/t/growing-cell-population-using-callback/84970)

<div class="topic-metadata">

**Author:** [@hbooth](https://discourse.julialang.org/u/hbooth)\
**Replies:** 10\
**Last updated:** [July 29, 2022, 2:11pm UTC](https://discourse.julialang.org/t/growing-cell-population-using-callback/84970 "2022-07-29T14:11:33Z")

</div>

Hi everyone, I am building a model of a growing cell population. I want to make use of callback to evaluate the ‘division’ event, similar to the example in this tutorial - Event Handling and Callback Functions · Differe…

---

## [Unbounded Numerical Integration, non-centered](https://discourse.julialang.org/t/unbounded-numerical-integration-non-centered/84947)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 3\
**Last updated:** [July 29, 2022, 1:43am UTC](https://discourse.julialang.org/t/unbounded-numerical-integration-non-centered/84947 "2022-07-29T01:43:31Z")

</div>

I’m interested in integrating f(x)\\phi(x) over the entire real line, where \\phi(x) is the Gaussian/Normal density function. Ordinarily the Gauss-Hermite method in FastGaussQuadrature would be good for this (with suitabl…

---

## [Update on future developement of BVP solvers?](https://discourse.julialang.org/t/update-on-future-developement-of-bvp-solvers/84839)

<div class="topic-metadata">

**Author:** [@MButler](https://discourse.julialang.org/u/MButler)\
**Replies:** 6\
**Last updated:** [July 27, 2022, 11:47pm UTC](https://discourse.julialang.org/t/update-on-future-developement-of-bvp-solvers/84839 "2022-07-27T23:47:06Z")

</div>

I’m currently doing research in gravitational physics and the problems I’m working with often end up as BVPs that are very stiff and sensitive to the initial conditions. It seems this is still a weak point for Julia’s BV…

---

## [ApproxFun and Burgers' equation](https://discourse.julialang.org/t/approxfun-and-burgers-equation/84660)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 6\
**Last updated:** [July 26, 2022, 8:22pm UTC](https://discourse.julialang.org/t/approxfun-and-burgers-equation/84660 "2022-07-26T20:22:11Z")

</div>

I am trying to use ApproxFun to solve Burgers’ equation, u\_t + uu\_x = \\mu u\_{xx}, on the interval -L \\leq x \\leq L with initial condition u(x, 0) = f(x) = 1/(1+x^2) and boundary conditions u(\\pm L, t) = 0. I was trying t…

---

## [Strange Memory Allocations with DifferentialEquations](https://discourse.julialang.org/t/strange-memory-allocations-with-differentialequations/83909)

<div class="topic-metadata">

**Author:** [@7vn](https://discourse.julialang.org/u/7vn)\
**Replies:** 3\
**Last updated:** [July 26, 2022, 2:33am UTC](https://discourse.julialang.org/t/strange-memory-allocations-with-differentialequations/83909 "2022-07-26T02:33:58Z")

</div>

Hello, I’m observing very strange and large memory allocations while solving a standard ODE and evaluating it at given times. However, after the first benchmark, if (and only if!) I recompile the integrated function the…

---

## [Boundary Value Problem Incompatible With Ensemble Simulations](https://discourse.julialang.org/t/boundary-value-problem-incompatible-with-ensemble-simulations/84233)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 1\
**Last updated:** [July 20, 2022, 5:37pm UTC](https://discourse.julialang.org/t/boundary-value-problem-incompatible-with-ensemble-simulations/84233 "2022-07-20T17:37:05Z")

</div>

Hi all, I have a boundary value differential equation that I would like to solve, and it has a random coefficient. I would like to be able to use the Ensemble Simulation functionality documented here, as I have with ini…

---

## [Performance LinearOperators.jl](https://discourse.julialang.org/t/performance-linearoperators-jl/84271)

<div class="topic-metadata">

**Author:** [@Dario-Rosa85](https://discourse.julialang.org/u/Dario-Rosa85)\
**Replies:** 2\
**Last updated:** [July 16, 2022, 11:56am UTC](https://discourse.julialang.org/t/performance-linearoperators-jl/84271 "2022-07-16T11:56:49Z")

</div>

I have a question on the use of the package LinearOperators.jl. I am writing a code where the performance speed is crucial. The code is based on computing many-times the action of a linear operator over a given vector. N…

---

## [Problem with ImplicitEquation involving the incomplete gamma function](https://discourse.julialang.org/t/problem-with-implicitequation-involving-the-incomplete-gamma-function/84247)

<div class="topic-metadata">

**Author:** [@Dennis-Yang87](https://discourse.julialang.org/u/Dennis-Yang87)\
**Replies:** 2\
**Last updated:** [July 15, 2022, 1:45am UTC](https://discourse.julialang.org/t/problem-with-implicitequation-involving-the-incomplete-gamma-function/84247 "2022-07-15T01:45:38Z")

</div>

Hi everyone, I am new to Julia and trying to plot an implicit function involving incomplete gamma function Q(x, a) with the code below (gamma\_inc returns a two-element tuple and I only need the second element, so the in…

---

## [Bifurcation analysis with history in ODEs](https://discourse.julialang.org/t/bifurcation-analysis-with-history-in-odes/84070)

<div class="topic-metadata">

**Author:** [@nkoch](https://discourse.julialang.org/u/nkoch)\
**Replies:** 12\
**Last updated:** [July 13, 2022, 5:18pm UTC](https://discourse.julialang.org/t/bifurcation-analysis-with-history-in-odes/84070 "2022-07-13T17:18:18Z")

</div>

Hello, I’m relatively new to using Julia and I am trying to do bifurcation analysis. I have a system of ODEs in which one DE depends on the history of another variable (i.e. du\[2\] depends on history of u\[1\]). From what …

---

## [Calculation Pi^Pi^Pi in hexadecimal in High precision](https://discourse.julialang.org/t/calculation-pi-pi-pi-in-hexadecimal-in-high-precision/51785)

<div class="topic-metadata">

**Author:** [@rbdaus](https://discourse.julialang.org/u/rbdaus)\
**Replies:** 61\
**Last updated:** [July 13, 2022, 2:32pm UTC](https://discourse.julialang.org/t/calculation-pi-pi-pi-in-hexadecimal-in-high-precision/51785 "2022-07-13T14:32:51Z")

</div>

Hello! I have a math question. In Wolfram Language I can type this: BaseForm\[N\[Pi^Pi^Pi, 100000\], 16\] and get VERY FAST the result of up to 100,000 hexadecimal digits for the expression “Pi^Pi^Pi” (a few seconds) B…

---

## [Elliptic theta functions](https://discourse.julialang.org/t/elliptic-theta-functions/65742)

<div class="topic-metadata">

**Author:** [@Gabrielmlando](https://discourse.julialang.org/u/Gabrielmlando)\
**Replies:** 15\
**Last updated:** [July 13, 2022, 1:44pm UTC](https://discourse.julialang.org/t/elliptic-theta-functions/65742 "2022-07-13T13:44:26Z")

</div>

Are elliptic theta functions implemented in Julia? They exist in Mathematica as EllipticTheta, but I need them for heavy numerical calculations.

---

## [Matrices vs vectors of vectors performance](https://discourse.julialang.org/t/matrices-vs-vectors-of-vectors-performance/84157)

<div class="topic-metadata">

**Author:** [@Dario-Rosa85](https://discourse.julialang.org/u/Dario-Rosa85)\
**Replies:** 3\
**Last updated:** [July 13, 2022, 12:35pm UTC](https://discourse.julialang.org/t/matrices-vs-vectors-of-vectors-performance/84157 "2022-07-13T12:35:32Z")

</div>

Coming from Mathematica I have been used on thinking about matrices as lists of lists. Hence, I use the same point of view in Julia and, when I have many vectors to be treated homogeneously, I pack them into vectors of v…

---

## [Defing ODEsystem in function and initial conditions outside the function in ModelingToolkit.jl](https://discourse.julialang.org/t/defing-odesystem-in-function-and-initial-conditions-outside-the-function-in-modelingtoolkit-jl/79195)

<div class="topic-metadata">

**Author:** [@mochell](https://discourse.julialang.org/u/mochell)\
**Replies:** 5\
**Last updated:** [July 6, 2022, 8:23am UTC](https://discourse.julialang.org/t/defing-odesystem-in-function-and-initial-conditions-outside-the-function-in-modelingtoolkit-jl/79195 "2022-07-06T08:23:44Z")

</div>

Hi, I try to initialize an ODE system in a function and then assign initial conditions and parameters through any kind of named structure (dict, vector(tuples), or whatever). However, the only way to set parameters outs…

---

## [Removing singularities from callable functions built from symbolic expressions](https://discourse.julialang.org/t/removing-singularities-from-callable-functions-built-from-symbolic-expressions/83505)

<div class="topic-metadata">

**Author:** [@mrhardman](https://discourse.julialang.org/u/mrhardman)\
**Replies:** 2\
**Last updated:** [June 29, 2022, 5:11pm UTC](https://discourse.julialang.org/t/removing-singularities-from-callable-functions-built-from-symbolic-expressions/83505 "2022-06-29T17:11:09Z")

</div>

I have a basic question regarding building functions from symbolic expressions for which I cannot find the answer on the documentation (Symbolic Calculations and Building Callable Functions · Symbolics.jl) Suppose that …

---

## [Issue when calling the ?gemm\_batch function from MKL](https://discourse.julialang.org/t/issue-when-calling-the-gemm-batch-function-from-mkl/83232)

<div class="topic-metadata">

**Author:** [@EduMolinero](https://discourse.julialang.org/u/EduMolinero)\
**Replies:** 0\
**Last updated:** [June 23, 2022, 11:03am UTC](https://discourse.julialang.org/t/issue-when-calling-the-gemm-batch-function-from-mkl/83232 "2022-06-23T11:03:57Z")

</div>

Hi! I’m trying to implement the ?gemm\_batch functions from the Intel MKL library into Julia. These functions performs matrix-matrix operations with groups of matrices, processing a number of groups at once. Just for te…

---

## [Matrix multiplication in summation form](https://discourse.julialang.org/t/matrix-multiplication-in-summation-form/83020)

<div class="topic-metadata">

**Author:** [@horvetz](https://discourse.julialang.org/u/horvetz)\
**Replies:** 8\
**Last updated:** [June 20, 2022, 4:00am UTC](https://discourse.julialang.org/t/matrix-multiplication-in-summation-form/83020 "2022-06-20T04:00:53Z")

</div>

How to write an explicit one-line code for matrix multiplication A\*B, each of size n by n, for example using the summation definition of matrix multiplication (here, eq 14)? I know how to do it for matrix-vector multipl…

---

## [Exponentiation and machine precision](https://discourse.julialang.org/t/exponentiation-and-machine-precision/79024)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 18\
**Last updated:** [June 8, 2022, 9:16am UTC](https://discourse.julialang.org/t/exponentiation-and-machine-precision/79024 "2022-06-08T09:16:10Z")

</div>

In some simulations I am encountering a problem due to machine precision. I have to conduct an exponentiation operation on a number that lies in (0, 1). That number comes from a random number generator, while the exponen…

---

## [Solving symbolic system of equations using Ax = b](https://discourse.julialang.org/t/solving-symbolic-system-of-equations-using-ax-b/82454)

<div class="topic-metadata">

**Author:** [@jpro](https://discourse.julialang.org/u/jpro)\
**Replies:** 9\
**Last updated:** [June 9, 2022, 8:29pm UTC](https://discourse.julialang.org/t/solving-symbolic-system-of-equations-using-ax-b/82454 "2022-06-09T20:29:55Z")

</div>

I’m attempting to solve a system of 8 vector equations with 8 unknown vectors symbolically in Julia using Ax = b. The matrix is 24\*24 (due to 3-dimensional vectors) of variables I’ve defined using @ vars After defining …

---

## [Best way to compute eigenvalues of As + i Bs where As and Bs are symmetric?](https://discourse.julialang.org/t/best-way-to-compute-eigenvalues-of-as-i-bs-where-as-and-bs-are-symmetric/82428)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 5:41pm UTC](https://discourse.julialang.org/t/best-way-to-compute-eigenvalues-of-as-i-bs-where-as-and-bs-are-symmetric/82428 "2022-06-08T17:41:58Z")

</div>

I’m trying to compute the eigenvalues of a matrix M = As + im \* Bs, where As and Bs are real, symmetric matrices (and don’t commute in general). I realize that the eigenvalues will be complex in general, with the real pa…

---

## [Assigning a concentrated load to a specific point in the boundary](https://discourse.julialang.org/t/assigning-a-concentrated-load-to-a-specific-point-in-the-boundary/82419)

<div class="topic-metadata">

**Author:** [@refauhx](https://discourse.julialang.org/u/refauhx)\
**Replies:** 0\
**Last updated:** [June 8, 2022, 9:27am UTC](https://discourse.julialang.org/t/assigning-a-concentrated-load-to-a-specific-point-in-the-boundary/82419 "2022-06-08T09:27:05Z")

</div>

Hi everyone, I am a beginner in Julia and I want to assign a concentrated load pointed downwards into the middle point of the boundary of my model. Unfortunately, this code gives me some results just when my tag used is…

---

## [How to solve \`no method matching real(::String)\` when solving ODEs?](https://discourse.julialang.org/t/how-to-solve-no-method-matching-real-string-when-solving-odes/82294)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 4\
**Last updated:** [June 8, 2022, 5:50am UTC](https://discourse.julialang.org/t/how-to-solve-no-method-matching-real-string-when-solving-odes/82294 "2022-06-08T05:50:11Z")

</div>

Hello, I am simulating a microbial consortium (2 bacteria, 2 phages) but I get a MethodError during the solving step. Since I have duplicated items (two growth rates, two infection rates etc) I used vectors of 2 element…

---

## [Why the time consumed of LAPACK.potrf! increase hugely when the dimension is bigger than a special number](https://discourse.julialang.org/t/why-the-time-consumed-of-lapack-potrf-increase-hugely-when-the-dimension-is-bigger-than-a-special-number/82270)

<div class="topic-metadata">

**Author:** [@wly](https://discourse.julialang.org/u/wly)\
**Replies:** 4\
**Last updated:** [June 7, 2022, 12:51pm UTC](https://discourse.julialang.org/t/why-the-time-consumed-of-lapack-potrf-increase-hugely-when-the-dimension-is-bigger-than-a-special-number/82270 "2022-06-07T12:51:21Z")

</div>

When I use LAPACK.potrf! do Cholesky decomposition, I met this question. using StaticArrays using TimerOutputs using LinearAlgebra function test3\_1(Quu) @timeit "LAPACK.potrf!" LAPACK.potrf!('U',Quu) end n = 16 Quu1…

---

## [How to solve this Ax=b faster?](https://discourse.julialang.org/t/how-to-solve-this-ax-b-faster/81693)

<div class="topic-metadata">

**Author:** [@Minimum-Pollution-96](https://discourse.julialang.org/u/Minimum-Pollution-96)\
**Replies:** 24\
**Last updated:** [June 7, 2022, 8:40am UTC](https://discourse.julialang.org/t/how-to-solve-this-ax-b-faster/81693 "2022-06-07T08:40:32Z")

</div>

I am trying to solve a sparse stiffness matrix (positive definite) of size 1986360x1986360 SparseMatrixCSC{Float64, Int64} with 18327153 stored entries. Here’s a sample code. using SparseArrays using LinearAlgebra A =…

---

## [Abstract vector-multiplier type](https://discourse.julialang.org/t/abstract-vector-multiplier-type/82119)

<div class="topic-metadata">

**Author:** [@EdTi](https://discourse.julialang.org/u/EdTi)\
**Replies:** 4\
**Last updated:** [June 2, 2022, 11:54am UTC](https://discourse.julialang.org/t/abstract-vector-multiplier-type/82119 "2022-06-02T11:54:57Z")

</div>

Hello everyone, I’m implementing a linear map. This operator basically applies three matrices one after the other, to a vector. Example : you have an SPD matrix A, and you have L its incomplete Cholesky factor, and I wa…

---

## [Detecting low precision contamination of DoubleFloats.jl](https://discourse.julialang.org/t/detecting-low-precision-contamination-of-doublefloats-jl/77408)

<div class="topic-metadata">

**Author:** [@HexSpin](https://discourse.julialang.org/u/HexSpin)\
**Replies:** 15\
**Last updated:** [May 28, 2022, 7:56am UTC](https://discourse.julialang.org/t/detecting-low-precision-contamination-of-doublefloats-jl/77408 "2022-05-28T07:56:22Z")

</div>

For the last many months I’ve very happily used DoubleFloats.jl to compute series akin to 1+1/2+1/3-1/4-1/5… with varying signs changes and ranges up to (and fractions as as small as) 1/10^15 – or smaller. As these summ…

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

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