Carl Love

## 26386 Reputation

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

## Student:-Calculus1:-VolumeOfRevolution...

`Student:-Calculus1:-VolumeOfRevolution(     sqrt(1-rho^2), -sqrt(1-rho^2), rho= 0..1,     axis= vertical,     output= animation);Student:-Calculus1:-VolumeOfRevolution(     sqrt(a^2-rho^2), -sqrt(a^2-rho^2), rho= 0..a,     axis= vertical,     output= integral);value(%) assuming a>0;`

## Switch (x,theta) in parametric procedure...

You wrote:

I need to find a way to let Maple read the sigvm in 'normal' (x,theta) and plot them on (xcart,ycart,zcart) the deflected pile.

Try this (type it exactly like this (spacing doesn't matter)):

`plot3d(      [xcart, ycart, zcart], 0 .. L, 0 .. 2*Pi,       color= unapply(sigvm(theta,x), [x,theta]),     axes = boxed, scaling = constrained);`

## Use indices instead of arguments...

We can trick rsolve into solving for a two-argument function by making the non-independent argument (i.e., the one fixed with respect to the recurrence) into an index.

 > Req:= g[m](n) = g[m-1](n)+g[m](n-1);

 > Req[m=1]:= eval(Req, m= 1);

 > rsolve(Req[m=1], g[1](n));

 > rsolve(Req[m=1], g[1](n), 'genfunc'(b));

 >

By the way, there is no command Summation in Maple. The command is Sum (inert form) or sum (active form).

By the way (2), you probably know this, but your basic two-variable recurrence g(m,n) = g(m-1,n) + g(m,n-1) has solutions generally of the form binomial(m+n, m). The precise solution depends on initial and boundary conditions.

## op, subsindets...

`ex:= hyporesult(alpha,beta):op(0,ex);                           hyporesultop(ex);                          alpha, betaop(1,ex);                             alphaop(2,ex);                              betatype(ex, typefunc(name));                              truetype(ex, specfunc(name, hyporesult));                              truetype(ex, anyfunc(name));                             falsetype(ex, anyfunc(name,name));                              truetype(ex, typefunc(identical(hyporesult)));                              true(Putting it all together):tree:= [F(ex)];                  [F(hyporesult(alpha, beta))]subsindets(     tree,      typefunc(identical(beta,alpha), name),     f-> op(0,f)(Conj(op(1,f),gamma), op(2,f)));           [F(hyporesult(Conj(alpha, gamma), beta))]`

## with(Units[Standard]) or with(Units[Natu...

Trying adding these commands at the beginning of a computation, or in an initialization file:

with(Units):

with(Units[Standard]):  or  with(Units[Natural]):

UseSystem('SI'):

The most important of these for your problem are the with(Units[Standard]):  or  with(Units[Natural]): These will cause the units to be simplified automatically everytime an arithmetic operation is performed.

Example:

`with(Units[Natural]):891.73e-3*kN*m*mm/cm^4;                                `

## Break off k=0 term...

Breaking off the k = 0 term provides a clue to what's going on. The answer is correct. We can see that it also uses cube roots of -1, but it does not express them in trigonometric form.

`1+sum(1/(6*k+1)!, k= 1..infinity);`

`evalf(%);                                         -16                    1.00019841285901 - 4 10    I`

## Area by method of shells...

It's generally very easy to numerically integrate an implicit function by making the integrand a procedure which calls fsolve (to generate the y for a given x).

 > restart:

Equation of the model curve which when rotated about the x-axis produces an egg-shaped solid.

 > EggEqn:= (x^2+y^2)^2 - (a*x^3 + (a-b)*x*y^2);

Parameter:

 > (a,b):= 1, 7/10:

Get x intercepts for plot and integration limits.

 > solve(eval(EggEqn, y=0));

 > P1:= plots:-implicitplot(      EggEqn, x= 0..1, y= -1..1,      gridrefine= 3, crossingrefine= 3, adaptranges,      resolution= 2^11,      filledregions, coloring= [yellow, white],      scaling= constrained ):
 > Y:= X-> [fsolve](eval(EggEqn, x= X), y= 0..0.4)[1]:

Verify with a plot that Y traces the outline of the egg.

 > P2:= plot(Y, 0..1, scaling= constrained, thickness= 3, color= blue):
 > plots:-display([P1,P2]);

 > dydx:= implicitdiff(EggEqn, y, x);

Surface area of solid of revolution by method of "shells".

 > SA:= 2*Pi*Int(y*sqrt(1+Diff(y(x),x)^2), x= 'a'..'b');

 > Area:= evalf(2*Pi*Int(X-> Y(X)*sqrt(1+eval(dydx, [x= X,y= Y(X)])^2), 0..1, digits= Digits-2));

 >

## `and`(A, `or`(B,C))...

There are many ways:

1. Basic prefix form: `and`(A, `or`(B,C))
2. Basic infix form: A and (B or C)
3. In the ?type system: And(A, Or(B,C))
4. In the ?property system: AndProp(A, OrProp(B,C))
5. In the ?Logic package (prefix form): `&and`(A, `&or`(B,C))
6. In the Logic package (infix form): A &and (B &or C))

## Run multiple independent worksheets...

One way to improve utilization: While a lengthy computation is running in one window, switch to another window and do some other type of work. You can even start another lengthy computation.

## expand(convert(..., exp))...

@spradlig Ah, that's different. Your original question had cos(Pi/4 - I*ln(2)), and now you have ln(2)/2. Anyway, if ex is the complex expression, then you can get your desired form by

expand(convert(ex, exp));

This works for both examples we've discussed in this thread.

I was wrong about evalc; it puts the expression, if possible, into the form Re(ex) + I*Im(ex), but it doesn't necessarily simplify the Re(ex) or Im(ex).

## truncate the sum...

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.

## eliminate instead of solve...

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

 > restart:
 > 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)};

 > solve(eqs, vars);

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

 > Sol:= eliminate(eqs, vars);

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});

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.

## print and colon...

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:

## gridrefine, crossingrefine...

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.

`plots:-implicitplot(     (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);`

## print(plot1)...

After the command you have above, put the command

print(plot1);

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.

 First 353 354 355 356 357 358 359 Last Page 355 of 381
﻿