LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2009, 03:58 AM   #1
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Rep: Reputation: 32
Thumbs up Need a math tool that works like a spreadsheet


I have an elaborate spreadsheet that computes income tax based on a given gross. The gross input is entered in one cell, and the whole spreadsheet derives results from it.

The problem is the input cell can only hold one value. I want the spreadsheet to act as a function, so hundreds of values can be input, and output range of values.

It appears that no mainstream spreadsheets can do this. I've looked at oocalc, excel, and googledocs.

Are there any math tools that can model a function with a spreadsheet-like presentation, and handle a series of inputs?

Last edited by jgombos; 11-01-2009 at 04:41 AM.
 
Old 10-30-2009, 04:51 AM   #2
antegallya
Member
 
Registered: Jun 2008
Location: Belgium
Distribution: Debian
Posts: 109

Rep: Reputation: 42
Hello,
I don't know if I fully understand what you want, but I would recommend Giac/Xcas :
http://www-fourier.ujf-grenoble.fr/~parisse/giac.html
wich is a computer algebra system.
It has a spreadsheet functionnality and you can eventually define cells that are functions, you put something like "x->x^2+1" in the A0 cell and in the A1 cell put "A0(3)" and the value of A1 will be the evaluation of the function defined in A0, i.e 10.
I hope this tool will help you.
 
Old 10-30-2009, 07:19 AM   #3
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by antegallya View Post
Hello,
I don't know if I fully understand what you want, but I would recommend Giac/Xcas :
http://www-fourier.ujf-grenoble.fr/~parisse/giac.html
wich is a computer algebra system.
It has a spreadsheet functionnality and you can eventually define cells that are functions, you put something like "x->x^2+1" in the A0 cell and in the A1 cell put "A0(3)" and the value of A1 will be the evaluation of the function defined in A0, i.e 10.
I hope this tool will help you.
At first glance, this appears to be exactly what I need. Thanks, I'll check it out. Might be a pain though, since there doesn't seem to be an etch version.

I was able to get it installed.. had to create a 32 bit chroot jail running lenny.

Last edited by jgombos; 10-30-2009 at 04:29 PM.
 
Old 11-01-2009, 04:54 AM   #4
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Original Poster
Rep: Reputation: 32
I thought Xcas would work, but now that I'm actually trying to use it I'm not so sure. Suppose the taxable income is in cell B2, and the resulting tax ends up in cell B30.

I want cell B2 to get as input the values 2000, 2500, 3000, 3500, for example. How is that specified? I could do a series in a column (A0..A3), but when I enter A0..A3 in cell B2, the range is referenced literally in every cell that references B2. And cell B20 has garbage. I would like the results to be put in say E0..E3.

You seem to think I want the spreadsheet to use a function. I actually want the spreadsheet to /become/ the function.
 
Old 11-01-2009, 10:35 AM   #5
antegallya
Member
 
Registered: Jun 2008
Location: Belgium
Distribution: Debian
Posts: 109

Rep: Reputation: 42
Quote:
Might be a pain though, since there doesn't seem to be an etch version.

I was able to get it installed.. had to create a 32 bit chroot jail running lenny.
I've got it installed on a 64bits testing, but I think it should have to work on etch too.
Did you read that ? : http://www-fourier.ujf-grenoble.fr/~...ll_en#packages

I understand your problem better now. I don't see how to do exactly what you want (consider the spreadsheet as a function) with xcas.
But I have two solutions for your problem :
1) Write down the full function that computes your income tax and map it to a list. You don't even need a spreadsheet.

But I presume that something makes you want to preserve the use of a spreadsheet, so here's solution 2, also answering your question :
Quote:
I want cell B2 to get as input the values 2000, 2500, 3000, 3500, for example. How is that specified?
2) Put a list in B2 for example "=[2000, 2500, 3000, 3500]". And do all you computations bearing in mind that your values are lists.
You can still apply operations like "sum" or "mean" over a list of lists, they will be applied element by element on the lists.
And you can map functions to a list with "map([2000, 2500, 3000, 3500], x -> x^2)" for example.
Using that you will be able to do all your computations on each element of the input list and get the list of results at the end.

I hope this will help.

Last edited by antegallya; 11-01-2009 at 10:37 AM.
 
Old 11-02-2009, 03:54 AM   #6
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by antegallya View Post
I've got it installed on a 64bits testing, but I think it should have to work on etch too.
Did you read that ? : http://www-fourier.ujf-grenoble.fr/~...ll_en#packages
It may have worked, but there was a significant warning about dependencies on different versions of low level libraries like libc type of stuff. The warning implied that chance of success was not great. I could have forced the installation, but I will not risk destroying the fragile hack of a system that I have running well at the moment. In the 32bit chroot jail running lenny, there was no such warning, and it went smoothly.

Quote:
Originally Posted by antegallya View Post
I understand your problem better now. I don't see how to do exactly what you want (consider the spreadsheet as a function) with xcas.
But I have two solutions for your problem :
1) Write down the full function that computes your income tax and map it to a list. You don't even need a spreadsheet.
The spreadsheet gave me the presentation and portability that I was after, but since today's tools are unsuitable for expressing a function as a spreadsheet, I broke down and decided to write a traditional function using a programming language instead.

Quote:
Originally Posted by antegallya View Post
But I presume that something makes you want to preserve the use of a spreadsheet, so here's solution 2, also answering your question :

2) Put a list in B2 for example "=[2000, 2500, 3000, 3500]". And do all you computations bearing in mind that your values are lists.
I was after more flexibility and encapsulation. I didn't want every operation in the spreadsheet to be designed to operate on more than one input. Just like in programming languages, it's a good design (for simplicity) for a function to only have awareness of one input value or record at a time, and output exactly one value (essentially, a pure math function). So I was originally after a mechanism that would copy the first value of a list to the input cell, evaluate the spreadsheet, capture the corresponding output cell, and iterate to the next value.

It would be a useful capability to have. Sometimes I quickly come up with a spreadsheet, which evolves, and then as an afterthought I want to do more advanced things like feed a series through it. I find it surprising that it's not a common enough need for mainstream spreadsheets to simply have that kind of feature.

Last edited by jgombos; 11-02-2009 at 04:08 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C (math.h)not doing right math? exp() issue. knockout_artist Programming 7 11-25-2011 02:13 PM
Can ext2online tool works on ext3. cj_cheema Linux - Server 1 07-08-2009 04:48 AM
LXer: Sage: a free, open-source complex math tool LXer Syndicated Linux News 0 12-08-2007 07:21 AM
Looking for a Multi-site tool that works with CVS rajat Linux - Server 0 10-30-2007 12:56 AM
math program that I can enter math functions ... Four General 5 04-19-2006 08:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration