526 Reputation

7 Badges

18 years, 271 days

MaplePrimes Activity

These are answers submitted by Schivnorr

fd := fopen( your output file, WRITE): p1 := plot3d expression:&; fprintf( fd, convert( p1, string ) ); fclose(fd);
My bad. In testing output, I looked at the wrong file. The line I wrote as fprintf(fd, seq( "%a\t", k=1..54 ), seq( Par_M[t,k], k=1..54 ) ): should have been fprintf(fd, cat( "", seq( "%a\t", k=1..54 ), "") , seq( Par_M[t,k], k=1..54 ) ):
Don't type out those long sequences yourself. Let seq() or a similar command build the sequences for you: fd := fopen(writefile, 'WRITE', 'TEXT'): for t from 1 to nops(files) do fprintf(fd, seq( "%a\t", k=1..54 ), seq( Par_M[t,k], k=1..54 ) ): od; Also, remember that Excel can read/load/manipulate CSV (comma-separated values) files, so you can separate your %a's with commas instead of tab characters, if you so wanted. --Schivnorr
What do you mean by "save all the variables in the current workspace?" Maple saves all assigned variables in memory. Are you looking to preserve Maple's memory so that those variables will already be defined and loaded after you close and then re-open Maple? The only way I know how to do that is to play with your .mapleinit file so that the variables are re-assigned when Maple is loaded; however, doing that is really not very different than saving the current worksheet, then re-executing the worksheet the next time you load it. If you have multiple commands on the same line, such as: > statement_x; statement_y; then, you can separate the execution of the two statements by a simple cut and paste; cut statement_y; and place it on a new line (command prompt) so that it can be run on its own. If you just want the statement_x; and statement_y; to appear vertically instead of horizontally, use shift+enter to place a line break on the command line. It sounds like you should try to execute lines/commands one at a time (on separate lines or command prompts) so that you can monitor the output step-by-step, instead of looking for a way to suspend output in the middle of an execution sequence. --Schivnorr
they're still working out bugs in Matlab's symbolic toolbox. The first (and, thusfar, only) time I used Matlab's symbolic toolbox was about a year or so ago, using Matlab 2006a (if I recall correctly) to help my friend learn how to use the symbolic toolbox and perform z-transforms. I noticed that Matlab would often return incorrect z-transforms. I don't know if this error has been documented or fixed, but I do believe it goes to show that there are still kinks to be worked out.
I don't use Maple TA, but it would seem to me that if you want to be able to use the student's answer to one part of a question in the grading of future parts of the same question, you just need to put it in the grading code. Something along the lines of: if studentanswer2 = correctanswer2 then all is well elif studentanswer2 = <expression manipulating studentanswer1 into what the student should get if they are following the correct methodology> then minor deduction else berate student fi; If, on the other hand, you are looking to take the student's answer to one part and use that to determine what is displayed in the next part, I would assume that there is a way to set a component to take the student's answer and calculate what to display for the next part.
animatecurve( tSpline ); This produces a smoother animation. Plus, if you read the help files, you will see all sorts of extra options you can add to the command. --Schivnorr
What version of Maple are you using? In Maple10, I can type in exactlywhat you have: huur:= t-> 400*(1.01)^ceil(t); plot( huur(t), t=0..50, discont=true ); and the function plots correctly. huur(t) also plots correctly if ceil(t) is changed to floor(t). Surprisingly enough, however, when huur(t) is plotted (with either ceil(t) or floor(t) in its definition) by the following command: plot( huur, 0..50, dicont=true ); There are some some "zig-zags" where Maple tries to connect discontinuous points. Hopefully, this does not happen in Maple 11. --Schivnorr
Your first densityplot command was correct--this is how Maple handles plotting a function. In the second command, Maple (likely) tried to execute mandelbrot(x,y) because of how the plotting functions pass values to functions. For a nice explanation of why your first and third commands are correct, see Joel's comment here. --Schivnorr
You're running into a very common problem. Division and calculating square roots (which sometimes uses division) with very small floating point numbers can cause computers to return very incorrect answers. Some ways around this problem include changing the equation/algorithm to use more numerically stable methods to calculate the same value. For more information on this, I'd suggest searching around on Google/Wikipedia. If you want Maple to be more accurate in its floating point arithmetic, increase the Digits or use evalf with a large number of digits. For example: g:= x-> (sqrt(x^2+9)-3)/x^2; evalf[50](g(1/100000)); evalf[50](g(0.00001)); Digits:=50; g(1/100000); g(0.00001); --Schivnorr
It's been my experience that the unapply() command has a misleading name. Simply read the help file and you will see that it's not exactly "unapplying" or "removing an application of" anything, per se. The line name := unapply( expr, var ); does exactly the same thing as name := var -> expr;
Just yesterday, we were trying to get Maple to maximize and minimize simple functions when, to our surprise, the maximize() and minimize() command could not handle simple quartic polynomials. Try it for yourself: for i to 20 do maximize( randpoly(x, degree=4), x=-5..5); od; Thank you, Alec, for sharing the Optimization:-Maximize and :-Minimize commands! Those work wonderfully.
It sounds like the easiest and most straightforward solution for your problem would be to use sprintf() or cat(). e.g. myproc:=proc(x,y) return cat(x,symbol,y); end proc: myproc2:=proc(x,y) return sprintf("%a symbol %a",x,y); end proc: --Schivnorr
1 2 Page 2 of 2