acer

32672 Reputation

29 Badges

20 years, 70 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

I'm not quite sure exactly what you are after. But maybe this will be enough to inspire you. ------- cut here, file wrapmaple ---------- #!/bin/bash argc="$#" argv="$*" export argc argv maple $* ------- cut here, eof file wrapmaple ------- And so now, after `chmod u+x wrapmaple`, %./wrapmaple -s maple> getenv(argv); "-s" maple> getenv(argc); "1" Ok, so argv isn't an array, and it's not **argv. And you'd have to do a little more to get argv[0] (which I assume you want to be just `maple`). But maybe it'll help some. acer
It's easy enough to write a procedure to do this sort of thing. For example, f := proc(s,n) use StringTools in CharacterMap( cat($"a".."z"), Rotate(cat($"a".."z"),26-n), s ); end use; end proc: f("this is a test",1); f("this is a test",-3); Of course, it is inefficient to Rotate the lowercase alphabet many times. You could also create all such rotations (as well as the alphabet itself), store them, and re-use them. You could make a Array of such rotations global or local to your procedure, as you wished. acer
Try the help-pages ?solve,details and ?fsolve,details . For this example, fsolve is only going to produce one root at a time. There's nothing wrong with that, and it's not unreasonable behaviour for a root-finder when no range is supplied. As for solve, well, you asked it to return a representation of all the roots, by setting an environment veriable to control that. It may be that the result expressed by solve is redundant, sure. Duplication in the returned result could be a bug to fix. But the form of the result, and how that expresses the full set of all solutions, can make sense. I read today that the equivalent result from some TI calculator is something like @n1*Pi . I don't see why that syntax is so much less obscure to the new user. acer
Allowing private messages is an editable setting here. To change it, click on "my account" at the top of the left navigation margin. On the page that then appears, click on the "edit" tab. If you then scroll down, you could see a check-box titled, "Private message settings". acer
You can use plots[display] to place more than one plot into the same "diagram". Also, there's no need to assign to q, l, x1, x2, and x3. You can simply use subs and eval to get that effect, without having to unassign them for each plot. restart: Mg_1:=x->(8/25*q*(5*l-x)^2-9/5*q*l*(5*l-x)): Mg_2:=x->(-3*q*l^2+q*l*(4*l-x)): Mg_3:=x->(-q*l*(3*l-x)): s1:={q=1,l=10}:ss1:=eval({x1=5*l},s1): s2:={q=1,l=10}:ss2:=eval({x2=4*l},s2): s3:={q=1,l=10}:ss3:=eval({x3=3*l},s3): p1:=plot(subs(s1,eval(Mg_1)),0..eval(x1,ss1)): p2:=plot(subs(s2,eval(Mg_2)),0..eval(x2,ss2)): p3:=plot(subs(s3,eval(Mg_3)),0..eval(x3,ss3)): plots[display]([p1,p2,p3]); # Maybe you'll have many of them, and wish # to automate their creation. seqplots:=seq( plot(subs(s||i,eval(Mg_||i)),0..eval(x||i,ss||i)), i=1..3 ): plots[display]([seqplots]); I wouldn't be surprised if some of the eval() calls above could be optimized out of the code. acer
You asked Maple to solve the equality, while you asked Mma about the inequality. As I previously mentioned, Maple doesn't produce a result for the inequality that you had previously supplied (whether using the extra inequalities x>-infinity,x
I suspect that I got confused (not the first time) about assuming. I believe that `int`, `simplify`, `dsolve`, `is`, and things-which-primarily-use-`is` can make good use of the assuming facility. But `solve` may not properly be in that collection, which is a pity. It's a documentation bug, that there is no clear indication about precisely what supports `assume` and `assuming`. So, instead of using `assuming`, one could try this, solve({x^2+y^2 = 1,x>-infinity,x-infinity,y-infinity,x
What does this mean? Reduce[x^2+y^2<1,{x,y}] which returns -1 I guess that that was an instance of chopped output. Do you realize that, in the absence of "assuming" qualification, by default Maple's `solve` treats the variables as if they might be complex-valued? And do you know that, also by default, Mma's Reduce treats the variables as if their were from the purely real domain? So, I suppose that you could compare these two, Mma% Reduce[x^2+y^2<1,{x,y}, Complexes] Maple> solve(x^2+y^2<1,{x,y}); or these two, Mma% Reduce[x^2+y^2<1,{x,y}] Maple> solve(x^2+y^2<1,{x,y}) assuming x::real, y::real; Maple's solve is not very strong at inequalities, however. It's been getting stronger, I believe, but it's functionality is not yet mature. Can anyone explain this example to me, in Maple 11? > solve(x^2+y^2 = -1, {x, y}) assuming x::real, y::real; {y = y, x = (-y^2-1)^(1/2)}, {y = y, x = -(-y^2-1)^(1/2)} acer
Within the procedure, right after where you have it call NLPSolve, could you simply assign the return value and/or arguments of the NLPSolve call into an Array declared as a global? acer
What makes you think that this has a closed form solution? That is, what makes you think that the solution can be written down as an explicit formula? Even when no formulaic, closed form solution might be forthcoming, Maple can still proceed with some sorts of computations with the RootOf, while keeping it as an exact representation. Don't you consider that useful? acer
Could you upload a small example worksheet that illustrates this? Are you saying that some of the (usually correctly displayed) content shows as question marks, or that the question marks appear where nothing was before then? acer
Have a look at this, showstat(`convert/binary/integer`); You may notice that it uses 32 to take integer remainders. So this next table below could also be useful, in understanding that is going on in that procedure. interface(rtablesize=50); `convert/binary/table`; It that procedure seems confusing, then read the help for routine irem(). You could also try this, trace(`convert/binary/integer`); convert(32^4+32^2+32,binary); You could try writing a procedure that is similar, which takes integer remainders by division by 16, say, or divide by 2 (in the latter case of which case a table isn't really needed). acer
What version of Maple, and on what platform, does that not produce the result like one gets from matrix(2,2,[1,2,3,-5]) ? It works for me, on Linux with Maple 9.5.1, 10.02, or 11. acer
Is this similar to what you are after? eqns:= {a(s,y,z,t)+2*b(s,y,z,t)=0,3*a(s,y,z,t)-5*b(s,y,z,t)=0}: linalg[genmatrix](eqns,[a(s,y,z,t),b(s,y,z,t)]); If not then you might have to explain what you mean by "the matrix associated to the system." acer
The labelled RootOf refers to an unspecified root. So in your case it may be meant to represent either root, rather than a particular root. If you would rather see the solution explicitly in terms of particular roots, then try it after, _EnvExplicit:=true: I would say that the section explaining _EnvExplicit within the help-page ?solve,details is not clear about its behaviour for systems of equations. It's not even adequately clear that the section -- describing behaviour governed by _EnvExplicit -- refers only to the case of a single equation. Also, the label in the solution to your example may seem confusing because it doesn't actually serve to distinguish between sets of unspecified roots -- which is what the help-pages suggest is its purpose. So why it it labelled? Why not just have it return the general unlabelled form in the solution to your problem, to specify "any" root? Why add in a label when the solution is meant to represent any root without qualification? While I'm at it, I don't really see where in that ?solve,details help-page is an explanation of why solve(x^8-3) returns all eight explicit solutions by default. Instead it hints that it might do the opposite, by claiming this: "The solve command returns explicit solutions for low degree polynomial equations (by default, degree less than 4). For higher degree equations, implicit solutions are given in terms of RootOf." acer
First 332 333 334 335 336 337 338 Page 334 of 339