Carl Love

Carl Love

27666 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

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

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

g[m](n) = g[m-1](n)+g[m](n-1)

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

g[1](n) = g[0](n)+g[1](n-1)

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

g[1](0)+Sum(g[0](n0), n0 = 1 .. n)

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

-(Sum(g[0](n)*b^n, n = 1 .. infinity)+g[1](0))/(b-1)

 


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.

Download Two_var_rec_rel.mw

ex:= hyporesult(alpha,beta):
op(0,ex);
                           hyporesult
op(ex);
                          alpha, beta
op(1,ex);
                             alpha
op(2,ex);
                              beta
type(ex, typefunc(name));
                              true
type(ex, specfunc(name, hyporesult));
                              true
type(ex, anyfunc(name));
                             false
type(ex, anyfunc(name,name));
                              true
type(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))]



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'):

See ?Units,UseSystem, ?Units,Systems, ?Units,Natural, ?Units,Standard

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;
          
                    

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

 

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

(x^2+y^2)^2-(3/10)*x*y^2-x^3

Parameter:

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

Get x intercepts for plot and integration limits.

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

1, 0, 0, 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);

-(1/2)*(40*x^3+40*x*y^2-30*x^2-3*y^2)/(y*(20*x^2+20*y^2-3*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');

2*Pi*(Int(y*(1+(Diff(y(x), x))^2)^(1/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));

2.04208853748980

 

 

Download EggArea.mw

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

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.

@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).
 

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.

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

{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]);

R11-(3*R11*fy+3*fx*fy-R11-2*fx-2*fy+2)/(3*fx-1)+1-fx-fy

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


Download RotationMatrix.mw

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.

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

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.

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.

 

First 364 365 366 367 368 369 370 Last Page 366 of 392