acer

32597 Reputation

29 Badges

20 years, 41 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by 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
In my Maple 11, > _EnvAllSolutions:=true: > solve(sin(x)=1,x); 1/2 Pi + 2 Pi _Z1~ From the help-page ?solve,details , - The solve command returns all solutions for polynomial equations. In general for transcendental equations, the solve command returns only one solution, but does not set _SolutionsMayBeLost to true. To force the solve command to return the entire set of solutions for all inverse transcendental functions, set the environment variable _EnvAllSolutions := true. In the solution, Maple may generate variables that take numeric values. Normally such variables are named with the prefix _Z for integer values, _NN for non-negative integer values, and _B for binary values (0 and 1). If other conditions on these values apply, then the conditions will be converted to assumptions and simplified, if possible. If such conditions are sufficient to allow Maple to determine that the variable may only take on a finite number of values, then the full list of solutions can be requested by setting _EnvExplicit := true. acer
How about setting _EnvAllSolutions:=true; and have a read of the ?solve,details help-page. acer
The argument f(y) gets evaluated immediately, when passed to plot(). That is, you're seeing the same error as if you'd issued f(y) at the top level. This is the way Maple works, arguments to a function get evaluated, before the function gets its hands on them. There are several ways to get your example to work, given this characteristic of Maple. I'll show two below. You may wish to delay the evaluation of f, which can be done by using so-called uneval (un-evaluation) quotes or by using the operator calling sequence that plot() accepts. Try, plot( 'f(y)', y=0..2 ); or plot( y->f(y), 0..2 ); note. You shouldn't have to use f at all; your test() function could work, I think. That's a sidebar, about an extra unecessary function call in your example. It isn't the cause of the problem you had. acer
Do you mean an elementwise product? Ie, for Matrices A and B, zip(`*`,A,B); You may also use LinearAlgebra[Zip] for this effect. Note: If A and B are Arrays, then this is what A.B produces. acer
Would it be possible, and less lossy, to first export the plot to (MS-Windows) bitmap format? I guess that this might only be an option on Windows.. acer
My first advice is to use the top menu to do File->New->Worksheet Mode , and then Tools->Options-Display and set Input display to Maple Notation. For a new user trying to understand maple programming and syntax, this would be a better mode for using Maple. F:=(X^5) + 3*(X^2)+1; dFX := diff(F,X); Xo:=-2; eval(F,X=Xo); eval(dFX,X=Xo); for i from 1 to 10 do Xnew := evalf( Xo - eval(F,X=Xo)/eval(dFX,X=Xo) ); Xo := Xnew; end do; I have used expressions above, instead of functions. Georgios' suggestion to look at the functional operators page is good too. You can use expressions, as I did above, or functions (operators) as he shows. What won't work is the mismatch between the two which you originally tried. don't feel bad about it. It's a common initial misunderstanding about Maple. acer
I'm not quite sure what you are after. Is lprint() sufficient, to give your expression back in a format suitable for subsequent maple input? Eg, f := (a^5+b^5)/(a+b): lprint(f); Or, do you have some other examples for which you want to delay any evaluation or simplification at all, prior to printing. Eg, (x+2*x)/7 is the expression say and you wish to prevent the numerator from simplifying to 3*x ? There are a few tricks for that, one of the weakest of which is, f:=`(x+2*x)/7`; parse(f); acer
If you wish to apply some theory yourself then you could first try a web search for Descarte's rules of signs, or the Sturm theorem. In Maple 11, for a univariate polynomial with rational real coefficients the new command RootFinding[Isolate] can bracket the roots within rational intervals. Judging by the Description in its Maple help-page the underlying methods that it uses do not work internally with floating-point numbers, and do not miss roots due to round-off or related issues. You did not mention whether the coefficients are rational or floating-point. If any of the coefficients are floating-point real number approximations then you could use fsolve rather than RootFinding[Isolate] directly. acer
Could you instead use the Matrix-form of Optimization[LSSolve] and provide the restriction (to avoid a subregion whose boundary is described by your "complicated function" of the two parameters) as an additional constraint? acer
You probably wanted your second line to be like this, so that A gets assigned the procedure. A := proc (k) As posted, there was only the start of an equation, like this, A = proc (k) acer
I am guessing now that you are using Document mode, or are entering the commands in 2Dmath input. I think that the 2Dmath input parser might get confused by (A.x+B)[2]. I suggest you do it in a new Worksheet instead. That is, from the menubar, File -> New -> Worksheet Mode. Alternatively, try this slight modification which may be OK in Document Mode. A := Matrix([[-1,0],[1,-2]]); B := Vector([1,-1]); x := Vector([x1(t),x2(t)]); xprime := map(diff,x,t); Q := A.x + B; eqn1 := xprime[1] = Q[1]; eqn2 := xprime[2] = Q[2]; dsolve({eqn1,eqn2,x1(0)=1,x2(0)=0},{x1(t),x2(t)}); Hopefully you will then see this output, {x2(t) = 0, x1(t) = 1} which I hope illustrates the unfortunate trivial solution. I suggest treble-checking that the entries of A and B are correct. ps. For those who enjoy such things, compare this in Document Mode vs Worksheet Mode, in Maple 11, M := Matrix([a]); N := Matrix([b]); (M.N)[1,1]; (M.N+N)[1, 1]; acer
The X and Y and just dummy names for the first and second component of the Vector x. You could just as easily call then x1 and x2. For example A := Matrix([[-1,0],[1,-2]]); B := Vector([1,-1]); x := Vector([x1(t),x2(t)]); xprime := map(diff,x,t); eqn1 := xprime[1]=(A.x+B)[1]; eqn2 := xprime[2]=(A.x+B)[2]; dsolve({eqn1,eqn2,x1(0)=1,x2(0)=0},{x1(t),x2(t)}); Look at how, in your own attempt, you mixed up Matrix equations and the scalar diff(x(t),t) since you did not define x as a matrix or vector. Look instead at how in my example the x and xprime are Vectors. So, I set everything up as a Matrix or Vector, that is, the A, the B, the x(t), and the dx(t)/dt . Then I pull out two equations, to form a system of differential equations. The first equation is take from the top row of all those Matrix and Vector objects, and the second equation is taken from the bottom row of them. Study that. Then I call dsolve, with the whole system. The reason that it is uninteresting is that the only solution, for the data you gave, is the trivial solution of {x1(t) = 1, x2(t) = 0}. That solution is the same, for all t, which is dull. For other choices of A, more interesting solutions which actually depend on t might arise. acer
Are you sure you got the question down correctly? I see that the sign of A[2,2] has changed, since your first attempt to post the question. A := Matrix([[-1,0],[1,-2]]); B := Vector([1,-1]); x := Vector([X(t),Y(t)]); xprime := map(diff,x,t); eqn1 := xprime[1]=(A.x+B)[1]; eqn2 := xprime[2]=(A.x+B)[2]; dsolve({eqn1,eqn2,X(0)=1,Y(0)=0},{X(t),Y(t)}); Are you sure that A wasn't something more interesting, like say Matrix([[-1,0],[-1,-2]]) ? acer
interface(labelling=false): See also, ?interface acer
First 332 333 334 335 336 337 338 Page 334 of 338