You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
brainpy.analysis.PhasePlane2D.plot_nullcline has two branches #718
In my single compartment HH-like model, the nullcline of the voltage variable has two branches. When I use brainpy.analysis.PhasePlane2D.plot_nullcline() to plot the nullcline, the endpoints of the two branches are connected. Is there any way to avoid this?
what does the endpoints of the two branches are connected mean?
The middle part of the N-shape V nullcline should not exist, it just connects the endpoints of the left branch and the right branch of the V nullcline.
Attach is the same plot with fmt='o', but I want to use fmt='-'.
Maybe you need to plot by yourself. plot_nullcline(with_return=True) will return all points, and then you can draw what you want. Can this solve your question?
Maybe you need to plot by yourself. plot_nullcline(with_return=True) will return all points, and then you can draw what you want. Can this solve your question?
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 14 days if no further activity occurs. If this issue is still relevant, please comment to keep it open. Thank you for your contributions!
I investigated the branch-connectivity question behind this report and prepared a short research note and a reproducible test package. The existing with_return=True workaround helped the reporter; the attached work considers what guarantees an automatic replacement could offer.
The general limitation: there is no algorithm that always terminates and correctly determines the complete connected-component structure for every smooth equation, even when the complete finite formula, all constituent functions, and all coefficients are visible. The precise formula language in the note allows rational constants, pi, sine, arithmetic, exponential, division on its domain, and explicitly written smooth piecewise definitions. Even deciding whether the zero set in the fixed square [-1,1]^2 has exactly two components is undecidable in this class.
The proof reduces Wang's established real-zero existence theorem (1974) to that fixed-square question using an explicit smooth compactification. It permits degenerate zero sets and infinitely many components. It does not establish impossibility under additional regularity assumptions, or for rational polynomial curves. The note is an AI-assisted research exposition based on prior results, not a claim of a newly discovered foundational theorem.
A practical direction for BrainPy: specialize by the structure of the nullcline equation and preserve branch connectivity in the plotting representation. BrainPy accepts user-defined ODE functions, so the admissible inputs are not limited to a finite catalogue of built-in models. Nevertheless, common model families can be supported progressively:
Use analytic nullcline mappings or explicitly supplied branch descriptions when available.
Use certified root isolation/subdivision for exact polynomial formulas; require appropriate domain checks before extending this to rational formulas.
For regular non-polynomial equations, use continuation or interval-based subdivision with explicit assumptions. Continuation from selected seeds alone does not prove that every component was found.
For general numerical callables, provide a resolution-limited fallback and retain an unresolved state when connectivity cannot be established. Increasing resolution or cutting long edges can help, but neither is a universal certificate.
The artificial connecting segments in this issue remain a concrete plotting problem that can be addressed without solving the unrestricted topology problem. A staged implementation would need additional model-specific work and regression cases covering disconnected branches, genuine connections, folds, small loops, and singularities. The original HH-like equations are not included in the issue, so these experiments do not reproduce that exact model.
Attached validation (standalone research code, Mac CPU):
Check
Result
Regression, symbolic-construction, and certificate-verifier tests
Symbolic compactification examples with analytic answers
6
The unresolved/unsupported cases are retained in the results. Tests exercise the implementations; the impossibility conclusion comes from the mathematical proof. These are not full BrainPy integration tests or evidence that #718 has already been fixed.
Start with REPRODUCE.md in the ZIP. The certificate checker is implemented separately from the generator, although both share the SymPy backend. The package is a research prototype with documented assumptions, not a proposed drop-in BrainPy patch.
Activity
chaoming0625 commentedon Feb 25, 2025
can you show the image?
Newtonpula commentedon Feb 25, 2025
chaoming0625 commentedon Feb 25, 2025
what does
the endpoints of the two branches are connectedmean?Newtonpula commentedon Feb 25, 2025
The middle part of the N-shape V nullcline should not exist, it just connects the endpoints of the left branch and the right branch of the V nullcline.
Attach is the same plot with fmt='o', but I want to use fmt='-'.
chaoming0625 commentedon Feb 25, 2025
Maybe you need to plot by yourself.
plot_nullcline(with_return=True)will return all points, and then you can draw what you want. Can this solve your question?Newtonpula commentedon Feb 25, 2025
Yes, it solves my question. Thanks very much.
github-actions commentedon Oct 7, 2025
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 14 days if no further activity occurs. If this issue is still relevant, please comment to keep it open. Thank you for your contributions!
Han-Shen-math commentedon Oct 12, 2026
I investigated the branch-connectivity question behind this report and prepared a short research note and a reproducible test package. The existing
with_return=Trueworkaround helped the reporter; the attached work considers what guarantees an automatic replacement could offer.The general limitation: there is no algorithm that always terminates and correctly determines the complete connected-component structure for every smooth equation, even when the complete finite formula, all constituent functions, and all coefficients are visible. The precise formula language in the note allows rational constants, pi, sine, arithmetic, exponential, division on its domain, and explicitly written smooth piecewise definitions. Even deciding whether the zero set in the fixed square
[-1,1]^2has exactly two components is undecidable in this class.The proof reduces Wang's established real-zero existence theorem (1974) to that fixed-square question using an explicit smooth compactification. It permits degenerate zero sets and infinitely many components. It does not establish impossibility under additional regularity assumptions, or for rational polynomial curves. The note is an AI-assisted research exposition based on prior results, not a claim of a newly discovered foundational theorem.
A practical direction for BrainPy: specialize by the structure of the nullcline equation and preserve branch connectivity in the plotting representation. BrainPy accepts user-defined ODE functions, so the admissible inputs are not limited to a finite catalogue of built-in models. Nevertheless, common model families can be supported progressively:
The artificial connecting segments in this issue remain a concrete plotting problem that can be addressed without solving the unrestricted topology problem. A staged implementation would need additional model-specific work and regression cases covering disconnected branches, genuine connections, folds, small loops, and singularities. The original HH-like equations are not included in the issue, so these experiments do not reproduce that exact model.
Attached validation (standalone research code, Mac CPU):
The unresolved/unsupported cases are retained in the results. Tests exercise the implementations; the impossibility conclusion comes from the mathematical proof. These are not full BrainPy integration tests or evidence that #718 has already been fixed.
Files:
Start with
REPRODUCE.mdin the ZIP. The certificate checker is implemented separately from the generator, although both share the SymPy backend. The package is a research prototype with documented assumptions, not a proposed drop-in BrainPy patch.