Carl Love

Carl Love

26715 Reputation

25 Badges

11 years, 249 days
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity

These are answers submitted by Carl Love

Maple is unable come up with a numeric approximation of the infinite sum. (Maple's ability with numeric infinite summation is much more limited than its ability with numeric integration.)

Your sum's nth term is of the form O(1)*exp(-A*n^2*t), where A is a positive constant. (Don't worry if you don't know what O(1) means.) The n^2 in the exponent makes the terms get very small very fast (assuming t > 0). So, those terms with, say, n > 20 make no appreciable difference in the sum.  So, just change the sum's upper limit from infinity to 20. The 20 is somewhat arbitrarily chosen, but I couldn't find any difference at 15 digits between 20 and 21. That's far more accuracy than you need for a plot. If you need a concrete proof that truncating the sum at a certain n makes no difference at a certain number of digits, let me know.

I don't think a logplot is appropriate for this function because the range of function values is quite small. Also, if you don't provide a range for the independent variable, t, the plot commands will use -10..10. So, you want something like

plot(eq, t= 0..10^4);

Remember that the truncation is only valid for t > 0.

I'm not completely confident with my solution given below. So I'd appreciate some commentary from some of the other experts.


eqs:= {
     R11+R12+fx = 1, R21+R22+fy = 1, R31+R32+fz = 1,
     R11+R21+R31 = 1, R12+R22+R32 = 1,
     R11*R22*fz + R12*fy*R31 + fx*R21*R32 -
          R31*R22*fx - R32*fy*R11 - fz*R21*R12
     = 1

vars:= {R||(1..3)||(1..2)};

{R11, R12, R21, R22, R31, R32}

solve(eqs, vars);

No solution returned. The command eliminate is a lot like solve, but may provide some additional information.

Sol:= eliminate(eqs, vars);

[{R11 = (2*R32*fx-R32*fy-R32*fz-fx^2-fx*fy+2*fx*fz+fy-fz-1)/(fx+fy-2*fz), R12 = -(2*R32*fx-R32*fy-R32*fz-fx+fz-1)/(fx+fy-2*fz), R21 = -(R32*fx-2*R32*fy+R32*fz+fx*fy+fy^2-2*fy*fz-fx+fz-1)/(fx+fy-2*fz), R22 = (R32*fx-2*R32*fy+R32*fz+fy-fz-1)/(fx+fy-2*fz), R31 = -R32-fz+1, R32 = R32}, {-1+fx+fy+fz}]

Note the derived residual equation: fx + fy + fz = 1 (at the end). That's why solve didn't return anything. Also note that one of the Rs is left free. Let's put R11 into the basis (If one of the Rs has to be free, it might as well be one of the ones that we need to minimize.) and take fz out of the basis (Taking out one of the fs will cause eliminate to incorporate the residual equation into the solution.).

Sol:= eliminate(eqs, vars union {fz} minus {R11});

[{R12 = -fx-R11+1, R21 = (3*R11*fy-R11+fx-fy+1)/(3*fx-1), R22 = -(3*R11*fy+3*fx*fy-R11-2*fx-2*fy+2)/(3*fx-1), R31 = -(3*R11*fx+3*R11*fy-2*R11-2*fx-fy+2)/(3*fx-1), R32 = (3*R11*fx+3*R11*fy+3*fx^2+3*fx*fy-2*R11-3*fx-2*fy+2)/(3*fx-1), fz = 1-fx-fy}, {}]

The expression to minimize:

Tr:= eval(R11+R22+fz, Sol[1]);


The expression is linear in R11; hence its minimum must occur at a boundary value for R11.


Suppress the output of the loop by ending with a colon (:) instead of a semicolon (;). Unfortunately, this can only be applied to the whole loop; surprisingly, it makes no difference what punctuation you end the solve with. The colon after the loop will suppress all of its output, so now you force the output that you want by using print.

for alpha from .4 by .1 to 5 do
     S := solve(x^4-alpha, x);
     print(S[2]) ;
end do:

The smartplot is using a finer mesh or some other refinement. If you add the option gridrefine= 2 (or higher) or crossingrefine= 2 (or higher) to your implicitplot, you will get a much better plot. While these may seem like expensive options, I point out that the plot below takes 47 millisecs for me, and the plot structure only stores 104 points.

     (x^2+y^2)^2 = x^3+3/10*x*y^2, x= 0..1, y= -1..1,
     gridrefine= 3, crossingrefine= 3,
     resolution= 2^11, adaptranges,
     scaling= constrained

After the command you have above, put the command


I think that that's all you need to do. Your command looks correct. But, not having the worksheet, I can't be sure of that.

The command ?isolve is better than msolve for this situation. But I don't think that there is any solution. Do long division. First factor 3 from the denominator:

3*p = (k^2-87)/(k+39) = k - 39 + 2*3*239/(k+39)

That leaves only a small number of possibilities for k, and I checked them all.


One of many ways to do it is with an Array-initializing procedure:

curve:= dsolve(
     {diff(y(x),x) = 1/(x-4.98), y(0)=1},
     numeric, output= listprocedure
(Note that I used listprocedure.)
pts:= < map(
P-> Array(

          proc(m) try P(m/10) catch: undefined end try end proc,
          datatype= float[8]
     map(rhs, curve)

The resulting Array is plotable as is, because plot doesn't care if a few of your points are
 undefined; it just ignores them.

I don't have a formula. I am guessing based on a mental analysis of the pattern. No polynomials or computerized interpolation used. The next 55 terms are

59051, 59053, 59055, 59059, 59061, 59067, 59077, 59079, 59085,
59103, 59131, 59133, 59139, 59157, 59211, 59293, 59295, 59301,
59319, 59373, 59535, 59779, 59781, 59787, 59805, 59859, 60021,
60507, 61237, 61239, 61245, 61263, 61317, 61479, 61965, 63423,
65611, 65613, 65619, 65637, 65691, 65853, 66339, 67797, 72171,
78733, 78735, 78741, 78759, 78813, 78975, 79461, 80919, 85293,

You just need to save the value of omega in the same way that you save KR. I put lines of ### around the code below that I changed. Let me know if this solves your problem.

Unrelated to your problem: There's no need to use evalm. The command serves no purpose in contemporary Maple.

In the future, please post your code without the ">" beginning each line. I have to remove those one by one to use your code.


 for N from 1 to Num do
 Omega[N]:= omega:
MM:= H1.H2.H3.H4:
 end do:
########### L:=seq(KR[N],N=1..Num):
for N from 1 to Num do
    if KR[N]>0.2 then
    end if
end do;

The integral is too difficult for Maple in its current form. Convert it to spherical coordinates.

I say this with trepidation, considering how badly I erred with the limits on your previous question: Are you sure that that set R is correctly specifed? The first condition, z <= sqrt(x^2+y^2+z^2), is satisfied by any three real numbers. The second condition is strange because there is no lower limit to z. I wonder if it was supposed to be abs(z).

The integral is easily seen to be 0 without the help of Maple.

2*y >= x^2 + y^2  -->  0 >= x^2 - 2*y + y^2 = (x-y)^2  -->  (x-y)^2 = 0  -->  x=y.

Thus D is meager, and the integral is 0.

Your code contains the expression


That should be

Variance(X) = StandardDeviation(A)^2.

Also, consider using ?KernelDensity rather than EmpiricalDistribution, which gives a discrete distribution. Then you can make a custom ?Distribution by uing the function returned by KernelDensity as the ?PDF.

The two answers differ by a constant, so they are both valid forms of the integral. The constant is ln(-1) = Pi*I. You can take the derivative of each and see that in both cases you get the integrand.

It is not a silly question. The easiest way to get parameterized colours is to use colour= HUE(x) where 1 >= x >= 0. The HUE scale is the standard colour spectrum, from red=0 to violet=1.

Here's an example. I've generated example data such as you describe, but using random data since I don't have your specific vectors.

V:= unapply(Vector(16, ()-> randpoly(x, degree= 1)), x):
V||(1..4):= 'V(k)' $ 'k'= 1..4:
So now I have 4 vectors, V1, ..., V4 of 16 numeric elements each.
plot([seq]([seq]([k, (V||k)[j]], k= 1..4), j= 1..16), colour= [seq](HUE(j/16), j= 1..16));
Note that the argument to HUE is matched to the index into the Vectors.

I don't know what you mean by "both sides". Do you mean to solve it for each variable, T0 and t? That can be done like this (I've changed the decimals to exact fractions, but it is not necessary to do that):

eq:= (T[0]+exp(-sqrt(t/1000)))/T[0] = 95/100;

(T[0]+exp(-(1/100)*10^(1/2)*t^(1/2)))/T[0] = 19/20

solve(eq, {T[0]});

{T[0] = -20*exp(-(1/100)*10^(1/2)*t^(1/2))}

solve(eq, {t});

{t = 1000*ln(-(1/20)*T[0])^2}



First 357 358 359 360 361 362 363 Last Page 359 of 385