Maple displays a defined procedure (yours or Maple's)as output when you enter definition or when you execute eval(). It should be noticed that in either case, Maple uses its own well defined indention scheme, regardless of what indention scheme you used or didn't use when you input the procedure.
Now if you want to edit the procedure, and your only copy is gotten by copying Maple's output to an input line, you will have to deal with Maple's hidden indention characters at the beginning of each line. I have been unable to find any Help material on this, and, in particular, I have not been able to find any way to edit (delete or input) these characters directly. However, they are all invisibly located in the blank space, which is visible, at the start of each indented line. The code seems to be of the form "indent a fixed number of spaces more than the previous line". These fixed numbers are one of three values, a positive number (approx. 3), 0, or a negative number (approx. -3).
As most of you have probably experienced, even Maple 10.4 in standard 2D Maple input has some strange editing behavior. Most of it is of the variety of "What you see is Not what you get". There are two basic kinds of things that can happen: (a)You get strange errors that seem impossible from the code that you can see, such as "missing operation" or "object used as name" or even "non-matching delimiters"; and (2) Your editing action happens much further away or much more extensively than your cursor position or highlighting would indicate.
This apparently happens because Maple is creating a parsing structure on the fly behind what you are editing and not visible to you. When some incomprehensible errors happen or Maple seemingly does not want to allow you to edit what you see is wrong, sometimes the only remedy is to retype whole blocks of code (possibly creating other errors in the process requiring the same cure, etc., etc.). Till Maple can supply us with a structural viewer that would allow us to easily find and correct such problems, I want to pass along some tips I have learned in my frustration.
I kept seeing in the help pages for linalg that it is being superseded by LinearAlgebra, so I have tried to work with LinearAlgebra. However, it turns out that LinearAlgebra is very clumsy and annoying for symbolic computations.
LinearAlgebra was clearly meant to be a numerical calculation package. Unfortunately, the desiderata for numerical calculations are not the same as for symbolic calculations.
The main feature of LinearAlgebra which causes this clumsiness is the requirement that all elements of a Matrix be defined. To do symbolic calculations this means assigning a symbol to use with an index for the undefined elements of the Matrix. The name of this symbol has to be different from that of the Matrix itself, and the indexed symbol is not an array or a table or a Matrix. Already then you have two names for essentially the same thing. ==> First Problem. Now, lets say you do some calculations with these Matrices and end up with expressions that that contain the indexed symbolic names. To assign other values to these indexed symbolic names in the resulting expressions, you have to assign the indexed symbolic names new values and you cannot use matrix operations for that since these indexed symbolic names are not arrays or Matrices or even tables. ==> Second Problem. Now if you want to unassign the symbolic names again or assign new values and have these values show up in the original Matrices, you have to reassign the symbolic names and reassign the values in the original Matrices. (Matrix elements cannot be unassigned.) In other words, do the job twice. ==> Third Problem.
There is a general problem which arises when one uses assume() that can be quite confusing. I seems that once an x~ is passed on by assigning a data structure containing it to another name, it becomes an entity on its own, a sort of vintage x~, with no connection back to the original variable on which the assumptions were made. It has no unique name and no way to access it for manipulation or redefinition. The code x:='x' does not affect these vintage x~'s. Even the function addionally() does not affect these vintage x~'s. Thus one can have a whole set of x~'s of different vintage in one's data structures with no way to tell them apart or manipulate them. This has tied some of my codes in knots before I realized what was happening. It would be so much less frustrating if each new vintage received a unique name that could be referenced by the user.
I have seen a number of forum questions concerning showing students the steps in a problem. There seems to be some confusion about how to do this reliabley and easily.
A method I have found useful is seen below:
Maple displays a defined procedure (yours or Maple's)as output when you enter definition or when you execute eval(
As most of you have probably experienced, even Maple 10.4 in standard 2D Maple input has some strange editing behavior. Most of it is of the variety of "What you see is Not what you get". There are two basic kinds of things that can happen: (a)You get strange errors that seem impossible from the code that you can see, such as "missing operation" or "object used as name" or even "non-matching delimiters"; and (2) Your editing action happens much further away or much more extensively than your cursor position or highlighting would indicate.
This apparently happens because Maple is creating a parsing structure on the fly behind what you are editing and not visible to you. When some incomprehensible errors happen or Maple seemingly does not want to allow you to edit what you see is wrong, sometimes the only remedy is to retype whole blocks of code (possibly creating other errors in the process requiring the same cure, etc., etc.). Till Maple can supply us with a structural viewer that would allow us to easily find and correct such problems, I want to pass along some tips I have learned in my frustration.
Hello,
Im meant to create a program to compute inverse tan - tan(^-1)(x)
to a given accuracy. They gave examples in class of how to do it for
1+1/2+1/3+...
1+1/2+1/4+1/8+...
sin(x)
like to 8 decimal places or whatever.
here's what i got on my screen.
http://kr.cs.ait.ac.th/~radok/math/mat6/calc6.htm
This sort of has an explanation on how to get the taylor series for inverse tan. basically i was gonna try to copy and paste the output for the sin(x) eg. and just swap the taylor series to see if it would work.
ANY HELP WOULD BE APPRECIATED.
OUTPUT:
> sum_ex1:=proc(x)
I have been playing with Maple on and off for 3 months. This summer, now that school is out, I have set about trying to master this environment. My frustration with Maple has subsided a bit only to be replaced with an understanding of its limitations.
I set about building my own package of doing surface and flux integrals as a way of discovering how to manipulate expressions. I think I know why Maple is so tough. I read somewhere on these forums a diatribe on what seemed an esoteric nuance in the difference between the way Mathematica approaches functions vs the way Maple does. Mathematica is essentially a functional programming language wrapped around list structures (ala LISP). In mathematica everything, at the ground level, is a list. Various types get defined for different quantities but they are essentially lists. Maple defines its types internally. I don't know how they are put together (rtables?) Maple has evolved over time so that these types have grown to a huge number that are hard to keep track of. The inability of maple functions to screen their inputs for different data types means that the Maple programmers have to write lots of different functions for the different data types. This is a very old style of programming.
This book entry describes a method,
using text files and preprocessor macros,
to measure the timing and memory usage of Maple procedures.
Attached are the source code and compiled library
for a small Maple package that does the actual measurements.
handtotal:=proc(hand::list)
local total;
global Cardvalues;
total := 0;
total := sum('Cardvalues[hand[k]]', 'k' = 1..nops(hand));
if(is_an_ace(hand)) then (unable to parse)if(total + 10
I've been learning Maple 9.5 for a week now. There are many data types, and they each have their differences in functionality. I came across an article that mentioned that lists and sets make copies of the data for each manipulation, therefore aren't the best choices with that in mind.
My questions is essentially:
What are the subtleties of the different data types in speed and memory etc...? Which seem to work better is which situations? considering that we all want our code to be done now and take up no memeory :>)
thanks
James
This book page describes and compares several methods for sorting lists of names.
It revisits using attributes for rapid sorting,
with attention to their global effect on strings.
It demonstrates the use of the lexorder[n] option to sort
and it illustrates the use of convert/local.
While responding to a question about creating a new type, I suggested that a module could be used as the data-structure. To type check a given expression against the new data-structure, one can use
type( some_expr, '`module`'( 'export1', 'export2' ))
where export1 and export2 are exports of the module. That technique, however, is not robust in that any module with those exports (and possibly others) matches the type. While that may not be a concern, there is a way to uniquely type check a constructed module: give it an export equal to a local value. Here is a demonstration of the technique:
Currently saving the worksheet and removing the output can only
be done via the menu. It would be nice if these tasks could be performed
using commands. If this would possible, one could for example start the worksheet
with
restart;removeoutput;saveworksheet;
and never loose any programming after rerunning the script.
Furhtermore, a hard break statement stopping completely the excution of
the worksheet would be nice. If the current break break statement is executed, the result is to exit from the innermost repetition (for/while/do) statement within which it occurs. After exit, execution proceeds, with the first statement following the repetition statement.