Dave L

Dave Linder

517 Reputation

18 Badges

17 years, 261 days
Maplesoft
Software Architect
Waterloo, Ontario, Canada

 

Dave Linder
Mathematical Software, Maplesoft

MaplePrimes Activity


These are answers submitted by Dave L

If you mean PDF versions of the printed manuals (rather than of the help-pages in the Maple product's own help-system) then check out the Maplesoft Documentation Center.

Purely online version of those manuals, available page-by-page, do not exist as far as I know.

Dave Linder
Mathematical Software, Maplesoft

Dave Linder Mathematical Software, Maplesoft
If you can post a portion of the code, that might give the best chances for useful advice. Dave Linder Mathematical Software, Maplesoft
You should be able to use comparry(), or testfloat(), or verify() for this. The comparray routine might be simplest for you. With it, you can control both the working precision as well as the accuracy tolerance. With testfloat, you could also control the model for comparing complex floats, as well as whether the comparison is relative or absolute. If you don't want to convert your sets to lists, then for handling sets you may be able to use verify (set,float). The comparray routine is pretty straightforward to use, on lists. Here's an example (which I hope is good) using testfloat on sets. Note that verify,float is leveraging testfloat(), and the same options for the test and model can be used. > verify( {59.24,0.2346}, {0.2346,59.25}, 'set'('float(1,digits=4)') ); true > verify( {59.24,0.2346}, {0.2346,59.25}, 'set'('float(1,digits=5)') ); false > verify( {59.24,0.2346}, {0.2346,59.25}, 'set'('float(10,digits=5)') ); true Those calls above use the default comparison, which is to perform a relative test. You can force an absolute comparison with the 'test'=1 option. See ?testfloat for more detail. > verify( {59.24,0.2346}, {0.2346,59.25}, 'set'('float(1,digits=5,test=1)') ); false > verify( {59.24,0.2346}, {0.2346,59.25}, 'set'('float(1,digits=4,test=1)') ); true Dave Linder Mathematical Software, Maplesoft
subs( {seq(cos(i*w)=1/2*1/z^i+1/2*z^i,i=1..10)}, Hw ); If you want another sequence of substitution equations, just put another seq() call in the {}. Dave Linder Mathematical Software, Maplesoft
Entering y=x^2 does not assign x^2 to y. The original post in this thread makes it seem like that is the expectated behaviour, and that to "apply" x^2 to y means to assign x^2 to y. That interpretation is mistaken. Similarly, unapply() does not unassign anything. It really does seem that there is a mistaken belief that "apply" implies "assign". But it is not so. Dave Linder Mathematical Software, Maplesoft
The idea is that these are considered to be some of the most generally important commands in Maple, especially with the new user in mind. One has to start new users off somehow. The question of how best to do that is important. It's an issue whose solutions can always be further developed or adjusted. A vast, flat view of all the commands in Maple would be overwhelming. Describing Maple in an overly thorough computer science way would be too dry for many. Introducing new users to the most important commands is supposed to be a helpful and practical way to get them going well, quickly. It's true that the commands in the list happen to be "top-level". That is Maple jargon mostly used to mean that they are not part of any package and may be called directly, as named. Almost always such top-level commands require documentation. But there is no other sense, apart from general importance, in which the commands in table 4.2 are above other commands. Not everyone will agree on what should go into such a short list. The concept of importance is subjective. Some people would want to see `add` and `op` put into the list, and to see `sum` and `limit` dropped from it. Some people would want to see `proc...end proc` and `->` put in, and to see `normal` dropped. Personally, I'd like to see a table 4.3 on important data structures and their common purposes, eg. `table` for flexible indexing and resizing, `set` for uniquification and unorderedness, `Array` for mutability, `list` as a single container of an immutable ordered sequence, and so on. A more clear indication of the purpose of this list of top commands could be an improvement for consideration. Thanks very much for mentioning it. Dave Linder Mathematical Software, Maplesoft
The number 1 can act like a function call. Look at what happens here: > 1('m'); 1 So that should explain your example when evaluated with Unit=1 . Not that, depending on how you entered your expression, you might have to do it like this, eval(b, {Units:-Unit=1,Unit=1}); But, what if you wanted to strip the units without forcing an evaluation? You could do this sort of substitution instead, > op(subsindets( [b], specfunc(anything,{Unit,Units:-Unit}), 1 )); 1, 4, 9, 16, 25 But now consider this example, a := Unit('m'), 4*Unit('cm'), 9*Unit('ft'), 16*Unit('N')/Unit('cm'); Would you really want this next result, in which the relative proportions of the units are ignored? > eval(a, {Units:-Unit=1,Unit=1}); 1, 4, 9, 16 > op(subsindets( [a], specfunc(anything,{Unit,Units:-Unit}), 1 )); 1, 4, 9, 16 You may instead wish to have Maple first combine the units and convert them to the same system, prior to stripping. Eg, > op(subsindets( [a], has_unit, z->convert(combine(z,units),unit_free) )); 1, 1/25, 3429/1250, 1600 See the help-page ?convert,unit_free . In Maple 11, it has examples along the lines above. Dave Linder Mathematical Software, Maplesoft
Does this work for you? MyModule := module() option package; export p, FS; TypeTools[AddType](FS,proc(t) if t=`a` then true else false end if; end proc); p:=proc(S::MyModule:-FS) local coeff, t; print(1); end proc: end module: with(MyModule); type(a, FS); p(a); p(z); Dave Linder Mathematical Software, Maplesoft
Look at the help-page for rtable_scanblock . Dave Linder Mathematical Software, Maplesoft
Hello, It often helps if you post exactly what you have tried so far, just in case there is some usage issue that might be resolved easily. For example, it might be that your method of looping and excluding previously found solutions could be amended. If the four equations are polynomial in nature then you might try to use the RootFinding[Homotopy] routine, which can be suitable for finding all solutions of such systems. See ?RootFinding,Homotopy Best regards, Dave Linder Team Lead, Mathematical Software, Maplesoft, Inc.
If you wish simply to apply sin to each element, then use map(). If you want the "Matrix sine" in the functional sense, see ?MatrixFunction which contains an example using sin. Dave Linder Team Lead, Mathematical Software, Maplesoft, Inc.
The online help-page for fminsearch shown at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/fminsearch.html describes fminsearch as doing unconstrained Nelder-Mead simplex method optimization. Optimization[Minimize] is a generic local optimization front end, which selects a method according to the supplied problem, ie. linear, nonlinear, univariate, quadratic, etc. One can force Nelder-Mead simplex method optimization in Maple 10 by using the command Optimization[NLPSolve] with the method=nonlinearsimplex option. For more information, see the help-pages, ?Optimization,Methods ?Optimization,NLPSolve Of course, the calling sequence and syntax of the Maple command will not be identical to fminsearch. But both provide options such as for evaluation limits and optimality tolerance. One difference is that fminsearch will only operate at hardware double-precision, I believe, whereas while that is the default for the Maple command mentioned it can also compute in arbitrary precision. An example, > infolevel[Optimization]:=3: > Optimization[NLPSolve](cos(y)*sin(x),method=nonlinearsimplex); NLPSolve: calling NLP solver SolveUnconstrainedNM: using method=nonlinearsimplex SolveUnconstrainedNM: number of problem variables 2 PrintSettings: optimality tolerance set to .3256082241e-11 PrintSettings: evaluation limit set to 72 SolveUnconstrainedNM: trying evalhf mode Warning, limiting number of function evaluations reached E04CCA: number of function evaluations 72 [-0.99999999227034719, [x = 1.57091986321814758, y = 3.14157858029236259]] > Optimization[NLPSolve](cos(y)*sin(x),\ > method=nonlinearsimplex,optimalitytolerance=1e-14,\ > evaluationlimit=1000); NLPSolve: calling NLP solver SolveUnconstrainedNM: using method=nonlinearsimplex SolveUnconstrainedNM: number of problem variables 2 PrintSettings: optimality tolerance set to .1e-13 PrintSettings: evaluation limit set to 1000 SolveUnconstrainedNM: trying evalhf mode E04CCA: number of function evaluations 116 [-0.99999999999999201, [x = 1.57079640004602838, y = 3.14159275644468394]] > Digits := 30: > Optimization[NLPSolve](cos(y)*sin(x),method=nonlinearsimplex,\ > optimalitytolerance=1e-25,evaluationlimit=1000); NLPSolve: calling NLP solver SolveUnconstrainedNM: using method=nonlinearsimplex SolveUnconstrainedNM: number of problem variables 2 PrintSettings: optimality tolerance set to .1e-24 PrintSettings: evaluation limit set to 1000 SolveUnconstrainedNM: trying evalf mode E04CCA: number of function evaluations 186 [-0.999999999999999999999999619343, [x = 1.57079632679423115291737912057, y = 3.14159265358922890957608758057] ] cheers, Dave Linder Team Lead, Mathematical Software, Maplesoft, Inc.
kernelopts(printbytes=false); Dave Linder Team Lead, Mathematical Software, Maplesoft, Inc.
V^2 (volts^2) is not an SI unit, so when using the default system which is SI a quantity with units equivalent to those of V^2 will get simplified to m^4*kg^2/(s^6*A^2). One could get result that by issuing, say, > simplify(a*b); There are several ways to get V^2 to be shown instead. One way, which requires further action by the user, is to use the right-click context menu item, Units -> Replace Unit. In the pop-up box that will appear, just enter V^2 . The above can also be done by issuing, > convert( a*b, 'units', V^2 ); Another way, which should lead to a result having displayed units of V^2 after simplifying the quantity a*b, would be to create and use a new system of units. In the new system, the dimension of the square of electric potential will get simplified to V^2. Let's do that, by creating and using a new system which is a modification of the SI system. Ie, > Units[AddSystem](newSI,Units[GetSystem](SI),V^2): > Units[UseSystem](newSI): > a := 5*Unit(V): > b := 6*Unit(mV): > simplify(a*b); If you load the Units[Standard] package, by issuing, > with(Units[Standard]): then the expression a*b should get its units combined automatically, without requiring the additional call to simplify(). The above should give a result like 3/100*Units:-Unit(V^2) for a*b , prettyprinted according to whichever user-interface you happen to be using. Dave Linder Team Lead, Mathematical Software, Maplesoft, Inc.
1 2 3 Page 2 of 3