Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with old Mathematica file

40 views
Skip to first unread message

Zsolt Ero

unread,
Jul 1, 2011, 4:55:15 AM7/1/11
to
I am trying to solve a problem, for what I finally found a book what has some Mathematica files supplied, but I am stuck now as I cannot run the file.

My problem is that I cannot run the program as it is written in Mathematica 3.0 and I don't know what should I change to make it run under today's Mathematica versions. Here is the error it returns.

> FindMinimum::fmgz: Encountered a
> gradient that is effectively zero. The
> result returned may not be a minimum;
> it may be a maximum or a saddle point.

The file is called Programs\MOTIPOIN.NB in this file: http://bit.ly/lMQh1K

or alternatively, here is a pastebin for the code in question: http://pastebin.com/ASBXnVVS

Can you have a look at what could be wrong with the code? Its only 50 lines, but I don't know how to fix it.

Patrick Scheibe

unread,
Jul 2, 2011, 5:01:08 AM7/2/11
to
Hi,

in line 26 and 27 you try to find a minimum of a function z and you are
starting at t=0 which is a maximum. There, the derivative is zero and
FindMinimum doesn't know where to walk.

Try setting

FindMinimum[z, {t, 0.01, 0, b trif}]

and don't try to adapt the programming style of this book, please.

Cheers
Patrick

Zsolt Ero

unread,
Jul 4, 2011, 7:04:24 AM7/4/11
to
Hi Patrick,

Thanks, it seems to work! Is there any way to display the graphs it generates inside the module? I think originally it was made to show you the resulting graphs, but now with ; after the plot functions it doesn't display anything.

Zsolt


0 new messages