183 Reputation

9 Badges

16 years, 164 days

MaplePrimes Activity

These are answers submitted by mapj

Your definition of AA gives an error. It looks like you want the Euler-Lagrange equation, so you can use the command in the Variational Calculus package (see help). This will give the ODE, which then can be solved with dsolve.

I was the one working on this back then. I don't have the files anymore as I switched to another approach, but the process I gave back then worked.

You can try being more explicit about the arguments like this:

forsub :=

where a normal Fortran call would be

call forsub(argreala,arginta,argrealb,argrealc,argintb)

where argreala, arginta, argrealb and argrealc are real or integer matrices as appropiate, and argintb is an integer in Fortran. The Fortran subroutines are in the library called forlib.dll.

After defining the arguments as the appropriate types in your Maple code like

argreala:=Matrix(5,3,datatype=float[8]): # fill in the terms in argreala after this

the call in Maple is just


This process worked for a single Fortran subroutine when I used it back then, and so hopefully it still does.

I suggest you try the old var package by Michal Marvan. It's part of the Maple share library at


This works for me.


sf1(v); # works

Your problem has a nonlinear objective function so you need to use NLPSolve to try to find a solution.

I asked a similar question here:

Does that help you?


Is this what you want?







# swap rows 1 and 2 if da < 0

if da < 0 then a:=RowOperation(a,[1,2]); fi:



I avoid the Maple docs like the plague and use straight text files that I read into a Maple session.

Text files are easy to edit and you can cut and paste code quickly.

Any decent editor will do the job. On Windows, Winedt and TSE Pro are good choices.


The terms in your eqns are large. Why not non-dimensionalizing them so that your eqns terms are around unity. This may make the dsolve error estimator more accurate. Also you could experiment with higher accuracy and different values of absolute and relactive errors.

Thanks to everyone for the solutions.

The latest Classical doesn't work for me on 32-bit Windows 7. A simple plot will freeze the system.

I think the Standard interface is terrible if you just want to get things done. My approach is to use Standard interface but I've changed the "input display" under options to Maple notation. This makes it behave more like Classical.

Page 1 of 1