Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentials display differently in a REPL than their docstring indicates they should #1076

Open
LilithHafner opened this issue Feb 26, 2024 · 1 comment

Comments

@LilithHafner
Copy link
Contributor

From the docstring,

help?> Differential
search: Differential

  struct Differential <: Symbolics.Operator

  Represents a differential operator.

  Fields
  ≡≡≡≡≡≡

    •  x: The variable or expression to differentiate with respect to.

  Examples
  ≡≡≡≡≡≡≡≡

  julia> using Symbolics
  
  julia> @variables x y;
  
  julia> D = Differential(x)
  (D'~x)

But in a REPL, I get a different result

julia> using Symbolics

julia> @variables x y;

julia> D = Differential(x)
(::Differential) (generic function with 3 methods)

julia> D(y) # Differentiate y wrt. x
Differential(x)(y)

julia> Dx = Differential(x) * Differential(y) # d^2/dxy operator
Differential(x)  Differential(y)

julia> D3 = Differential(x)^3 # 3rd order differential operator
Differential(x)  (Differential(x)  Differential(x))

Strangely, the REPL docstring example is a doctest. I'm happy to change the docstring and/or the show behavior so that these align.

@ChrisRackauckas
Copy link
Member

The docstring is just really old. Interesting the doctest doesn't fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants