roman_pearce

Mr. Roman Pearce

1683 Reputation

19 Badges

19 years, 294 days
CECM/SFU
Research Associate
Abbotsford, British Columbia, Canada

I am a research associate at Simon Fraser University and a member of the Computer Algebra Group at the CECM.

MaplePrimes Activity


These are answers submitted by roman_pearce

This happens because of the way Pi is implemented. It is a Maple name (ie: like a variable in an equation), however evalf knows how to evaluate Pi numerically. One possible justification for this design is that people will want to symbolically manipulate equations containing terms like sin(0.25*Pi*x). If you evaluate Pi automatically then you can't use identities, etc.
Are you using a firewall or software that blocks access to ports ?
The arrows really expect a single expression like x -> x^2 or something. If you want an if-then-else block or a loop you need to use a procedure. WeekEnd := proc(Day) if Day=Sunday then ... end proc;
Converting Maple to another language really only works when the Maple code already "looks like" code that could be written in the other language. If you use Maple-specific features (such as lists, sets, sequences, op, etc) then conversion isn't going to work. If your code is essentially a numeric routine operating on arrays of floating point data then you have a good chance. What does your code do ?
Go to http://maplesoft.com/products/maple/manuals/ and download the manuals. The "Getting Started Guide" is about as basic as it gets. The standard manual has a good introduction. I would avoid all the point-and-click stuff, and skip to the part about entering expressions, solving, and plotting. That should get you up to speed pretty quickly.
> Bootstrap('Quartile', [1, 2, 3, 4, 5], replications=6, statopts=[1]);
 Error, (in Statistics:-Bootstrap) unexpected argument(s): [1]
This is a bug. The other two errors make sense though, since 'Quartile' requires a second argument (an integer) to specify the quartile. That should be caught earlier however, and you should get an error message telling you what is wrong.
There are still apollonius circles in these two cases, so, is there a reason why these cases fail? I think the code simply doesn't handle degenerate cases. Would anyone more familar with the geometry package care to comment ?
Be sure to tell Maple w is a function of x and y. eq1 := diff(w(x,y), x, x) = -a*diff(w(x,y), y, y); eq2 := diff(w(x,y), x, x, x) = (a-2)*diff(w(x,y), x, y, y); dsolve({eq1,eq2}); It won't solve the problem. I think it is underdetermined.
The function you probably want is CurveFitting[PolynomialInterpolation]. There are also other types of interpolation available in the CurveFitting package, see the help page ?CurveFitting.
Can you give an example of what you are doing ?
Maple won't do it automatically, you have to use the evalf command. For example: a := evalf(Pi); a^2; b := 2*a + 3; # no evalf needed since 3 is an integer c := 3*b + sqrt(2); # needs evalf
The title is a text string so only ASCII characters are supported. Pi is in the extended character set (along with alpha, and a few others) however Maple won't display them so you're out of luck.
The eval command completely evaluates the expression, and the quotes correspond to "not evaluating" and expression completely. Your example whattype(''sin(2.0)''); whattype(eval(''sin(2.0)'')); whattype(eval(eval(''sin(2.0)''))); demonstrates this perfectly. One set of quotes corresponds to one eval, and there is an extra eval when you call the whattype procedure (since procedures fully evaluate their arguments). The "levels" in eval are actually something different. They give you parts of a full evaluation. Here is an example to illustrate: a := b; b := c; c := d; d := 1; eval(a,1); # gives b eval(a,2); # gives c eval(a,3); # gives d eval(a,4); # gives 1 eval(a) # gives 1
If you just want to run compiled code, you should try adding option compile to your procedures. Otherwise, use the anames() function to get a list of the assigned names. This will include all the procedures you made, plus some other junk the system uses. At the start of your worksheet do something like: > maple_names := {anames()}: and later > my_procs := {anames()} minus maple_names; This will give you the names of your procedures in a set. You might want to convert it to a list. Then you can use the map command to apply codegen:-fortran to each one.
The way you have stated the problem is not well-defined. It is possible to express a polynomial (as much as possible) as a combination other polynomials using Groebner bases. I can give you code for that if you want. Unfortunately you will have no control over scaling, ie: if you ask for an expression in x+y-1 the method may decide to use x^2*(x+y-1) instead of (x+y-1)^3. Avoiding that problem is another mess altogether.
First 16 17 18 19 Page 18 of 19