Marian Fiver
Marian Fiver

Reputation: 45

How to use the symbol which has been seen as constant in Maple?

For example, I would like to use symbol 'gamma', but 'gamma' is a maple constant(approximately 0.57722). If you use it persistantly, it will report an error

solve({2*gamma > 4}, {gamma});
Error, (in solve) a constant is invalid as a variable, gamma

Do I have some way to use gamma like a normal variable? Thank you in advance.

Upvotes: 2

Views: 282

Answers (2)

John M
John M

Reputation: 295

In older versions of Maple you can use:

unprotect(gamma); gamma := convert(gamma, `local`);

acer's solution is better in versions where it is supported.

Upvotes: 1

acer
acer

Reputation: 7246

In recent Maple versions you can declare local instances of protected names or constants, at the top-level.

restart;
kernelopts(version);

    Maple 2018.0, X86 64 LINUX, Mar 9 2018, Build ID 1298750

local gamma:

solve({2*gamma > 4}, {gamma});

                      {2 < gamma}

Upvotes: 2

Related Questions