Date: Apr 20, 2013 2:14 PM
Author: Axel Vogt
Subject: convert from Derive to Maple

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;