HP Forums

Full Version: Please help me understand
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Regarding: ab:=solve(x^2-3=1,x)

If I enter the above expression directly in the command line on the CAS page, I get an expected list, {-2,2.} for this example.

If I try this programmatically I get an unexpected list, {x}:
EXPORT ab,x;
EXPORT dmy()
BEGIN
ab:=solve(x^2-3=1,x);
print(ab);
return ab;
END;

If I try this programmatically I get an unexpected, 0 value.
EXPORT ab,x;
EXPORT dmy()
BEGIN
ab=solve(x^2-3=1,x); // <---Replaced ":=" with just "=" here
print(ab);
return ab;
END;

What program operation similar to ab:=solve(x^2-3=1,x) will return the list {-2,2.}, as if directly input on the CAS command line? I've tried several approaches, including appending CAS.solve(..), no success yet, though.

Thanks, I'm still climbing the learning curve!

-Dale-
If you want to run CAS commands, it might be a better idea to make a CAS program than a Home program, because you won't have to EXPORT a x variable that is a non-CAS variable, may have a value and could interfer with CAS evaluation (especially for a command like solve that auto-quote parts of it's arguments). From CAS enter
dmy():=
BEGIN
LOCAL ab;
ab:=solve(x^2-3=1,x);
print(ab);
return ab;
END;
then dmy()
From that,I learned that entering a program structure on the CAS command line does work. (I didn't realize that could be done). From the conn kit, how would you create a program to do that (rather than entering it all on the CAS command line)?

Or to say that differently, how does one edit a program input via the CAS command line?

Thank you for that working example. Very helpful!

-Dale-
(03-02-2014 04:22 PM)DrD Wrote: [ -> ]Or to say that differently, how does one edit a program input via the CAS command line?
-Dale-

I have the same questions here...

If I understand correctly, we have two different environments - Home and CAS; so, we have two different sets of variables to use, and one should not mix CAS functions like "solve" in a "Home regular" program.

I have just edited my post. I realized that once we define a small CAS program from the command entry line, we can see it from the general listing of programs (Shift+1), so it should be possible to edited it in the usual way.
Pls see: http://www.hpmuseum.org/forum/thread-683...s+function
I had the original program (dmy) left in the shift 1 catalog. I was not seeing the dmy(CAS) entry that I had put in via the CAS command line. So I deleted the original program, and now I do see the CAS entry version. Maybe there is a conflict if the same program name is resident in both environments? Maybe just a lot of learning (on my part) better explains it. In any event, I had not read about this distinction in the documentation so far.

Thanks for that link, it sheds more light on the subject.

I just noticed that the dmy(CAS) program does not show up in the connectivity kit, even after restarting both the ck and the virtual calc. It is present on the virtual calc, though. So editing via the ck editor is still an issue.

-Dale-

I have just edited my post. I realized that once we define a small CAS program from the command entry line, we can see it from the general listing of programs (Shift+1), so it should be possible to edited it in the usual way.
Pls see: http://www.hpmuseum.org/forum/thread-683...s+function
[/quote]
Hi Dale,
I'm starting here with this calculator as well... apparently we need a more comprehensive user guide...

However in the above link I believe there is a workaround to allow us to edit the programs in the CK:
"Thomas_Sch post:
found a possible work-around ;-)
- copy CAS program text to notes ([Shift] 0) (files named like programs),
- transfer notes / or send it in virtual calc
- now in real calc you may edit and copy the Notes,
- and paste it within program editor.
Works!"
There seems to be a lot of difference in the behavior of CAS programs with regard to the conn kit and calc handling. I've experimented a little, and learned that I have much more to learn! Some insight has been gained though, and that was all I was really after today.

Thank you very much for the assistance.

-Dale-
Reference URL's