# Finding nodal lines numerically in a volume

**URL:** <https://discourse.julialang.org/t/finding-nodal-lines-numerically-in-a-volume/79836>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [April 22, 2022, 1:11pm UTC](https://discourse.julialang.org/t/finding-nodal-lines-numerically-in-a-volume/79836 "2022-04-22T13:11:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![volkerkarle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/volkerkarle/32/14143_2.png) [@volkerkarle](https://discourse.julialang.org/u/volkerkarle)\
**Post date:** [April 22, 2022, 1:11pm UTC](https://discourse.julialang.org/t/finding-nodal-lines-numerically-in-a-volume/79836/1 "2022-04-22T13:11:16Z")

</div>

Dear all,

I’m trying to the solve the following problem. Consider some volume V \in \mathbb{R}^3 with an almost everywhere smooth function f(x) \in \mathbb{R} \leq 0 with x \in V . For symmetry reasons, all zero manifolds f(x) = 0 of that function are one-dimensional.

1. How can I find them numerically? Do you know julia packages fitting to that problem? Right now I’m just calculating a large grid over all of the volume, and make it finer within some threshold of f(x). However, that is very inefficient. I wonder if there is a way to follow the lines? Could I parametrize these lines by splines (instead of saving millions of trajectory levels)?

2. I wondered if there was maybe a very julian way to solve this problem. Particularly, I wondered if I could use AD to follow the zero-level sets.

Disclaimer: I do not have an optimization background. That is why maybe this question might sound knowledgeable and/or badly-posed to you.

Thanks,

v.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [April 23, 2022, 4:13am UTC](https://discourse.julialang.org/t/finding-nodal-lines-numerically-in-a-volume/79836/2 "2022-04-23T04:13:07Z")

</div>

I’m not sure what is your exact question: are you maximising/minimising f(x) over V?

Some packages that might be relevant:

- [HomotopyContinuation.jl](https://www.juliahomotopycontinuation.org/)
- [Manopt.jl](https://github.com/JuliaManifolds/Manopt.jl)
- Searching [“Manifolds” on JuliaHub](https://juliahub.com/ui/Search?q=manifold&type=packages)

---

<div class="post-metadata">

**Author:** ![CarloLucibello](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carlolucibello/32/3278_2.png) [@CarloLucibello](https://discourse.julialang.org/u/CarloLucibello)\
**Post date:** [April 23, 2022, 7:16am UTC](https://discourse.julialang.org/t/finding-nodal-lines-numerically-in-a-volume/79836/3 "2022-04-23T07:16:01Z")

</div>

You could reach one maximum, then explore the submanifold taking steps in the direction of the eigenvector of the Hessian with 0 eigenvalue.

---

<div class="post-metadata">

**Author:** ![volkerkarle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/volkerkarle/32/14143_2.png) [@volkerkarle](https://discourse.julialang.org/u/volkerkarle)\
**Post date:** [April 24, 2022, 12:13pm UTC](https://discourse.julialang.org/t/finding-nodal-lines-numerically-in-a-volume/79836/4 "2022-04-24T12:13:32Z")

</div>

thanks, looks good, I’ll have a look
