Author Topic: nCalc, calculus using the native Nspire's math engine with Ndl3ss  (Read 36061 times)

0 Members and 1 Guest are viewing this topic.

Offline excale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 103
  • Rating: +19/-1
    • View Profile
As you may know,TI-Nspire's Basic is really good for math stuff.
But when its comes to games and graphical programming, it is another story.

Lua can handle this, but is slow compared to compiled code, and has lots of limitations. Though, Lua had a pretty interesting advantage: you can use the native math engine trough math.eval() (and thus use CAS on CAS-nspires).

Thus, I decided to code a library which use to native Nspire's math engine in order on make advances calculus in Ndless programs. This allows to make math and physics programs, which is really harder without what you may know under the name of math.eval() or expr().

For those who know about Lua, math.eval() does returns a number. Here, it is more like expr(), and returns anything (in a string).

I didn't start the library code 'itself' (it is already very long to figure out how the math engine works...). Thus, for now, it is only usable in console-mode (for debugging ect...). By the way, thanks to Compu for his NspireIO :).

Here is a screenshot of what I've made.

(the strange 'a <<' is because the math engine returns an UTF-8 string and the console handles ASCII strings.)

For now, there are two major functions: one which 'corrects' the input (functions are case-sensitive, ect...) and another one which actually does the calculus. I don't think I can find a function that adds forgotten parenthesis, as they are added directly when you type the expression, and not during the evaluation.

Now it's your time to say what you think of it. If some people are interested in using the (future) lib, let me know what kind of functions you would like to see, so I can code something cool :).

(Technically, for now, you give an ASCII or UTF-8 string and the function returns an ASCII or UTF-8 string with the result or the 'corrected' input). I am planning to add a function which return a float number when it can.

 ;)

(Sorry if there are English mistakes)

Full topic here: http://tiplanet.org/forum/viewtopic.php?t=9198

PS: How are you supposed to write a post with these blinking smileys catching your attention  ;D?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #1 on: May 01, 2012, 06:51:53 pm »
This is awesome. But I lost the game :P

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #2 on: May 01, 2012, 08:28:21 pm »
This is awesome. But I lost the game :P
Lol I saw that in the code too.  Trolling! XP
Good job though anyhow.  I would like some calculus tools for next year..
You just lost the game.



Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #3 on: May 02, 2012, 03:39:15 am »
This is very nice :)
Finally might be able to start creating more non-games stuff through this, something that TI will like :P (They should help us with it!)

Quote
For those who know about Lua, math.eval() does returns a number. Here, it is more like expr(), and returns anything (in a string).
False, math.eval can return a string too when it cannot be represented as a number ;)
And in 3.2 you will have much more control over it too :)


Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #4 on: May 02, 2012, 06:35:40 am »
This is awesome !
This is definetly really useful.

Great job :)

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #5 on: May 02, 2012, 01:27:11 pm »
Does this or will it happen to support symbolic integration?

If so, you are my hero :P

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #6 on: May 02, 2012, 01:50:26 pm »
FWIW, we've had proof for a year that it was possible to do CAS stuff on the Nspire using native code: http://www.ticalc.org/archives/files/fileinfo/437/43727.html ;)
But going further (e.g. making variables persistent in the document) requires documentation which TI is of course not providing, and too time-consuming to obtain by ourselves through reverse-engineering.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline excale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 103
  • Rating: +19/-1
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #7 on: May 02, 2012, 01:58:56 pm »
Does this or will it happen to support symbolic integration?

If you have a Nspire (CX) CAS, then yes. I you have a non-CAS model, obviously no :D.

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #8 on: May 02, 2012, 04:53:37 pm »
Does this or will it happen to support symbolic integration?

If you have a Nspire (CX) CAS, then yes. I you have a non-CAS model, obviously no :D.

Ah. I have a Non-CAS DX

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #9 on: May 03, 2012, 04:43:22 pm »
Nice :)
But no download link yet?
Ndless.me with the finest TI-Nspire programs

Offline excale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 103
  • Rating: +19/-1
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #10 on: May 05, 2012, 03:44:19 pm »
Nice :)
But no download link yet?
Well, the console program by itself is useless, and I still get some issues with some tricky points.
(Like making the Nspire open a new TNS file from luaext/hooks without rebooting :D)
By the way, are you planning to add Hook_remove? It would allow to make one-time hooks, which can be pretty usefull :).
« Last Edit: May 05, 2012, 03:45:00 pm by excale »

Offline neuronix

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 108
  • Rating: +0/-0
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #11 on: January 27, 2016, 11:22:09 am »
Where is it possible to download this program?
I don't find it on TI-Planet.

Sorry for my english but I am French  :-\

Offline unifire

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #12 on: March 07, 2016, 01:10:59 am »
where is the Download link?

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #13 on: March 07, 2016, 01:29:24 am »
@neuronix and @unifire in the very first post click the TI-planet link. There's a download for the zip on TI-planet. It doesn't look like this was ever finished though.

Offline unifire

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: nCalc, calculus using the native Nspire's math engine with Ndl3ss
« Reply #14 on: March 07, 2016, 02:20:18 am »
o yes the french site, i still cant find the zip but since you have checked it out i will take ur word for it,

Thank you very much