# Numerics

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

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

**Page:** 18

---

## [Zombies in biological ODE : why is my solver not sticking to zero?](https://discourse.julialang.org/t/zombies-in-biological-ode-why-is-my-solver-not-sticking-to-zero/90409)

<div class="topic-metadata">

**Author:** [@iago-lito](https://discourse.julialang.org/u/iago-lito)\
**Replies:** 25\
**Last updated:** [November 21, 2022, 9:00am UTC](https://discourse.julialang.org/t/zombies-in-biological-ode-why-is-my-solver-not-sticking-to-zero/90409 "2022-11-21T09:00:32Z")

</div>

Hi numerical ODE solvers enthusiasts, we’ve got a problem here that we think necessitates your kind input :slight\_smile: Here are two related questions: The following ODE system represents biological species biomasses B…

---

## [\[ANN\] Implementation of the subspace iteration method for the generalized EP](https://discourse.julialang.org/t/ann-implementation-of-the-subspace-iteration-method-for-the-generalized-ep/90553)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 0\
**Last updated:** [November 20, 2022, 6:53pm UTC](https://discourse.julialang.org/t/ann-implementation-of-the-subspace-iteration-method-for-the-generalized-ep/90553 "2022-11-20T18:53:37Z")

</div>

Interested in finding the smallest eigenvalue of the generalized EP? This package might be an alternative to Arpack. It isn’t as fast, but only a little bit slower. It is all Julia, as opposed to Arpack. If you have any…

---

## [DynamicalSystems.jl: how to change the value of a parameter after a certain period](https://discourse.julialang.org/t/dynamicalsystems-jl-how-to-change-the-value-of-a-parameter-after-a-certain-period/88248)

<div class="topic-metadata">

**Author:** [@josec](https://discourse.julialang.org/u/josec)\
**Replies:** 9\
**Last updated:** [November 19, 2022, 9:56pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-how-to-change-the-value-of-a-parameter-after-a-certain-period/88248 "2022-11-19T21:56:26Z")

</div>

Hi. I hope this question is placed in the proper category. I have studied the DynamicalSystems.jl guidelines also followed in a very useful video by Datseris (https://www.youtube.com/watch?v=13hqE\_1a158). Suppose I ha…

---

## [1D adaptive integration of a function with a parameter](https://discourse.julialang.org/t/1d-adaptive-integration-of-a-function-with-a-parameter/90365)

<div class="topic-metadata">

**Author:** [@sylvian\_kahane](https://discourse.julialang.org/u/sylvian_kahane)\
**Replies:** 2\
**Last updated:** [November 17, 2022, 11:29am UTC](https://discourse.julialang.org/t/1d-adaptive-integration-of-a-function-with-a-parameter/90365 "2022-11-17T11:29:03Z")

</div>

The hquadrature (hcubature) does not offer the possibility to transfer arguments to the integrand (like using args=() in scipy.integrate). I have an integrand func(x, E) depending on the independent variable x and on th…

---

## [Solver for differential algebraic equations with arbitrary implicit Runge Kutta method](https://discourse.julialang.org/t/solver-for-differential-algebraic-equations-with-arbitrary-implicit-runge-kutta-method/90310)

<div class="topic-metadata">

**Author:** [@Tri](https://discourse.julialang.org/u/Tri)\
**Replies:** 6\
**Last updated:** [November 16, 2022, 12:33pm UTC](https://discourse.julialang.org/t/solver-for-differential-algebraic-equations-with-arbitrary-implicit-runge-kutta-method/90310 "2022-11-16T12:33:21Z")

</div>

Hello As the title suggest, is there any package in Julia that enables solving differential algebraic equations DAEs with arbitrary implicit Runge Kutta (beyond the available ones) methods? Alternatively, is there any p…

---

## [Solving sparse, linear equations?](https://discourse.julialang.org/t/solving-sparse-linear-equations/90238)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 10\
**Last updated:** [November 15, 2022, 12:09pm UTC](https://discourse.julialang.org/t/solving-sparse-linear-equations/90238 "2022-11-15T12:09:00Z")

</div>

I have a linear equation AA\*z = bb where AA is a full rank, sparse matrix : julia\> AA 650×650 SparseMatrixCSC{Float64, Int64} with 2280 stored entries: ... When I try to solve the equation, I get an error message: ju…

---

## [Solve Raytrace ODE with events](https://discourse.julialang.org/t/solve-raytrace-ode-with-events/90022)

<div class="topic-metadata">

**Author:** [@jddorellanao](https://discourse.julialang.org/u/jddorellanao)\
**Replies:** 1\
**Last updated:** [November 10, 2022, 3:08am UTC](https://discourse.julialang.org/t/solve-raytrace-ode-with-events/90022 "2022-11-10T03:08:04Z")

</div>

Hi community: Forgive my boldness. I am new to Julia, and the reason I am using it is because how fast it is. I come from Python, and I have a function for raytracing (below). I need to migrate it to Julia, but I’m not …

---

## [Ignore part of the gradient calculation inside differential equation model](https://discourse.julialang.org/t/ignore-part-of-the-gradient-calculation-inside-differential-equation-model/90011)

<div class="topic-metadata">

**Author:** [@facusapienza](https://discourse.julialang.org/u/facusapienza)\
**Replies:** 0\
**Last updated:** [November 9, 2022, 11:22pm UTC](https://discourse.julialang.org/t/ignore-part-of-the-gradient-calculation-inside-differential-equation-model/90011 "2022-11-09T23:22:13Z")

</div>

I am trying to differentiate the solution of a differential equation using DifferentialEquation with respect to some parameters but ignoring parts of the calculation of the gradient for being redundant or computationally…

---

## [AD in DiffEqFlux using DiscreteCallback](https://discourse.julialang.org/t/ad-in-diffeqflux-using-discretecallback/89748)

<div class="topic-metadata">

**Author:** [@facusapienza](https://discourse.julialang.org/u/facusapienza)\
**Replies:** 1\
**Last updated:** [November 9, 2022, 12:07am UTC](https://discourse.julialang.org/t/ad-in-diffeqflux-using-discretecallback/89748 "2022-11-09T00:07:10Z")

</div>

I am trying to implement a callback term in my ODE solver and using Zygote to differentiate with respect to the model parameters. The action that callback uses is very simple and not very different to the one used in Eve…

---

## [Using PLASMA instead of LAPACK?](https://discourse.julialang.org/t/using-plasma-instead-of-lapack/25838)

<div class="topic-metadata">

**Author:** [@Red-Portal](https://discourse.julialang.org/u/Red-Portal)\
**Replies:** 5\
**Last updated:** [November 6, 2022, 12:25pm UTC](https://discourse.julialang.org/t/using-plasma-instead-of-lapack/25838 "2022-11-06T12:25:34Z")

</div>

Hi, I recently tested using PLASMA instead of LAPACK on a single socket 32 core AMD Threadripper. The results below are from running LU decomposition. It seems above a certain scale, PLASMA achieves much higher parall…

---

## [Computing a pruned FFT in O(n\*log(k))](https://discourse.julialang.org/t/computing-a-pruned-fft-in-o-n-log-k/89570)

<div class="topic-metadata">

**Author:** [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Replies:** 5\
**Last updated:** [November 6, 2022, 12:05pm UTC](https://discourse.julialang.org/t/computing-a-pruned-fft-in-o-n-log-k/89570 "2022-11-06T12:05:46Z")

</div>

Let’s say that I consider a DFT with n coefficients. I am only interested in k\<\<n of these coefficients. In theory, it is possible to compute these k coefficients in O(n\* log(k)) instead of O(n\* log(n)), see https://www.…

---

## [How to preallocate LU factorization](https://discourse.julialang.org/t/how-to-preallocate-lu-factorization/89718)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 3\
**Last updated:** [November 3, 2022, 5:59pm UTC](https://discourse.julialang.org/t/how-to-preallocate-lu-factorization/89718 "2022-11-03T17:59:09Z")

</div>

OK, I see what you mean. Suppose, then, that I’m not using StaticArrays and just want to allocate an empty LU with normal Julia arrays—how do I do that? zeros(LU{Float64, zeros(Matrix{Float64}), zeros(Vector{Int64})}) …

---

## [Can you solve wide matrices with LinearSolve.jl?](https://discourse.julialang.org/t/can-you-solve-wide-matrices-with-linearsolve-jl/89595)

<div class="topic-metadata">

**Author:** [@Ethan\_Leonard](https://discourse.julialang.org/u/Ethan_Leonard)\
**Replies:** 4\
**Last updated:** [November 2, 2022, 3:36am UTC](https://discourse.julialang.org/t/can-you-solve-wide-matrices-with-linearsolve-jl/89595 "2022-11-02T03:36:27Z")

</div>

New user here, trying to find an efficient way to iteratively solve lots of wide matrices in a loop. I came across LinearSolve.jl , but haven’t seen anything in the documentation about whether it can solve non-square ma…

---

## [Accessing solutions from earlier times in Callback functions](https://discourse.julialang.org/t/accessing-solutions-from-earlier-times-in-callback-functions/89613)

<div class="topic-metadata">

**Author:** [@LM\_Julia](https://discourse.julialang.org/u/LM_Julia)\
**Replies:** 4\
**Last updated:** [November 2, 2022, 10:28am UTC](https://discourse.julialang.org/t/accessing-solutions-from-earlier-times-in-callback-functions/89613 "2022-11-02T10:28:40Z")

</div>

Hi everyone, I’ve only recently started using Julia and I was wondering if it’s possible to access the values obtained at earlier times by a solver in a callback function. For example, I’m trying to identify maxima (as …

---

## [ODE terms dependent on time of events](https://discourse.julialang.org/t/ode-terms-dependent-on-time-of-events/88962)

<div class="topic-metadata">

**Author:** [@KalelR](https://discourse.julialang.org/u/KalelR)\
**Replies:** 5\
**Last updated:** [October 27, 2022, 10:13am UTC](https://discourse.julialang.org/t/ode-terms-dependent-on-time-of-events/88962 "2022-10-27T10:13:26Z")

</div>

Hey there I would like some advice for implementing efficient code for a spiking neuron network with coupling that depends on spike times. When a neuron in the model spikes (one of its variables, the membrane potential,…

---

## [How many flops does it take to compute a square root?](https://discourse.julialang.org/t/how-many-flops-does-it-take-to-compute-a-square-root/89027)

<div class="topic-metadata">

**Author:** [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Replies:** 6\
**Last updated:** [October 21, 2022, 5:20pm UTC](https://discourse.julialang.org/t/how-many-flops-does-it-take-to-compute-a-square-root/89027 "2022-10-21T17:20:27Z")

</div>

How many flops does it take to compute a square root?

---

## [ChainRulesCore and ForwardDiff](https://discourse.julialang.org/t/chainrulescore-and-forwarddiff/61705)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 15\
**Last updated:** [October 21, 2022, 4:14pm UTC](https://discourse.julialang.org/t/chainrulescore-and-forwarddiff/61705 "2022-10-21T16:14:20Z")

</div>

If I want to define derivatives for a function to work with ForwardDiff, is it sufficient to define a ChainRulesCore.frule, or is there something else? The rule does not seem to be used, instead the original function is…

---

## [Parallel AMG](https://discourse.julialang.org/t/parallel-amg/88926)

<div class="topic-metadata">

**Author:** [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Replies:** 8\
**Last updated:** [October 20, 2022, 4:28pm UTC](https://discourse.julialang.org/t/parallel-amg/88926 "2022-10-20T16:28:26Z")

</div>

Has anyone ever started working on a parallel implementation of algebraic multigrid solvers and preconditioners?

---

## [Edge-based partitioning with vertex separators of oriented graphs](https://discourse.julialang.org/t/edge-based-partitioning-with-vertex-separators-of-oriented-graphs/88855)

<div class="topic-metadata">

**Author:** [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Replies:** 1\
**Last updated:** [October 17, 2022, 6:47pm UTC](https://discourse.julialang.org/t/edge-based-partitioning-with-vertex-separators-of-oriented-graphs/88855 "2022-10-17T18:47:11Z")

</div>

I am searching for an algorithm that can create balanced edge-based partitions with vertex separators of oriented graphs. My understanding is that the METIS\_PartGraphKway function performs a vertex-based partition with e…

---

## [Gridap.jl field-circuit coupling for magnetostatics](https://discourse.julialang.org/t/gridap-jl-field-circuit-coupling-for-magnetostatics/83069)

<div class="topic-metadata">

**Author:** [@gwlagerweij](https://discourse.julialang.org/u/gwlagerweij)\
**Replies:** 7\
**Last updated:** [October 15, 2022, 3:07pm UTC](https://discourse.julialang.org/t/gridap-jl-field-circuit-coupling-for-magnetostatics/83069 "2022-10-15T15:07:17Z")

</div>

Hi all, I am trying to solve a field-circuit coupled problem using the Gridap.jl package. I want to simulate the current distribution inside a high-voltage cable, as well as the associated magnetic field. This means I…

---

## [ForwardDiff yields incorrect results if one misues \`DiffCache\`](https://discourse.julialang.org/t/forwarddiff-yields-incorrect-results-if-one-misues-diffcache/88684)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 1\
**Last updated:** [October 13, 2022, 9:34pm UTC](https://discourse.julialang.org/t/forwarddiff-yields-incorrect-results-if-one-misues-diffcache/88684 "2022-10-13T21:34:09Z")

</div>

I’d like to report a mistake that some new users like me might make when using PreallocationTools. One should not use DiffCache to store non-variables such as parameters. It makes perfect sense in a hindsight, because th…

---

## [Solver throwing LinearAlgebra.SingularException(1) error for my ODE System](https://discourse.julialang.org/t/solver-throwing-linearalgebra-singularexception-1-error-for-my-ode-system/88281)

<div class="topic-metadata">

**Author:** [@hbooth](https://discourse.julialang.org/u/hbooth)\
**Replies:** 6\
**Last updated:** [October 13, 2022, 9:19am UTC](https://discourse.julialang.org/t/solver-throwing-linearalgebra-singularexception-1-error-for-my-ode-system/88281 "2022-10-13T09:19:33Z")

</div>

Hi, When I am trying to solve my ODE system I get a LinearAlgebra.SingularException(1) error and I am not sure why or what I can do about it. Here is my system: using DifferentialEquations const Nc = 100 const L = 1. …

---

## [Type issue to get PreallocationTools.DiffCache work with Symbolics.jacobian\_sparsity](https://discourse.julialang.org/t/type-issue-to-get-preallocationtools-diffcache-work-with-symbolics-jacobian-sparsity/88542)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 3\
**Last updated:** [October 12, 2022, 10:12pm UTC](https://discourse.julialang.org/t/type-issue-to-get-preallocationtools-diffcache-work-with-symbolics-jacobian-sparsity/88542 "2022-10-12T22:12:50Z")

</div>

Hello, I would like to use Symbolics.jacobian\_sparsity to detect the sparsity pattern for a code that supports ForwardDiff.jacobian using PreallocationTools. The code below is a MWE for a program where the full residua…

---

## [Sparse matrix and sparse subarray subtraction returns full arrays](https://discourse.julialang.org/t/sparse-matrix-and-sparse-subarray-subtraction-returns-full-arrays/88239)

<div class="topic-metadata">

**Author:** [@vivian-rogers](https://discourse.julialang.org/u/vivian-rogers)\
**Replies:** 6\
**Last updated:** [October 11, 2022, 12:24am UTC](https://discourse.julialang.org/t/sparse-matrix-and-sparse-subarray-subtraction-returns-full-arrays/88239 "2022-10-11T00:24:49Z")

</div>

Hi! So, I am writing a routine to recursively invert a big, sparse matrix which is known to be nice and reasonably invertible with this recursive method. Specifically, this pertains to the green’s function of a sparse ha…

---

## [Feedback on a 2d spring simulation](https://discourse.julialang.org/t/feedback-on-a-2d-spring-simulation/88350)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 10\
**Last updated:** [October 7, 2022, 6:26pm UTC](https://discourse.julialang.org/t/feedback-on-a-2d-spring-simulation/88350 "2022-10-07T18:26:05Z")

</div>

This post does not present a specific question or problem. I have working code—a tiny simulation of a dynamic system involving some springs in 2d space—and I am hoping for general feedback regarding code idiomaticity, pe…

---

## [Solving nonlinear equation with an embedded matrix equation](https://discourse.julialang.org/t/solving-nonlinear-equation-with-an-embedded-matrix-equation/88240)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 1\
**Last updated:** [October 4, 2022, 9:54pm UTC](https://discourse.julialang.org/t/solving-nonlinear-equation-with-an-embedded-matrix-equation/88240 "2022-10-04T21:54:52Z")

</div>

I want to find the solution to a nonlinear equation of the form u\_{xx} + f(u,\\lambda) + p= 0 where the unknowns are u(x) and the constant p. There is an addition volume constraint \\int u(x)dx=1. For the leading order pro…

---

## [Scrambled Halton Draws Package?](https://discourse.julialang.org/t/scrambled-halton-draws-package/36846)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 2\
**Last updated:** [October 2, 2022, 2:04am UTC](https://discourse.julialang.org/t/scrambled-halton-draws-package/36846 "2022-10-02T02:04:06Z")

</div>

Hello, Is there any package that allows me to draw shuffled Halton draws for simulation of high-dimension integrals? I found and but these don’t seem to provide a shuffling implementation.

---

## [Ordering of isoutofdomain and continuous callbacks in DifferentialEquations.jl](https://discourse.julialang.org/t/ordering-of-isoutofdomain-and-continuous-callbacks-in-differentialequations-jl/87760)

<div class="topic-metadata">

**Author:** [@kaitlyn-loftus](https://discourse.julialang.org/u/kaitlyn-loftus)\
**Replies:** 3\
**Last updated:** [September 29, 2022, 6:51am UTC](https://discourse.julialang.org/t/ordering-of-isoutofdomain-and-continuous-callbacks-in-differentialequations-jl/87760 "2022-09-29T06:51:51Z")

</div>

I am encountering some undesired behavior with a combination of DifferentialEquations.jl’s marvelous isoutofdomain and event handling features. I seem to be having integrations fail because of the ordering of a Continuo…

---

## [Best strategies to solve an ODE with piecewise functions using OrdinaryDiffEq](https://discourse.julialang.org/t/best-strategies-to-solve-an-ode-with-piecewise-functions-using-ordinarydiffeq/87750)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 4\
**Last updated:** [September 28, 2022, 2:59pm UTC](https://discourse.julialang.org/t/best-strategies-to-solve-an-ode-with-piecewise-functions-using-ordinarydiffeq/87750 "2022-09-28T14:59:26Z")

</div>

I want to solve an ODE problem involving some piecewise functions and I would like to ask for advice on what could be the best strategy to solve them. Physically, the ODEs I want to solve represent a contact element sti…

---

## [Distributed eigensolvers for computing eigenpairs of large sparse matrices](https://discourse.julialang.org/t/distributed-eigensolvers-for-computing-eigenpairs-of-large-sparse-matrices/78648)

<div class="topic-metadata">

**Author:** [@Neo](https://discourse.julialang.org/u/Neo)\
**Replies:** 6\
**Last updated:** [September 28, 2022, 11:36am UTC](https://discourse.julialang.org/t/distributed-eigensolvers-for-computing-eigenpairs-of-large-sparse-matrices/78648 "2022-09-28T11:36:55Z")

</div>

Hi folks, I implemented a distributed method in Julia for computing smallest eigenvalues and the corresponding eigenvectors of large sparse (symmetric) matrices. I wanted to compare my implementation with a baseline eig…

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

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