Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 358 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

The vast, vast majority (I'd guess more than 99%) of Maple procedures are not mentioned in the help. That doesn't mean that they are in the kernel. It usually means that they were not intended for use by end users. The procedure in question, TRDpolynomial_ring, is a local of module RegularChains. That means that it was only intended to be called from other code within the module. To see its code:

kernelopts(opaquemodules= false):  #Allow access to module locals.
showstat(RegularChains:-TRDpolynomial_ring);

restart:
alias(X= RootOf(z^8+z^6+z^5+z^3+1)):
int_to_poly:= proc(n::nonnegint, x::{name, specfunc(anything, RootOf)})
local k, B2:= convert(n, base, 2);
     add(B2[k]*x^(k-1), k= 1..nops(B2))
end proc:

A:= <140, 155, 162, 64;
     218, 12,  245, 50;
     36,  251, 34, 253;
     171, 251, 184, 37>:

B:= int_to_poly~(A, X);
 

For most uses of the new Matrix B, you'll need to append mod 2 to the command. For example, to compute the determinant,

Det(B) mod 2;

You can let plot choose the number of points and their positions. This is called adaptive plotting. For example, using the "more complex" oscillator that you gave in a Reply---the one that required numpoints= 100*tmax---do

U:= eval(u[1](t), res):
V:= eval(v[1](t), res):
plot([U(t), V(t), t= 0..tmax]);

You'll get essentially the same plot as you got with odeplot using numpoints= 100*tmax. The number of points chosen by plot is 6293. The problem with this command is that it takes a little more than an hour to produce the plot. Unlike odeplot, the t-values used by plot aren't evenly spaced.

plot([seq([i, sin(Pi/12*(i-1))], i= 1..12)], style= point, symbol= diamond, symbolsize= 9);

You need a percent sign with the T, like this:

a.a^%T;

A plus sign with no percent sign also works:

a.a^+;

You asked:

Does [Length of output exceeds limit of 1000000] mean that the function couldn't be solved and I have to modify the mathematical model?

No, it doesn't mean that. It means that the solution has been found, but is just too long to display.

If the results are just too long to be displayed, how can I see the results?

You should seriously reconsider your desire to see the results. They could be hundreds of pages long. I have seen one over 4000 pages long. Once you start the display, there is no way to stop it other than by killing the Maple process. The stop button does nothing in this case.

And, practically, what would you do with such a solution?

You should use definite integrals, not indefinite integrals that you then evaluate between limits of integration.

Examples:

int(int(r^2*cos(theta), theta= Pi/4..Pi/3), r= 15..18);

or

int(r^2*cos(theta), [theta= Pi/4..Pi/3, r= 15..18]);

The revelant commands are DEtools[DEplot] or dsolve followed by plots:-odeplot. If you have parameters, I think the dsolve odeplot route would be easiest. If you want more help, you'll need to post your system of ODEs, their initial conditions, and your desired values of the parameters.

This is a common operation---not at all a "strange question."

The ApproximateInt command, if given exact symbolic input, attempts to compute the exact value of the integral approximation. What you want is a floating-point approximation. To get such, you simply need to include a decimal point in the function or in the interval of integration:

f:= x^2/(sin(x)+x+1.;
Student:-Calculus1:-ApproximateInt(f, x= 1. .. 2., method= simpson, partition= 20);

This'll produce the decimal answer very quickly. Only one the decimal points above is needed.

To make plots go to a separate window, use the command

plotsetup(window);

These plots will look normal even if run from the command-line interface (that which you're calling maple-terminal).

One potential problem with this is that every plot goes to a new window, and I know of no programmatic way to close the windows. So, if you make 1000 plots, you'll have a 1000 open windows.

SimpleStack is an object-oriented module-based implementation; stack is a much older table-based implementation. SimpleStack has all the functionality of stack and some additional functionality. SimpleStack uses a more-familiar programming paradigm. I use SimpleStack exclusively.

Recursive procedures are very easy in Maple:

catalan:= proc(n::nonnegint)
option remember;
local k;
     add(thisproc(k)*thisproc(n-1-k), k= 0..n-1)
end proc:

#Put initial value in remember table.
catalan(0):= 1:

catalan(9);

     4862

By preloading the initial value into the remember table, we avoid the need to check for initial values in the procedure itself. This is more efficient.

A proper Maple function doesn't "print" a value; it returns a value. It's left up to the user whether or not to print the value.

 

`&ll`:= (a,b)-> 1/(1/a+1/b):
3 &ll 7;

In Maple, a^(1/3) is not real for a < 0. The real cube root is accessed by surd(a,3). So, change the plot command to

plot3d(surd(1-x^3-y^3, 3), x= -10..10, y= -10..10);

One way is to use the sequencing operator $:

1/2^k $ k= 4..8;

Although this operator is less efficient than the more common seq, it has the benefit of being capable of abstraction, which seq lacks:

MySeq:= 1/2^k $ k= a..b;


eval(MySeq, [a= 4, b= 8]);

Unlike seq, the k in the above expression should be either unassigned or placed in unevaluation quotes:

1/2^'k' $ 'k'= a..b;

First 239 240 241 242 243 244 245 Last Page 241 of 395