2021: Examples of CAS-type programs - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: 2021: Examples of CAS-type programs (/thread-16848.html) |
2021: Examples of CAS-type programs - compsystems - 05-01-2021 12:22 AM Hello In this post I am going to put a series of examples of CAS-type programs SCRIPT 01: obtaining the solutions of the quadratic equation You can run the following sentences line by line in the CAS history, please let me know if the results on your calculator are different. Change manually Simplify mode to None [shift] + [CAS (settings)] autosimplify cmd of Xcas is not yet available in firmware 2021 autosimplify (0); // Xcas only = ( SCRIPT 01 PHP Code: autosimplify(0); // Xcas only =( Please inform me if I am wrong. What other calculator with CAS and original firmware can do the above? I think no one, only the HP-Prime with Xcas, simply because they (TI; Texas Instruments, CASIO, Sharp, Numworks ...) can't control the simplification type of output. the same script above but with comments PHP Code: autosimplify(0); the same script above but using SUBST to make changes to the expression without converting to text strings PHP Code: autosimplify(0); as a program and 2D printing PHP Code: #cas Printing with the #183 character "·" would look more compact and legible, this will allow to display the "*" symbol as a "·", this could be changed by configuration, depending on how you want to display the multiplication operator. This feature was available on the hp48gx using optional template for cas prg PHP Code: #cas Code: #cas Script using only the ANS variable PHP Code: (a*x^2+b*x+c) = 0; as prgm PHP Code: #cas in writing. RE: 2021 Examples of CAS-type programs - jonmoore - 05-01-2021 07:20 AM When using KhiCAS all of the following calculators can match this workflow. - NI Nspire CX II (CAS and non-CAS models) - Numworks - Casio CG50 and the low-cost Casio FX-9860G-III Bernards push to provide a universal CAS for a wide range of hardware inclusive of exam friendly non-CAS models is an interesting challenge for HP to answer. Not to sound like a scratched record, I think it's time that HP allows developers like Bernard to provide solutions coded in C to run directly on the Prime. As Bernard himself has stated, Casio allows developers to provide solutions of this nature natively and it has no effect on the perception of Casio calculators as being exam friendly. NI of course forces the community to use Ndlesss, but these days it's a matter of days between NI updating the firmware and Ndless providing a matching solution. Whilst it's true to say that the HP Prime G2 is the most powerful calculator to process programs of the nature detailed in post 1 (and with more available RAM); all of the competitor calculators mentioned above are fast enough these days that the average user won't notice any difference. There's even a chance that the NI Nspire CX II will be faster as KhiCAS is running directly on the ARM hardware, not via a host OS. None of what I write above should be taken as me preferring any of the aforementioned competitor calculators, but it is important that a balanced view is acknowledged. RE: 2021 Examples of CAS-type programs - rprosperi - 05-01-2021 01:16 PM NI ? Is there some reason to not call them TI ? RE: 2021 Examples of CAS-type programs - roadrunner - 05-01-2021 06:08 PM Perhaps jonmoore is one of the Knights who say NI? https://en.wikipedia.org/wiki/Knights_Who_Say_%22Ni!%22 -road RE: 2021 Examples of CAS-type programs - jonmoore - 05-01-2021 06:39 PM (05-01-2021 06:08 PM)roadrunner Wrote: Perhaps jonmoore is one of the Knights who say NI? What a random slip! The NI acronym I use all the time is Native Instruments (I own the whole kaboodle of their kit) as I have a music production setup. https://www.native-instruments.com/en/ RE: 2021 Examples of CAS-type programs - rprosperi - 05-01-2021 08:27 PM (05-01-2021 06:08 PM)roadrunner Wrote: Perhaps jonmoore is one of the Knights who say NI? I originally wrote something along these lines, but then thought it too obscure and removed the reference to the Knights. Thanks for restoring my faith that this is a universal reference. RE: 2021 Examples of CAS-type programs - jonmoore - 05-02-2021 11:29 AM (05-01-2021 08:27 PM)rprosperi Wrote:(05-01-2021 06:08 PM)roadrunner Wrote: Perhaps jonmoore is one of the Knights who say NI? @TheRealPython, too obscure - maybe in an alternative universe! BTW @roadrunner scored double points for the aptness of their punnery! RE: 2021 Examples of CAS-type programs - BruceH - 05-02-2021 05:26 PM (05-01-2021 12:22 AM)compsystems Wrote: What other calculator with CAS and original firmware can do the above? The 28C had a menu that allowed manipulations of sub-parts of an expression that got lost in the transition to the 48SX. Although not nearly as sophisticated as your examples here, it allowed things like selecting part of an expression and adding zero or multiplying by 1. This then made it easier to re-arrange things by moving parts to the other side of the equals sign. Clearly, back in the days of the 28C such things were much quicker to do by hand but I always wondered why it got dropped - it's an educational tool after all - and your post brought it all back. RE: 2021 Examples of CAS-type programs - jonmoore - 05-02-2021 07:01 PM Just spotted the original firmware edit to the original post. If you're going to edit your original post because the facts were wrong at least have the good grace to acknowledge the reasons why... I'm a huge fan of HP calculators but I really can't be dealing with tribalism. The original unedited post was factually incorrect, hence my follow up post. This post wasn't intended to dis the Prime, it's clearly the best hardware in its competitor set. But Bernards belief in making CAS technology freely available to all possible OS environments, inclusive of a variety of non-HP calculators is to be applauded. It doesn't necessarily make KhiCAS better than the XCAS integration on the Prime. In fact, the key word here is integration. Whilst KhiCAS on the TI Nspire CX II is to all intents and purposes the full desktop version of XCAS, the fact that it's a separate application that's not integrated into the host OS means that it will never be a match for the HP Prime in terms of 'calculator UX' flexibility. But it has its own UX strengths too. RE: 2021 Examples of CAS-type programs - compsystems - 05-02-2021 07:19 PM Hello With or without "original firmware" is the same, because third-party applications that are not factory integrated do not count. But assuming third party applications, HP-Prime CAS is far inferior to KhiCAS as it does not include all the functions that can be executed within the calculator hardware. I do not even understand what is the difficulty for hpprime CAS to include almost all the Xcas functions, Bernard said that it is not him who decides which functions are made visible or not. This implies that the functions are hidden or could be included very easily. I hope that the hp-prime development group will reconsider it and give us the possibility to have almost all the Xcas functions in the hp-prime, they do not lose anything, on the contrary we all win. Or why don't they want to include the full CAS? What limits this inclusion RAM, hardware? Only in the first example I show that we need the autosimplify() function since when redistributing a code I have to tell the user, manually he has to modify some flags, but within a code I need to automatically change the flags and in this case it is no longer feasible to tell user to change x flags again. Remember that I use a translator, please let me know if any word sounds bad RE: 2021 Examples of CAS-type programs - jonmoore - 05-02-2021 09:17 PM (05-02-2021 07:19 PM)compsystems Wrote: Remember that I use a translator, please let me know if any word sounds bad All good. RE: 2021 Examples of CAS-type programs - compsystems - 05-06-2021 03:59 AM cas + pixels cmds Example with standard CAS notation. PHP Code: #cas As function xcas compatibility PHP Code: #cas deltalist(time(fract2(320,240,10))); // only for Xcas to determine the execution time using symmetry PHP Code: #cas With Python syntax. PHP Code: #cas XCAS only PHP Code: function fract2( X_, Y_, Nmax ) Video about fractal graphic code. XCAS only PHP Code: function fract2a( X_, Y_, Nmax ) RE: 2021 Examples of CAS-type programs - compsystems - 05-07-2021 02:26 AM "WHEN" "IFTE"and "()?" CMDS WHEN CMD 4 arguments 1: test to solve 2: action for true 3: action for false 4: optional if you cannot solve the test with 4 args PHP Code: #cas test_whencmd_cas_0(eeee) > "other" with 3 args PHP Code: #cas as function PHP Code: #cas test_whencmd_cas(true); [enter] returns true test_whencmd_cas(false); [enter] returns false purge(x); test_whencmd_cas(x); [enter] returns ((x)? true : false) test_whencmd_cas(1); test_whencmd_cas(0); test_whencmd_cas(-1); [enter] returns true, false, true with (?) infix operator PHP Code: #cas as function PHP Code: #cas test_questionmarkcmd_cas(1); test_questionmarkcmd_cas(0); test_questionmarkcmd_cas(-1); [enter] returns true, false, true test_questionmarcmd_cas(x); [enter] returns ((x)? true : false) with IFTE cmd, the test must always return a numerical value PHP Code: #cas as function PHP Code: #cas test_iftecmd_cas(1); test_iftecmd_cas(0); test_iftecmd_cas(-1);test_iftecmd_cas(true); test_iftecmd_cas(false); [enter] 1, 0, 1, 1, 0 test_iftecmd_cas(x); [enter] IFTE(x,1,0) ifte + := operator ifte(true,(testvar1:=123),(testvar2:=456)); [enter] returns 123 ok [up] [up] [copy] [enter] ok ifte(false,(testvar1:=123),(testvar2:=456)); [enter] returns 456 ok purge(testvar1, testvar2); ifte(true,(123=>testvar1),(456=>testvar2)); ? + => operator (true)? (123=>testvar1): (456=>testvar2); [enter] returns 123 ok, (false)? (123=>testvar1): (456=>testvar2); [enter] returns 456 ok, but [up] [up][copy] [enter] "sto 123:testvar4 not allowed! Error: Bad Argument Type" Cause of the problem: the parentheses are suppressed in the arguments (123=>testvar3) to 123=>testvar3, this means that it cannot be interpreted RE: 2021: Examples of CAS-type programs - compsystems - 05-09-2021 10:21 PM Hello trying the following code I have problems PHP Code: #cas do you have this problem on your calculator? Now I want in the hp-prime to automate the factoring output without asking the user to change the flag manually Xcas Code PHP Code: test_withsqrt_flag(x):= |