Algebrite icon indicating copy to clipboard operation
Algebrite copied to clipboard

Missing documentation for Algebrite functions

Open lorenzos opened this issue 8 years ago • 8 comments

I can't find the documentation of the functions in the Algebrite object, I mean the ones that are not available in the scripting language and therefore already documented in the functions reference here. Maybe is somewhere I can't find.

For example, run(), eval() and clear() functions are not documented. I guessed that run() is equivalent to eval(...).toString(), and I found myself the existence of the clear() function, which is pretty needful I think.

More, it is not documented if there's a way to numerically solve expression by assigning values to symbols, and I accidentally found that I can pass additional expressions to eval() or run() to do that:

Algebrite.run('x^2+y^2', 'x=2', 'y=3')  // => 13

It'll be great if it can be done also like math.js do:

Algebrite.run('x^2+y^2', { x: 2, y: 3 })

lorenzos avatar Jan 19 '17 10:01 lorenzos

documentation work is ongoing. Will open separate issue for the "assigning values" request.

davidedc avatar Jan 23 '17 11:01 davidedc

Thank you!

lorenzos avatar Jan 23 '17 12:01 lorenzos

You can also use the Eigenmath manual for math functions. http://www.rejoicealways.net/lcu-semesters/fall2010/mat1302/Eigenmath.pdf

bloc97 avatar Feb 10 '17 01:02 bloc97

Notice that d() does not exist in Algebrite but it's documented there. I supposed it should read as derivative() which is in the package.

rafaelferreiraql avatar Jun 30 '17 14:06 rafaelferreiraql

Related:

The arguments of some functions have changed:

old: for(i,j,k,a,b,...) new: for(do(a,b,...),i,j,k)

old: sum(i,j,k,f) new: sum(f,i,j,k)

old: product(i,j,k,f) new: product(f,i,j,k)

pabloahb avatar Jul 28 '18 16:07 pabloahb

I've added the changes to for/sum/product documentation for the latest version (1.2.0) here: http://algebrite.org/docs/1.2.0/reference.html . The JS documentation is still under work, I'll try to get that done in the coming week.

davidedc avatar Aug 03 '18 15:08 davidedc

how can i eval a function with algebrite??

DIS-Connect avatar Aug 21 '18 21:08 DIS-Connect

@DIS-Connect using the internal scripting:

f(x) = 3*x
f(10)
> 30

Using JS:

Algebrite.run("f(x) = 3x+1");
Algebrite.run("f(10)"); // if you want the result as a string
> "31"
Algebrite.eval("f(10)"); // if you want the result as an Algebrite "atom" object
> U {cons: {…}, q: rational, k: 1}

davidedc avatar Aug 28 '18 08:08 davidedc