|
|
| Author |
Message |
Dave (from the UK) science forum addict
Joined: 12 Jan 2006
Posts: 76
|
Posted: Sat May 20, 2006 5:12 pm Post subject:
Problem with Mathematica in batch mode.
|
|
|
I'm trying to run mathematica in batch mode on a UNIX box. If the output
appears on two lines, as it does on occasions, the results are wrong.
Any help appreciated.
The following puts a set of commands in the file foo, and writes the
result to the file foobar, it works fine.
sparrow /tmp % echo "1+2" > foo
sparrow /tmp % math -batchinput -batchoutput < foo > foobar
sparrow /tmp % cat foobar
" Cannot initialize Motif graphics "
3
But here is an example of where it goes wrong. In this case the number
has a power, which gets put on another line, which is not directed into
the file.
sparrow /tmp % echo "10000000000000+2.043" > foo
sparrow /tmp % math -batchinput -batchoutput < foo > foobar
sparrow /tmp % more foobar
" Cannot initialize Motif graphics "
1.0000000000002043*^13
In this case, Mathematica would normally show 1.0000000000002043*10^13,
but the "10" appears on the line above and so gets missed.
--
Dave K MCSE.
MCSE = Minefield Consultant and Solitaire Expert.
Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually. |
|
| Back to top |
|
 |
Peter Pein science forum addict
Joined: 04 May 2005
Posts: 56
|
Posted: Sat May 20, 2006 6:08 pm Post subject:
Re: Problem with Mathematica in batch mode.
|
|
|
Dave (from the UK) schrieb:
| Quote: | I'm trying to run mathematica in batch mode on a UNIX box. If the output
appears on two lines, as it does on occasions, the results are wrong.
Any help appreciated.
The following puts a set of commands in the file foo, and writes the
result to the file foobar, it works fine.
sparrow /tmp % echo "1+2" > foo
sparrow /tmp % math -batchinput -batchoutput < foo > foobar
sparrow /tmp % cat foobar
" Cannot initialize Motif graphics "
3
But here is an example of where it goes wrong. In this case the number
has a power, which gets put on another line, which is not directed into
the file.
sparrow /tmp % echo "10000000000000+2.043" > foo
sparrow /tmp % math -batchinput -batchoutput < foo > foobar
sparrow /tmp % more foobar
" Cannot initialize Motif graphics "
1.0000000000002043*^13
In this case, Mathematica would normally show 1.0000000000002043*10^13,
but the "10" appears on the line above and so gets missed.
Hi Dave, |
this is not a problem but Mathematica's usual number representation when not interpreted by the Frontend:
10000000000000+2.043//InputForm
--> 1.0000000000002043*^13
Peter |
|
| Back to top |
|
 |
Dave (from the UK) science forum addict
Joined: 12 Jan 2006
Posts: 76
|
Posted: Sat May 20, 2006 7:50 pm Post subject:
Re: Problem with Mathematica in batch mode.
|
|
|
Peter Pein wrote:
| Quote: |
Hi Dave,
this is not a problem but Mathematica's usual number representation
when not interpreted by the Frontend:
10000000000000+2.043//InputForm
--> 1.0000000000002043*^13
Peter
|
Thanks. I realised in the end. In fact, it can be even more confusing at
times, when it looks like this.
4.0238726007709377354370243392300398571937486`15.954589770191005*^2567
where I think the 15.954589770191005 is digits of precision, as
N[1000!,20]
returns:
4.0238726007709377354370243392300398571937486`20.*^2567
Thank you.
--
Dave K MCSE.
MCSE = Minefield Consultant and Solitaire Expert.
Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually. |
|
| Back to top |
|
 |
Albert Reiner science forum beginner
Joined: 02 May 2005
Posts: 21
|
Posted: Sun May 21, 2006 1:22 pm Post subject:
Re: Problem with Mathematica in batch mode.
|
|
|
["Dave (from the UK)" <see-my-signature@southminster-branch-line.org.uk>, Sat, 20 May 2006 18:12:02 +0100]:
| Quote: | I'm trying to run mathematica in batch mode on a UNIX box. If the
output appears on two lines, as it does on occasions, the results are
wrong. Any help appreciated.
|
I see that your original problem is solved, but if you want to run Mma
in batch mode, it is probably a good idea to have a look at MASH:
http://ai.eecs.umich.edu/people/dreeves/misc/mash/
Albert. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 9:16 pm | All times are GMT
|
|
Guitar Lessons | Guitar Lessons | Flash Games | WesternUnion | Free Credit Report
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
Other DeniX Solutions sites:
Electronics forum |
Medicine forum |
Unix/Linux blog |
Unix/Linux documentation |
Unix/Linux forums
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|