- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to put some symbolic expressions, computed in Maple 8(or Mathematica 5) into Fortran program. How "to hook" them?
I use Visual Compaq Fortran 6.5
Thank you
Message Edited by Leo_vortex on 07-21-2004 08:32 PM
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not quite sure it's that what you mean/intend to do - in Maple you have command CodeGeneration [Fortran] with several options, which translates expressions into Fortran77 (function/subroutine) code.
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know what you mean by "to hook" them. It might help you to look at Mathematica's FortranForm command to write out an expression for Fortran. You might also check into Mathematica's MathLink facilities for communicating between Mathematica and other languages.
Mike D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What I need is to compute rather bulky indefinite integral in Maple/Mathematica and then to use it in my Fortran program
for some numerical solving.
I don't want to write it in Fortran, because it's really big and complicated. SotheFortran program has to read data from
Maple/Math.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Leo,
I believe you can access Maple routines via OpenMaple (API calls, in C). Take a look at examples in Maple/Samples/OpenMaple/ directory and simple in particular (evaluates an integral). The description reads:
This example program illustrates how to use the OpenMaple API to initialize the Maple kernel and compute with it.Users are encouraged to use and modify this code as a startingpoint for learning the OpenMaple API.
Or maybe you will needa simple write/save to command to save the session and results to a file and then read the values in Fortran. Depends on your applications.
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no such directory
X:/Program Files/ Maple/Samples/OpenMaple/ in my system.
Wehave maple 8. :robotsad:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK. Sorry for that. I overlooked that you wrote it was Maple 8. I have Maple 9 installed, and just checked that this (OpenMaple) is listed as the new feature (lots of examples and documented APIs). Well, so you're left with two options, I believe: one is to translate into Fortran source code (I used it for really complicated expressions - you don't do anything - just copy, paste, and compile)and the second tofindcommand what saves your results to the file and then read them back to your application.
A.
PS. Maybe in Maple 8 you can call external routine which would do some formatting for you and export to your code.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page