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

parse does not preserve multiplication symbol #20

Open
schillic opened this issue May 10, 2018 · 1 comment
Open

parse does not preserve multiplication symbol #20

schillic opened this issue May 10, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@schillic
Copy link
Member

schillic commented May 10, 2018

From the documentation:

julia> parse_sxmath("x' == x & v' == -0.75*v")
2-element Array{Expr,1}:
 :(x' = x)
 :(v' = -0.75v)

Assume that the variable is called e1. You get :(v' = -0.75e1), which is then interpreted as -7.5 in later stages.

The problem is with the parse call in the last line:

julia> parse("v' == -0.75*v")
:(v' == -0.75v)

This occurs in the Platooning model.

@schillic schillic added the bug Something isn't working label May 10, 2018
@schillic schillic changed the title parse_sxmath does not preserve multiplication symbol parse does not preserve multiplication symbol May 10, 2018
@mforets
Copy link
Member

mforets commented May 10, 2018

FWIW, SymEngine's convert gets it right:

julia> using SymEngine

julia> expr = convert(Basic, "4.5*e1")
4.5*e1

julia> SymEngine.free_symbols(expr)
1-element Array{SymEngine.Basic,1}:
 e1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants