17565 Reputation

29 Badges

14 years, 183 days

On google groups. (comp.soft-sys.math.maple and sci.math.symbolic)

On stackoverflow.


MaplePrimes Activity

These are answers submitted by acer

You're second to last line does t:=evalf(t[1]) but before that `t` is not something which can be indexed. So that line makes no sense.

And so what you're passing to fsolve is not a sensible expression.

Your Question is marked as Maple 2019, so I'll use that.

If I load the linkedlist module from a .mla Library Archive (including the one that resides within a workbook), or if I first savelib it to a .mla, then my output from your examples shows the long form linkedlist:-nil provided that I have the typesetting level set to standard.

If I toggle that level back to extended (ie. its original default for new users) then the output shows the short form nil only.

If I simply read the .mpl source then my output shows the short form nil regardless of typesetting level.

Perhaps this is the source of your problem.

nb. You can set the level as a GUI preference -- automatic across sessions. Or you can programmatically set it for an opened worksheet by issuing the command,
in its own execution group.

nb. The level extended is the new default for new users. It behaves better than it did back when standard was the default. IMHO it may be generally best to use the default, unless there is some special cause.

I believe that it is not.

For a float Matrix the CharacteristicPolynomial command computes an unexpanded product, using the computed eigenvalues. (So it's mostly "ok" to compute the roots of that, but unnecessary since the Eigenvalues command computes that directly. It would be bad to expand the characteristic polynomial and then do numeric root-finding, because that is numerically less stable.)

What is also not a great idea is to compute the eigenvalues by doing numeric root-finding on the determinant of the characteristic matrix (which is what the OP's code does at one point), and which is what I suspect Carl is describing as unwise.

Additionally, if one happens to want singular values then utilize the SingularValues command. That can provide a numerically robust approach to PCA.

I'm not completely sure what form of answer you're looking for. Here's my guess as to what you may be after, given a polynomial system.



`Maple 2019.1, X86 64 LINUX, May 21 2019, Build ID 1399874`

eqns := {-1+theta[3, 6] = 0, 1-theta[3, 6] = 0, alpha+rho-theta[2, 2]+theta[3, 3] = 0, -theta[3, 6]^2+1 = 0, theta[2, 2]*theta[3, 6]-alpha = 0, theta[2, 2]*theta[3, 6]^2-alpha = 0, -2*theta[3, 3]*theta[3, 6]-2*rho = 0, theta[1, 2]*theta[2, 1]*theta[3, 6]^2+1 = 0, -alpha^2+rho^2+theta[2, 2]^2-theta[3, 3]^2 = 0, -theta[2, 2]^2*theta[3, 6]+2*theta[2, 2]*theta[3, 3]*theta[3, 6]+alpha^2+2*alpha*rho = 0, -theta[1, 3]*theta[2, 2]^2*theta[3, 0]+theta[1, 3]*theta[2, 2]*theta[3, 0]*theta[3, 3]-alpha^2*beta-alpha*beta*rho = 0, -theta[1, 2]*theta[2, 1]*theta[2, 2]*theta[3, 6]+2*theta[1, 2]*theta[2, 1]*theta[3, 3]*theta[3, 6]-alpha-2*rho = 0, -theta[1, 2]*theta[2, 1]*theta[2, 2]*theta[3, 3]+theta[1, 2]*theta[2, 1]*theta[3, 3]^2+theta[1, 3]*theta[2, 2]*theta[3, 0]*theta[3, 6]+alpha*beta+alpha*rho+rho^2 = 0, -alpha^2*rho-alpha*rho^2+theta[1, 2]*theta[2, 1]*theta[2, 2]-theta[1, 2]*theta[2, 1]*theta[3, 3]+theta[1, 3]*theta[3, 0]*theta[3, 6]-theta[2, 2]^2*theta[3, 3]+theta[2, 2]*theta[3, 3]^2+alpha+beta+rho = 0}:

fc := {theta[1, 2], theta[1, 3], theta[2, 1], theta[2, 2],
       theta[3, 0], theta[3, 3], theta[3, 6]};

{theta[1, 2], theta[1, 3], theta[2, 1], theta[2, 2], theta[3, 0], theta[3, 3], theta[3, 6]}

PS1 := SolveTools:-PolynomialSystem(eqns, fc, backsubstitute=false, engine=triade);

[[theta[3, 0]*theta[1, 3]+beta, theta[1, 2]*theta[2, 1]+1, theta[3, 3]+rho, theta[2, 2]-alpha, theta[3, 6]-1], {theta[1, 2] <> 0, theta[3, 0] <> 0}]


[theta[3, 0]*theta[1, 3]+beta = 0, theta[1, 2]*theta[2, 1]+1 = 0, theta[3, 3]+rho = 0, theta[2, 2]-alpha = 0, theta[3, 6]-1 = 0]


[theta[3, 0]*theta[1, 3] = beta, theta[1, 2]*theta[2, 1] = 1, theta[3, 3] = rho, theta[2, 2] = -alpha, theta[3, 6] = -1]



Here's my original Answer, which accomplished a similar thing in a rough, manual sort of way,

The commands in DocumentTools, such as DocumentTools:-GetProperty, are for use in query properties of Embedded Components. Those are quite different and separate from Maplets.

You cannot use DocumentTools:-GetProperty to check whether a Maplets:-Elements:-CheckBox is toggled. Those do not interact, since Embedded Components and Maplets provide quite separate functionality.

If you really do plan on using Maplets, then in order to learn to use Checkbox from the Maplets:-Elements package you might start by studying basic examples, eg. online here, here, and here. Or you can read the corresponding Help pages within your Maple itself.

Or are you trying to use Embedded Components, rather than Maplets?



`Maple 2019.1, X86 64 LINUX, May 21 2019, Build ID 1399874`









[edit] I see that others have responded since I last refreshed this webpage in my browser (which I did only after I posted my answer). So, taking the OP's hint, I can reduce the number of steps in my original answer, by avoiding my previous separation of numerator and denominator,


                            /    1   \
                         sin|y + - Pi|
                            \    6   /

                            /    1   \
                         sin|y + - Pi|
                            \    6   /

note: Simplifying the intermediate result immediately prior to these latter calls to evalc may illustrate that I'm using evalc primarily as a convenient shorthand for conversion to trig (and avoiding a division by zero), not because I'm trying to concede something about realness of y more generally).

You didn't tell us the aspect ratio (relative lengths displayed of the axes) that you wanted.

So you can try this, with a value for the parameter that suits you,


H:=K->plot3d(K*sech(1/2*sqrt(3/5)*(x - 2*t)),
             x=-10..10, t=-10 .. 10, style=patchnogrid,
             view=[-10..10, -10..10, K*0.0..K*1.0],
             tickmarks = [default, default,
                          Equate((L->[K*L,L][])([0., 0.5, 1.0]))]):





This is simply a one-off of the idea I posted on more generally (but for 3D implicit plots) here.

You have previously installed the Syrup add-on package. It is bundled with a Help database file in the old .hdb format. The message is informing you of that.

You can convert that older format Help database Syrup.hdb to the newer format by following the instructions on the Help page whose topic is HelpTools,Migrate. The message is informing you that details are available on that Help page.

If you're not using the Syrup package's Help pages then you could simply ignore the message. If the message bothers you then you could remove the add-on or follow the instructions to update/migrate its help database file.

It is unclear whether you are asking about selected item or the action code of the Component. It's also unclear what you mean by "preprogrammed".

So I've done both for you, using two examples. If you're trying to ask about the selected item then my first example should make it clear. If you're trying to ask about the action code of the component then you can make it a string containing a procedure call of your choice (as I did in my second example), and you can define that procedure either before or after the insertion.

I've also fixed several mistakes.

I also toggled your Question as being for Maple 2016, since that's the version in which your attachment was last saved. It'd be helpful if you could do that yourself for future Questions.

You might be able to use something like this, for such (simple) ordered piecewise with a single parameter. I don't know whether you need to distinguish that the lower end-point is a strict inequality.


f := t -> piecewise(-1 < t and t <= 0, t+1,
                    0 < t and t <= 1/2, 1-t,
                    0 < t and t <= 1, 1-t):

pw := f(t);

pw := piecewise(-1 < t and t <= 0, t+1, 0 < t and t <= 1/2, 1-t, 0 < t and t <= 1, 1-t)

pwrng := PiecewiseTools:-Support(pw);

-1 .. 1


-1, 1

pwlist := convert(pw, list);

[-1 < t and t <= 0, t+1, 0 < t and t <= 1/2, 1-t, 0 < t and t <= 1, 1-t]

pwconds := seq(pwlist[2*(i-1)+1], i=1..nops(pwlist)/2);

-1 < t and t <= 0, 0 < t and t <= 1/2, 0 < t and t <= 1

solve( Or(seq(p, p=pwconds)), t );

RealRange(Open(-1), 1)




Do you want it for all the procedures which are exports, or "package exports", or all exports and local procedures?

By "package exports" I mean those procedures returned by with (see also M:-_pexports() ).

If you want all the procedures which are exports of module M then you could do it like,


If you want only the procedures which are "package exports" of module M then you could do it like,


If you also want the local procedures of module M then you could also process the names in [op(3,eval(M))] which are of type procedure. But for those you msy need :: syntax or :- syntax after toggling kernelopts(opaquemodules).

You could substitute for exact Pi using evalf, in the BCs and range, when calling pdsolve.


pde := diff(u(x,t),t$2)=diff(u(x,t),x$2);

diff(diff(u(x, t), t), t) = diff(diff(u(x, t), x), x)

bc  := u(-Pi,t)=u(Pi,t),D[1](u)(-Pi,t)=D[1](u)(Pi,t);

u(-Pi, t) = u(Pi, t), (D[1](u))(-Pi, t) = (D[1](u))(Pi, t)

f:=x->piecewise(-Pi/2<x and x<Pi/2,1,true,0);

f := proc (x) options operator, arrow; piecewise(-(1/2)*Pi < x and x < (1/2)*Pi, 1, true, 0) end proc

ic  := u(x,0)=f(x),D[2](u)(x,0)=0;

ic := u(x, 0) = piecewise(-(1/2)*Pi < x and x < (1/2)*Pi, 1, 0), (D[2](u))(x, 0) = 0

sol:=pdsolve(pde, {eval(bc,Pi=evalf[15](Pi)),ic}, u(x,t),
             numeric, time=t,





Did I do this right? (Even if ok, I expect someone will do it more cleverly.)


eq := a(n) = 2*(a(n)+Sum(a(i),i=1..n-1))^2/(2*(a(n)+Sum(a(i),i=1..n-1))-1):

func := solve(eq, a(n)):

-2*Sum(a(i),i = 1 .. n-1)^2/(1+2*Sum(a(i),i = 1 .. n-1))

G := subs(__dummy=subs([Sum=add, a=G],func),
    option remember, system;
    local i;
    if n=1 then return 1; end if;
  end proc):


G := proc(n::posint)
local i;
   1   if n = 1 then
   2       return 1
       end if;
   3   -2*add(G(i),i = 1 .. n-1)^2/(1+2*add(G(i),i = 1 .. n-1))
end proc





[edited] Using rsolve, (for S(n), an idea which Carl conceived and posted before I did).





proc (n) options operator, arrow; 1/(-1+2*n)-1/(-3+2*n) end proc





The call_external is a Maple mechanism which calls a function in an external dynamic library of compiled functions. For example such dynamic libraries have filename extension .dll on MS-Windows and .so on Linux.

Like much of the Maple kernel itself such functions are compiled (and stored in external dynamic libraries) for execution speed, or because they come from 3rd party sources as code in a language other than Maple.

In general it is not possible to view the source of such functions, unless they were compiled with debugging information. (That's an OS thing, rather than a Maple thing.)

Few if any of the stock external libraries shipped with Maple were compiled with debugging information -- and if they were then you'd still need an external debugger that could run the whole process, not just Maple's user-facing debugger.

The Maple command showstat is for displaying source of procedures in the Maple language. That has nothing to do with compiled functions in dynamic libraries.

First 10 11 12 13 14 15 16 Last Page 12 of 204