Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.symbolic.independent

Topic: convert from Derive to Maple
Replies: 1   Last Post: Apr 20, 2013 2:23 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Axel Vogt

Posts: 1,038
Registered: 5/5/07
convert from Derive to Maple
Posted: Apr 20, 2013 2:14 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I use the following, if clicliclic = Martin posts his
Derive formulae. Mostly it works, sometimes one better
cares for the original line continuations '~' by hand.


convertFromDerive:=proc(str::string)
# wie line breaks finden und ersetzen?
StringTools[SubstituteAll]( str, "~", "\\" ):
[StringTools[RegSplit]("~",%)]: cat( op(%));

StringTools[SubstituteAll]( %, "INT", "Int" ):

StringTools[SubstituteAll]( %, "SIGN", "sign" ):
StringTools[SubstituteAll]( %, "SQRT", "sqrt" ):
StringTools[SubstituteAll]( %, "#e", "exp(1)" ):
StringTools[SubstituteAll]( %, "LN", "ln" ):

# do it before (!) replacing SIN etc ...
StringTools[SubstituteAll]( %, "ATANH", "arctanh" ):
StringTools[SubstituteAll]( %, "ATAN", "arctan" ):
StringTools[SubstituteAll]( %, "ASIN", "arcsin" ):
StringTools[SubstituteAll]( %, "ACOS", "arccos" ):

StringTools[SubstituteAll]( %, "COS", "cos" ):
StringTools[SubstituteAll]( %, "SIN", "sin" ):
StringTools[SubstituteAll]( %, "TAN", "tan" ):
StringTools[SubstituteAll]( %, "COT", "cot" ):
StringTools[SubstituteAll]( %, "SEC", "sec" ):
StringTools[SubstituteAll]( %, "CSC", "csc" ):

StringTools[SubstituteAll]( %, "#i", "I" ):
StringTools[SubstituteAll]( %, "pi", "Pi" ):

parse(%): convert(%, string):
parse(%);
combine(%, exp);
end proc;



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.