问题描述
我想做类似deltax=symbols(",,\delta x")
但这似乎给出了一个元组而不是多字符符号.甚至有可能吗?我应该补充一点,我正在使用 Jupyter.
I would like to do something like deltax=symbols(",,\delta x")
But this seems to give a tuple not a multicharacter symbol. Is it even possible?I should add that I am using Jupyter.
推荐答案
symbols
函数很方便,它允许我们一次创建多个符号,例如 a, b, c= symbol("a,b,c")
或 a, b, c = symbols("abc")
,或 syms = symbols("a1:6")代码>.缺点是我们不能使用它来创建名称中带有逗号(或空格或冒号)的符号.相反,必须直接使用
Symbol
类的构造函数:
The function symbols
is convenient in that it allows us to create several symbols at once, like a, b, c = symbols("a,b,c")
or a, b, c = symbols("a b c")
, or syms = symbols("a1:6")
. The downside is that we can't use it to create a symbol with a comma (or a space, or a colon) in its name. Instead, the constructor of Symbol
class has to be used directly:
deltax = Symbol(",,\delta x")
这篇关于使用希腊语为 deltax 创建多字符 SymPy 符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!