Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Axel Vogt Posts: 1,068 Registered: 5/5/07
convert from Derive to Maple
Posted: Apr 20, 2013 2:14 PM

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;

Date Subject Author
4/20/13 Axel Vogt
4/20/13 Axel Vogt