FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Math » Symbolic
Problem with Mathematica in batch mode.
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
Author Message
Dave (from the UK)
science forum addict


Joined: 12 Jan 2006
Posts: 76

PostPosted: Sat May 20, 2006 5:12 pm    Post subject: Problem with Mathematica in batch mode. Reply with 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.


--
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

PostPosted: Sat May 20, 2006 6:08 pm    Post subject: Re: Problem with Mathematica in batch mode. Reply with quote

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

PostPosted: Sat May 20, 2006 7:50 pm    Post subject: Re: Problem with Mathematica in batch mode. Reply with quote

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

PostPosted: Sun May 21, 2006 1:22 pm    Post subject: Re: Problem with Mathematica in batch mode. Reply with quote

["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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 9:16 pm | All times are GMT
Forum index » Science and Technology » Math » Symbolic
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts help on problem brb003 Math 0 Mon Aug 28, 2006 3:31 am
No new posts fraction problem mikerule Research 0 Thu Aug 24, 2006 5:10 am
No new posts Mod computer problem William Elliot Math 4 Fri Jul 21, 2006 12:07 pm
No new posts Divine apparitions in the tethered go... jpalmour@gmail.com Math 6 Thu Jul 20, 2006 8:26 pm
No new posts possible to use Generalized Method of... comtech Math 1 Thu Jul 20, 2006 12:49 am

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
[ Time: 0.2645s ][ Queries: 16 (0.1822s) ][ GZIP on - Debug on ]