You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在SymPy中为何nonlinsolve返回错误结果?求dx=dy的nullcline

Solving dx=0 & dy=0 Nullcline for a 3D System of Equations

Alright, let's walk through your nullcline solution step by step. You're working with a 3D system of differential equations, and you want to find the intersection of the dx=0 and dy=0 nullclines (with dz=0 fixed). Your SymPy code is correctly set up to solve this nonlinear system, so let's unpack the results.

Your Code

from sympy import *
x, y, z = symbols('x, y, z')
dx = x - x ** 3 / 3 - z + y
dy = -y ** 2 * 0.1 + z
dz = 0

xy_nullcline = nonlinsolve([dx, dy], [x, y, z])
print(xy_nullcline)

Output

{
(x, -3.16227766016838sqrt(z), z),
(x, 3.16227766016838
sqrt(z), z)
}

What This Means

First, let's translate the numerical approximation to exact terms: that 3.16227... value is just √10 (since 0.1 = 1/10). So the solution set simplifies to two families of curves:

  • For any real values of x and z (where z ≥ 0, since we're taking square roots), y = -√(10z)
  • For the same domain of x and z, y = √(10z)

From the dx=0 equation, we also have the relationship:
x - x³/3 - z + y = 0 → z = x - x³/3 + y

This means for each pair of (y, z) from the dy=0 solution, x must satisfy the cubic equation x³/3 - x + (z - y) = 0—so for each valid z, there can be 1 to 3 real x values that satisfy the nullcline condition.

Connecting to Your 3D Plot

Looking at your visualization:

  • The orange surface (you mentioned it as a curve, but it's technically a cubic surface) is the dx=0 nullcline, defined by the polynomial relationship between x, y, and z.
  • The purple curves correspond to the intersection of this cubic surface with the dy=0 surface (a parabolic cylinder y²=10z). These are exactly the two curves output by your code: one where y is positive for non-negative z, and one where y is negative.

内容的提问来源于stack exchange,提问作者Josh.F

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:39:30