# Numerics

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

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

**Page:** 31

---

## [Changing size of ODE system: resize! works but deleteat! doesn't](https://discourse.julialang.org/t/changing-size-of-ode-system-resize-works-but-deleteat-doesnt/45900)

<div class="topic-metadata">

**Author:** [@levasco](https://discourse.julialang.org/u/levasco)\
**Replies:** 5\
**Last updated:** [September 4, 2020, 3:54pm UTC](https://discourse.julialang.org/t/changing-size-of-ode-system-resize-works-but-deleteat-doesnt/45900 "2020-09-04T15:54:51Z")

</div>

I am playing around with the capacity of changing the size of an ODE system by tweaking the example presented here. For some reason, shrinking the model by resize!()ing the integrator works as expected, but the (equivale…

---

## [Error evaluating sparse, analytical Jacobian from ModelingToolkit in DAE system](https://discourse.julialang.org/t/error-evaluating-sparse-analytical-jacobian-from-modelingtoolkit-in-dae-system/45764)

<div class="topic-metadata">

**Author:** [@DAEhelp](https://discourse.julialang.org/u/DAEhelp)\
**Replies:** 4\
**Last updated:** [September 4, 2020, 1:30am UTC](https://discourse.julialang.org/t/error-evaluating-sparse-analytical-jacobian-from-modelingtoolkit-in-dae-system/45764 "2020-09-04T01:30:25Z")

</div>

I am having trouble with taking a sparse, analytical Jacobian generated in ModelingToolkit and passing it to my Sundials IDA solver. Here is an MWE adapted from a previous question. Running this segment of code with a p…

---

## [ODE AutoTsit5(Rodas5()) switching bug (depends from tolerance history)](https://discourse.julialang.org/t/ode-autotsit5-rodas5-switching-bug-depends-from-tolerance-history/45288)

<div class="topic-metadata">

**Author:** [@peatlux](https://discourse.julialang.org/u/peatlux)\
**Replies:** 8\
**Last updated:** [September 3, 2020, 7:42pm UTC](https://discourse.julialang.org/t/ode-autotsit5-rodas5-switching-bug-depends-from-tolerance-history/45288 "2020-09-03T19:42:00Z")

</div>

I want to solve my coupled DiffEq with different algorithms, because i don’t know the specific characteristics of it. But i know that it can exhibit stiff behaviour in some cases. I need to solve it many times in a param…

---

## [More accurate evalpoly](https://discourse.julialang.org/t/more-accurate-evalpoly/45932)

<div class="topic-metadata">

**Author:** [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Replies:** 8\
**Last updated:** [September 2, 2020, 4:24pm UTC](https://discourse.julialang.org/t/more-accurate-evalpoly/45932 "2020-09-02T16:24:21Z")

</div>

In my quest for a better exp function, I discovered that having a more accurate evalpoly function is necessary if you want low error. Our builtin version is very fast (1 flop per degree), but has an unfortunately high ma…

---

## [Approximating via step function](https://discourse.julialang.org/t/approximating-via-step-function/43577)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 2\
**Last updated:** [August 30, 2020, 6:53am UTC](https://discourse.julialang.org/t/approximating-via-step-function/43577 "2020-08-30T06:53:10Z")

</div>

Hello, I was wondering whether anyone knows of a package/function that approximates a function with a step function. As an example, below in blue is the data I am trying to approximate, in red is my wanted output (a ste…

---

## [Why applying an integration algorithm to whole DAEs?](https://discourse.julialang.org/t/why-applying-an-integration-algorithm-to-whole-daes/45620)

<div class="topic-metadata">

**Author:** [@takunoda](https://discourse.julialang.org/u/takunoda)\
**Replies:** 3\
**Last updated:** [August 28, 2020, 7:04pm UTC](https://discourse.julialang.org/t/why-applying-an-integration-algorithm-to-whole-daes/45620 "2020-08-28T19:04:32Z")

</div>

Let me ask a fundamental question which may be trivial to experts in this field. Compared with solving a set of ODEs, solving a set of DAEs is much more difficult. For instance, in the case of electrical circuits, the e…

---

## [Banded matrix with ones in the lower triangular portion of the matrix](https://discourse.julialang.org/t/banded-matrix-with-ones-in-the-lower-triangular-portion-of-the-matrix/45591)

<div class="topic-metadata">

**Author:** [@joeynelson](https://discourse.julialang.org/u/joeynelson)\
**Replies:** 1\
**Last updated:** [August 27, 2020, 8:02pm UTC](https://discourse.julialang.org/t/banded-matrix-with-ones-in-the-lower-triangular-portion-of-the-matrix/45591 "2020-08-27T20:02:55Z")

</div>

I’m working on monotone spline fitting using an ispline basis. The matrix formed is similar to a banded matrix, but has all ones in the lower triangle portion below the banded portion. Additionally, I’m adding a consta…

---

## [Updating Cholesky Factorization submatrix](https://discourse.julialang.org/t/updating-cholesky-factorization-submatrix/28913)

<div class="topic-metadata">

**Author:** [@charshaw](https://discourse.julialang.org/u/charshaw)\
**Replies:** 7\
**Last updated:** [August 26, 2020, 5:05pm UTC](https://discourse.julialang.org/t/updating-cholesky-factorization-submatrix/28913 "2020-08-26T17:05:00Z")

</div>

I have a positive semidefinite matrix A \\in \\mathbb{R}^{n \\times n} and its Cholesky factorization is A = L L^T. I would like to update the Cholesky factorization by removing the last row and column of L. What is the co…

---

## [Best way to create a wrapper for C library for Continuous version of Tensor Train](https://discourse.julialang.org/t/best-way-to-create-a-wrapper-for-c-library-for-continuous-version-of-tensor-train/45479)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 3\
**Last updated:** [August 25, 2020, 3:14pm UTC](https://discourse.julialang.org/t/best-way-to-create-a-wrapper-for-c-library-for-continuous-version-of-tensor-train/45479 "2020-08-25T15:14:55Z")

</div>

Hello, I would like to create a wrapper for the C library https://github.com/goroda/Compressed-Continuous-Computation that implements a low-rank approximation of multi-dimensional functions in the same spirit as ApproxF…

---

## [Smooth delta functions to compute Jacobian and Hessian from samples](https://discourse.julialang.org/t/smooth-delta-functions-to-compute-jacobian-and-hessian-from-samples/45282)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 10\
**Last updated:** [August 21, 2020, 10:16am UTC](https://discourse.julialang.org/t/smooth-delta-functions-to-compute-jacobian-and-hessian-from-samples/45282 "2020-08-21T10:16:18Z")

</div>

Hello, Given an expensive function \\boldsymbol{G} :\\mathbb{R}^n \\xrightarrow{} \\mathbb{R}^m whose value is known at samples \\boldsymbol{x}^1,\\ldots, \\boldsymbol{x}^N, I would like to compute the Jacobian and Hessian a…

---

## [ApproxFun for vector-valued function](https://discourse.julialang.org/t/approxfun-for-vector-valued-function/45135)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 11\
**Last updated:** [August 19, 2020, 10:00am UTC](https://discourse.julialang.org/t/approxfun-for-vector-valued-function/45135 "2020-08-19T10:00:30Z")

</div>

Hello, I have a vector-valued and nonlinear function f:\\mathbb{R}^n \\xrightarrow{} \\mathbb{R}^m with n, m \\sim 50. I am only interested in the local behavior of this function about a n-dimensional interval \[a\_1, b\_1\] \\…

---

## [Fancy indexing in ITensor](https://discourse.julialang.org/t/fancy-indexing-in-itensor/45201)

<div class="topic-metadata">

**Author:** [@volkerkarle](https://discourse.julialang.org/u/volkerkarle)\
**Replies:** 0\
**Last updated:** [August 19, 2020, 9:21am UTC](https://discourse.julialang.org/t/fancy-indexing-in-itensor/45201 "2020-08-19T09:21:27Z")

</div>

Hi folks, As I elaborated here, I think I just missed it in the docs of ITensor, but I do not see an easy way to do “fancy” indexing. Lets us consider the following example i = Index(10,"i") j = Index(20,"j") k = Index…

---

## [Difference between an ODE with manifold projection and a DAE](https://discourse.julialang.org/t/difference-between-an-ode-with-manifold-projection-and-a-dae/45136)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 3\
**Last updated:** [August 18, 2020, 1:08pm UTC](https://discourse.julialang.org/t/difference-between-an-ode-with-manifold-projection-and-a-dae/45136 "2020-08-18T13:08:40Z")

</div>

Hi, I’d like to know the difference between an ODE set with manifold projection callback and a DAE (formulated as ODE with a singular mass matrix). It seems to me that the former one separates the algebraic equations fr…

---

## [Is there a MPI-based map package?](https://discourse.julialang.org/t/is-there-a-mpi-based-map-package/45087)

<div class="topic-metadata">

**Author:** [@astrojhgu](https://discourse.julialang.org/u/astrojhgu)\
**Replies:** 2\
**Last updated:** [August 18, 2020, 4:14am UTC](https://discourse.julialang.org/t/is-there-a-mpi-based-map-package/45087 "2020-08-18T04:14:08Z")

</div>

Is there such a package providing a function like? function mpi\_map(Function, Array, MPI\_COMM), which bechaviours like result=map(some\_input\_array, comm) do x some\_operation(x) done I wrote one myself based on se…

---

## [Simultaneous Jacobian and Hessian computations](https://discourse.julialang.org/t/simultaneous-jacobian-and-hessian-computations/44884)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 7\
**Last updated:** [August 13, 2020, 10:15pm UTC](https://discourse.julialang.org/t/simultaneous-jacobian-and-hessian-computations/44884 "2020-08-13T22:15:42Z")

</div>

Hello, I would like to compute the Jacobian and the Hessian of a function f: \\mathbb{R}^n \\xrightarrow{} \\mathbb{R}^m with n,m \\sim60. This function involves multiple Fourier transforms and nonlinear transformations tha…

---

## [Simultaneous left and right multiplication of a matrix](https://discourse.julialang.org/t/simultaneous-left-and-right-multiplication-of-a-matrix/44823)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 1\
**Last updated:** [August 12, 2020, 11:09pm UTC](https://discourse.julialang.org/t/simultaneous-left-and-right-multiplication-of-a-matrix/44823 "2020-08-12T23:09:41Z")

</div>

Hello, I am computing a positive definite matrix H (in my case it is a Hessian) and I would like to transform it into another basis according to P^THP with P an upper triangular matrix. Is there an optimized routine to…

---

## [Static array Julia for Optim.jl](https://discourse.julialang.org/t/static-array-julia-for-optim-jl/44711)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 3\
**Last updated:** [August 11, 2020, 1:07am UTC](https://discourse.julialang.org/t/static-array-julia-for-optim-jl/44711 "2020-08-11T01:07:02Z")

</div>

Hello, I am using Optim.jl for the nonlinear optimization of a set of coefficients (dim \<30). Can I expect some speed-up if I use StaticArrays to compute the gradients, store the coefficients?

---

## [Implementing discrete factor products](https://discourse.julialang.org/t/implementing-discrete-factor-products/44564)

<div class="topic-metadata">

**Author:** [@mroavi](https://discourse.julialang.org/u/mroavi)\
**Replies:** 0\
**Last updated:** [August 8, 2020, 11:47am UTC](https://discourse.julialang.org/t/implementing-discrete-factor-products/44564 "2020-08-08T11:47:29Z")

</div>

I have an algorithm that involves computations over multidimensional arrays. I came across this blog post by Tim Holy: Multidimensional algorithms and iteration). I’m wondering whether the CartesianIndices data structu…

---

## [Issues with AD of Hypergeometric function in narrow parameter band](https://discourse.julialang.org/t/issues-with-ad-of-hypergeometric-function-in-narrow-parameter-band/44523)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 6\
**Last updated:** [August 8, 2020, 1:38pm UTC](https://discourse.julialang.org/t/issues-with-ad-of-hypergeometric-function-in-narrow-parameter-band/44523 "2020-08-08T13:38:59Z")

</div>

Hello— Using AD with the Gauss 2F1 function has come up in some work I am doing. I am incredibly impressed by the performance and functionality of HypergeometricFunctions.jl, but I’m having a strange issue where only fo…

---

## [View of LowerMatrix is not working with ldiv! and mul!](https://discourse.julialang.org/t/view-of-lowermatrix-is-not-working-with-ldiv-and-mul/44046)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 5\
**Last updated:** [August 6, 2020, 7:44am UTC](https://discourse.julialang.org/t/view-of-lowermatrix-is-not-working-with-ldiv-and-mul/44046 "2020-08-06T07:44:32Z")

</div>

Hello, I am computed a large Cholesky factor L \\in R^{N,N}, and I would like to multiply and divide an array of dimension n, M with n \\leq N. I would like to use view(L,1:n,1:n) but ldiv!, mul! are not defined for views…

---

## [Benchmark of numerical integration packages for multi-dimensional integration](https://discourse.julialang.org/t/benchmark-of-numerical-integration-packages-for-multi-dimensional-integration/44273)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 4\
**Last updated:** [August 5, 2020, 10:33am UTC](https://discourse.julialang.org/t/benchmark-of-numerical-integration-packages-for-multi-dimensional-integration/44273 "2020-08-05T10:33:11Z")

</div>

Hello, I need to integrate a vector valued function F: \\mathbb{R} \\xrightarrow{} \\mathbb{R}^n, with n \\sim 5000 over \[0.0, 1.0\]. I don’t need to very accurate result, an error estimate of 1e-6 is sufficient for my appli…

---

## [Minimal integer solution to homogeneous system of linear equations](https://discourse.julialang.org/t/minimal-integer-solution-to-homogeneous-system-of-linear-equations/43848)

<div class="topic-metadata">

**Author:** [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Replies:** 4\
**Last updated:** [July 29, 2020, 2:44pm UTC](https://discourse.julialang.org/t/minimal-integer-solution-to-homogeneous-system-of-linear-equations/43848 "2020-07-29T14:44:54Z")

</div>

As the title says, I’m looking for a way to find a minimal integer solution of the homogeneous system of linear equations. Such systems have infinitely many solutions (since you can multiply by constant or linearly comb…

---

## [LAPACK exception with gels!](https://discourse.julialang.org/t/lapack-exception-with-gels/43620)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 1\
**Last updated:** [July 28, 2020, 7:43pm UTC](https://discourse.julialang.org/t/lapack-exception-with-gels/43620 "2020-07-28T19:43:28Z")

</div>

If I run the following program then Julia quits with an exception. I suspect this has something to do with rounding in the factorization. The matrix B below can be replaced with a matrix of zeros of the same size and t…

---

## [Polynomials.fit causing LinearAlgebra.LAPACKException error on 1 computer](https://discourse.julialang.org/t/polynomials-fit-causing-linearalgebra-lapackexception-error-on-1-computer/43594)

<div class="topic-metadata">

**Author:** [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Replies:** 1\
**Last updated:** [July 24, 2020, 10:58pm UTC](https://discourse.julialang.org/t/polynomials-fit-causing-linearalgebra-lapackexception-error-on-1-computer/43594 "2020-07-24T22:58:56Z")

</div>

A very strange problem I met that I can reproduce every time with the original code, but I am not able to create a minimal example to reproduce it. Hence I am posting here to see if anybody has seen something similar ins…

---

## [Best way to solve system of ODEs with different types in DifferentialEquations.jl](https://discourse.julialang.org/t/best-way-to-solve-system-of-odes-with-different-types-in-differentialequations-jl/43533)

<div class="topic-metadata">

**Author:** [@tpolakovic](https://discourse.julialang.org/u/tpolakovic)\
**Replies:** 1\
**Last updated:** [July 23, 2020, 11:20am UTC](https://discourse.julialang.org/t/best-way-to-solve-system-of-odes-with-different-types-in-differentialequations-jl/43533 "2020-07-23T11:20:05Z")

</div>

I have two fields, A (complex scalar field) and B (real vector field), which are sampled on staggered grids. This means that (in, say, three dimensions) A is an complex array with N^3 elements, while B is a real array wi…

---

## [Weird ldexp performance](https://discourse.julialang.org/t/weird-ldexp-performance/43416)

<div class="topic-metadata">

**Author:** [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Replies:** 4\
**Last updated:** [July 21, 2020, 2:12pm UTC](https://discourse.julialang.org/t/weird-ldexp-performance/43416 "2020-07-21T14:12:24Z")

</div>

I’m trying to write a faster implimentation of exp, and along the way, I noticed that I have no idea how fast ldexp is, and my efforts to benchmark it result in madness. My code is function myexp(x::Float64) # Redu…

---

## [JuAFEM mesh issue](https://discourse.julialang.org/t/juafem-mesh-issue/41467)

<div class="topic-metadata">

**Author:** [@bocc](https://discourse.julialang.org/u/bocc)\
**Replies:** 19\
**Last updated:** [July 18, 2020, 1:07pm UTC](https://discourse.julialang.org/t/juafem-mesh-issue/41467 "2020-07-18T13:07:36Z")

</div>

Hello, sorry in advance for posting this here, as this is most likely not a JuAFEM issue, but a problem with an external mesh. Also apologies for not being able to create a copy-pastable MWE. Any insight is appreciated …

---

## [DifferentialEquations.jl and systems with heterogenous units](https://discourse.julialang.org/t/differentialequations-jl-and-systems-with-heterogenous-units/2952)

<div class="topic-metadata">

**Author:** [@helgee](https://discourse.julialang.org/u/helgee)\
**Replies:** 17\
**Last updated:** [July 16, 2020, 1:31am UTC](https://discourse.julialang.org/t/differentialequations-jl-and-systems-with-heterogenous-units/2952 "2020-07-16T01:31:08Z")

</div>

Hi everybody, I am trying to solve the following system of ODE with DifferentialEquations.jl function newton!(t, y, dy, μ) r = norm(y\[1:3\]) dy\[1:3\] = y\[4:6\] dy\[4:6\] = -μ \* y\[1:3\] / r^3 end Without units th…

---

## [Differentiable @unpack-ing of function arguments](https://discourse.julialang.org/t/differentiable-unpack-ing-of-function-arguments/43146)

<div class="topic-metadata">

**Author:** [@mefob](https://discourse.julialang.org/u/mefob)\
**Replies:** 9\
**Last updated:** [July 15, 2020, 10:27pm UTC](https://discourse.julialang.org/t/differentiable-unpack-ing-of-function-arguments/43146 "2020-07-15T22:27:47Z")

</div>

What is the recommended approach to @unpack parameters in a differential equation when using gradient wrt these parameters: I could not get named tuples or dicts to work, this is what I tried: using DiffEqSensitivi…

---

## [Looking for a blog article about DifferentialEquations.jl with custom types](https://discourse.julialang.org/t/looking-for-a-blog-article-about-differentialequations-jl-with-custom-types/43025)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 2\
**Last updated:** [July 14, 2020, 5:09pm UTC](https://discourse.julialang.org/t/looking-for-a-blog-article-about-differentialequations-jl-with-custom-types/43025 "2020-07-14T17:09:48Z")

</div>

Hi, This is a rather vague question, and I apologize in advance if this is considered offtopic. I remember reading this great blog article by someone (quite possibly by Dr. Chris Rackauckas) about using custom types wit…

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

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