Carl Love

Carl Love

28095 Reputation

25 Badges

13 years, 101 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

The expression (1-exp-(x-2))^2 does not make sense. You probably mean

(1-exp(-(x-2)))^2.

The equation that you pass to dsolve does not use Ep.

Did you mean phi(o) = 0 as an initial condition? I think that that should be phi(0) = 0.

You define a constant E, but you don't use it.

You never defined eq.

You mistyped with(DEtools) as xith(DEtools); however, this won't make any difference in your case because you are not using any command from DEtools.

The command restart; should appear on a line by itself.

Another way is to use simplify with side relations:

restart:
g:= y-> 80*y^8 + 68*y^6 + 12*y^4 - 4*y^2 - 1:
p:= unapply(randpoly(y), y):
h:= unapply(expand(p(y)*g(y)), y):
simplify(h(y), {g(y)=0});
                                  0

 

You do what you want by declaring (with alias) y* to be a RootOf(g(y), y):

g:= y-> 80*y^8 + 68*y^6 + 12*y^4 - 4*y^2 - 1:
alias(Y= RootOf(g(y), y)):

Now take a random p(y) and expand p(y)*g(y):

p:= unapply(randpoly(y), y):
h:= unapply(expand(p(y)*g(y)), y);

Now ordinary evaluation is not smart smart enough to know that h(Y) = 0:

h(Y);

But evaluation with evala is smart enough to do it

evala(h(Y));

                                                    0

See ?evala

I think that the only difference between the "versions" of Maple is the price. I am sure that all of those implement the algorithm via the IntegerRelations:-PSLQ command.

Your L1 is a (one-dimensional) Array of lists, each list being a pair of numbers. The same for L2. So [L1,L2] is a list of Arrays of lists. Apparently, that's too much mixing of types for plot to understand. You need to either convert everything to listlist form, or make L1 and L2 into two-dimensional Arrays (or Matrices). To do the former,

plot(map(convert, [L1,L2], listlist));

To do the latter, don't use zip to create L1 and L2. Rather, use Matrix constructors. The following assumes that groups is an Array:

L1:= < groups^%T | waitArray[..,1] >:   L2:= < groups^%T | waitArray[..,2] >:

If groups is a column vector, then omit the ^%T. If groups is a list, then

L1:= < < groups[] > | waitArray[..,1] >:  L2:= < < groups[] > | waitArray[..,2] >:

The action of the angle bracket operators is controlled by the very simple procedures `<,>` and `<|>`. In this case only the former matters. Look at showstat(`<,>`). Since lists are not scalars, and since there is more than one argument, the code branches to the line

Matrix([[args]], scan= columns);

When the left side of an assignment can only be referenced by its membership in a container, you need to use the assign command rather than the assignment operator :=. So, change your last section of code to

for i from 1 to Dimension(Q) do
     for j from 2 to nops(Q[i]) do
          assign(Q[i][j], Q[i][1])
     end do
end do:

I also changed nops(Q) to nops(Q[i]). The former makes no sense whatsoever.

You can use unassign:

unassign('a1', 'a2', 'a3', 'a4');

Note that the quotes are required.

To do it more systematically,

unassign(map(evaln, '[a||(1..4)]')[]);

The command to read .m files is simply read:

read "MyFile.m";

If you want to know the names of the new procedures defined from the file, you could do this:

before:= {anames(procedure)}:
read "MyFile.m":
newprocs:= {anames(procedure)} minus before;

The coefficient of x^k is given by

C:= (n,k)-> binomial(n,k)*2^k:

For fixed n, C(n,k) is a unimodal function of k for 0 <= k <= n. We want n such that the maximum on this range is at k=8.

fsolve({eval(diff(C(n,k),k), k=8)}, n= 8..infinity);

Since we need an integer solution, it's either n=11 or n=12, or possibly both.

seq(C(11,k), k= 7..9);

seq(C(12,k), k= 7..9);

So the answer is n = 12.

 

1. Option discont:

To correctly plot a function with discontinuities, use option discont in the plot command:

plot(tan(x), discont);

To set this permanently, include the following line in your initialization file:

local plot:= proc({discont:= true}) :-plot(args, ':-discont'= discont) end proc:

 

2. Unevaluation quotes:

To prevent the evaluation of functions, enclose the function name in single quotes, like

y = 'sin'(x - Pi/2);

 

3. Required semicolons:

I haven't been able to duplicate what you say. For me, they all require semicolons. Regardless, you should get in the habit of ending all statements with a colon or a semicolon. The colon would be used to suppress output.

 

4. MaplePrimes new users' section.

The majority of Questions on MaplePrimes are asked by new Maple users. However, most of those questions are asked by users with more mathematical experience than you.

I suggest that you check the units of time in your problem. Are you consistently using the same time unit? The 3600 makes me suspicious.

The equation can be easily proven to have no positive real solution. The integrand is

and the interval of integration is 0..70. For dd > 0, this function is positive and has a unique maximum at t = 17. That maximum is 870. It follows that the maximum possible value of the integral is 870*70 = 60900. This is not even close to your value of V ~ 5.7e7. But if you take out the 3600, then the equation makes sense.

I have never seen this phenomenon before, but apparently the complex option to fsolve is required in this case even though the returned answer is real. So just change the last command to

fsolve(eq, dd, complex);

and it will return almost immediately with the result

(I use Digits = 15.)

I hope that someone else can comment on this phenomenon.

The equation has two real solutions in the complex domain. One of those solutions is -1-sqrt(2). If you plug this in for x in the original equation, you get a negative under the square root sign. That's not allowed in RealDomain. If you want those solutions, don't use RealDomain.

Build each frame of the animation with display, then put those frames in sequence. Like this:

display([seq(display([A[g],B[g]]), g= 1..G)], insequence= true);

First 301 302 303 304 305 306 307 Last Page 303 of 395