Post Reply 
CAS: overriding HOME variables, bug or feature? (for me, a feature!)
07-11-2021, 02:05 PM
Post: #2
RE: CAS: overriding HOME variables, bug or feature? (for me, a feature!)
(07-09-2021 10:43 PM)ramon_ea1gth Wrote:  simplify(‘Z:=Z0·exp(i·β·z)’)

Now it happens! Z is converted into a CAS variable, overriding the HOME variable Z typed as real

If you do use simplify "feature", I suggest create CAS variables first.
This documented what HOME variables are being overrided.

CAS> simplify('[Z, Z0] := [0, 100]')
CAS> Z := Z0 * exp(i*β*z)

However, I would advise against doing this. With Undefined Behavior, Anything is Possible

Quote:(Edited: minor change to have a non-zero value of Z0 before retrieving Z).

Besides using undefined-behavior, Z0 cannot be symbolic, thus the need to assign it something.
(all overrided HOME variables have the same problem)

It might be safer to add a character before capitalized name.

We could use hard-space, " ", but that is just asking for trouble ...
On HP Prime emulator, I use "%". (maxima also use %, %i = √-1, %e = 2.718281828...)

CAS> %Z := %Z0 * exp(i*β*z)
CAS> diff(%Z, %Z0)                 // %Z0 is true variable

e^(i*β*z)

It would be nice if HP Prime truly separate HOME and CAS variables.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: CAS: overriding HOME variables, bug or feature? (for me, a feature!) - Albert Chan - 07-11-2021 02:05 PM



User(s) browsing this thread: 1 Guest(s)