Carl Love

Carl Love

28085 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

The command add does not require that all the variables have numeric values; all that's required is that the lower and upper limits of summation have numeric values. In your case, m doesn't have a numeric value.

No, it's not true: The sign of x has nothing to do with it. However, if both a(x) > 0 and b(x) > 0, then arctan(a(x), b(x)) = arctan(a(x)/b(x)). It's the sign of the functions' values that matter, not the sign of the functions' arguments.

Your code is definitely stored in an ordinary file and not in some special file system maintained by Maple. You can learn (or change) the directory (aka folder) that the file is stored in with the command currentdir().

One way:

plots:-odeplot(
   sol, (r*~[cos, sin])(theta), theta= 0..2*Pi,

   axiscoordinates= polar
);

It can be done with a single solve command like this:

f:= x-> 10000/(1+30762*0.478^x)+5:
solve({D(f)(x) = M, (D@@2)(f)(x) = 0, (D@@3)(f)(x) < 0});

     {M = 1845.361366, x = 14.00001597}

The inequality condition is just to verify that it's a maximum.

Yes, it seems that that button becomes inactive, as well as the corresponding menu entry and key shortcut. But you can still single-step through the commands in another worksheet by pressing Enter. The second worksheet should be opened before you begin executing the first.

I think that this way is simpler, and it's clear why it works if you know the simple formula for the implicit derivative: dy/dx = -(dH/dx)/(dH/dy):

H:= (1.25*y - sqrt(abs(x)))^2 + x^2 - 1:
solve({H, diff(H,x)}, {x,y}): #Find the local maxima.
solve({eval(H, x=0)}, {y}): #Find the y-intercepts.

It works just as well if you replace 1.25 by 5/4 (as an exact fraction).

If I may assume that X and x are positive integers, then all that you need is this:

scm:= (X::posint, x::posint)-> cat(0 $ max(0, length(X) - length(x)), x):
#Example (avoids need of global variable):
xx:= scm(39,7);

Edit: I changed ilog10 to length because ilog10 will be off by 1 when its argument is a perfect power of 10.

I still see the spam button. Indeed, I deleted some spam this morning.

The concept of PDF only applies to continuous distributions. At least that's the way that it is in Maple. You have what Maple calls an EmpiricalDistribution. Do like this:

Dist1:= Statistics:-Distribution(EmpiricalDistribution([0, 0.1], 'probabilities'= [0.3, 0.7]));

Now Mean, etc., will work as you expect. And yes, you can add random variables from different "discrete point distributions" as defined above, and then compute the Mean, etc. You can plot the ProbabilityFunction; as I said, the term PDF is not used for these.

If you literally want to plot just the points, it can be done by

plots:-pointplot3d(
   eval([seq(seq([a+i*h, c+j*k, U[i,j]], i= 1..nX-1), j= 1..nY-1)], soln),
   symbolsize= 16, labels= [x,y,U]
);

But I think that you may be more interested in plotting the surface that can be interpolated from the points. That can be done by

plots:-surfdata(
   eval(Matrix((nX-1, nY-1), symbol= U), soln),
   a+h..a+(nX-1)*h, c+k..c+(nY-1)*k, labels= [x,y,U]
);

Neither is done literally with the plot3d command. Rather, closely related commands are used.

Simply define the following procedure:

`print/Unit`:= u-> [[u]]:

You do not need to ever explicitly use this procedure; merely having defined it is enough. This only affects the prettyprinted display of the units. It has no effect on computation.

p_yx:= diff(p(x,y), y, x):
thaw(value(subs(p_yx= freeze(p_yx), %eliminate({Eq1, Eq2}, p_yx))));

Maple's mod package (see ?mod) has everything that you need for working with polynomials over finite fields. Vv's Answer seems to imply that mod only works with finite fields of prime order. That's not true. Here's an example of computing the gcd of two polynomials over GF(3,2):
 

restart:

p:= 3: #characteristic
n:= 2: #degree

#Generate a random monic irreducible polynomial of degree n:
irr:= Randprime(n,z) mod p;

z^2+2*z+2

(1)

#Give an abbreviated name to the field extension:
alias(q=RootOf(irr)):

#List the field elements:
F:= map2(op, 1, Roots(x^(p^n) - x, q) mod p);

[0, 1, q+1, 2, q, 2*q, 2*q+2, 2*q+1, q+2]

(2)

#Generate 2 random degree-4 polynomials over the extended field:
p||(1..2):= 'Randpoly(4,x,q) mod p' $ 2: <%>;

1/1

(3)

Gcd(p1,p2) mod p;

q*x+x^2+2*q+x+2

(4)

Factor(p1) mod p;

2*(q*x+x^2+2*q+x+2)^2

(5)

Factor(p2) mod p;

(q+1)*(q*x+x^2+2*q+x+2)*(x^2+q)

(6)

 


 

Download GF.mw

This quick Answer is all that I can manage right now: A parametrized RootOf is intended for expressing inverse functions symbolically. If you're going to evalf it for numerics, then just use fsolve instead. A procedure that uses fsolve can be numerically integrated; indeed, it is common to do so.

First 183 184 185 186 187 188 189 Last Page 185 of 395