Carl Love

Carl Love

28025 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

eval(arctan(y, x), answer5[1])

Many Maple commands return sets or lists of equations which specify the values of variables. The best way to access those values is eval.

I've used the two-argument form of arctan, which correctly adjusts the result to the third or fourth quadrant when the second argument is negative. See ?arctan.

Arguments are evaluated before being passed. The solve evaluates to NULLNULL isn't counted as an element in an argument sequence. 

The simplest thing that you could do to animate it would be to add the keyword animate to the Explore command. Then hit the play button (right-pointing triangle towards lower left of the Explore window).

searchtext is a command that searches for one string in another string. I guess that the command that you used called searchtext. See ?searchtext for the valid argument sequences. If you need more help, then you'll need to post (at least) the command that gave you the error message.

Here's the "little procedure" that I referred to in a Reply above:

`convert/standardODE`:= (e::{algebraic, `=`(algebraic)})->
local 
    dy:= indets(e, specfunc(function(name), D))[], 
    x:= op([1,1], dy),
    dydx:= diff(op(dy), x)
;
    solve(subs(D(x)= 1, dy= dydx, e), {dydx})[]
:  
ode:= -(x^2+x*y(x))*D(x) + D(y(x)) = 0:
convert(ode, standardODE);
                            d          2         
                           --- y(x) = x  + x y(x)
                            dx                   

I omitted checks for any of the numerous syntactically invalid forms that could be entered.

Your procedure contains the line x1:= evalf(T(x0)) where has no other reference. I guess this is a typo. I don't know why maplemint didn't catch this. Perhaps maplemint thinks you mean from the orthopoly package. Regardless, you need to define T, which I guess is your Newton iteration function T:= unapply(x - D(f)(x)/f(x), x).

The memory used by a Grid application is likely to be roughly proportional to the number of processors in use. So, one way to get it to use less memory is to reduce the number of processors used by setting kernelopts(numcpus= some number). A few years back, it was necessary to do that right after restart; I don't know if that's still true. If done signifiicantly after restart (perhaps after the first garbage collection), it would say that it had changed numcpus but not actually do it.

I'll define a memory leak as a situation where some memory that should be garbage collected isn't being. Maple has many known memory leaks. If that is the problem, it may be possible to ameliorate it by reducing tasksize. But my experience is that you shouldn't lower it so much that the CPU time on each task is less than about 2 seconds.

I am unsure about both paragraphs above, so I'm looking forward to other opinions.

Unevaluation makes things weird. What you want can be done like this:

EXPLORE:= proc(TF::boolean)
  if TF then 
    Explore(_passed[2], _passed[3..])
  end if
end proc
:
EXPLORE(true, ''plot(a*x, x=0..1)'', parameters=[a=-1.0 .. 1.0]);

The two necessary changes are that the first argument to Explore needs to be evaluated separately because it's declared uneval in Explore, and the second change is that the plot needs to be double unevaluated because it loses one level by being passed to EXPLORE. Your parameters argument needs no quotes because it doesn't change under evaluation.

Your type boolean should be replaced by truefalse if indeed TF's value can only be true or false.

There's a simple formula for the roots. Surely you've seen it at some point, perhaps in high school:

AllRoots:= (x::nonnegative, r::posint)-> 
    seq(root(x,r)*(cos+I*sin)(2*Pi*k/r), k= 1..r)
;

I think that this is a simpler approach, and it leads to a simpler formula with a high degree of symmetry. The area that we want is the area in the smaller circle subtended by chord HG (from your original diagram) plus the area in the larger circle subtended by that same chord. A chordal area depends only on the length of the chord and the radius. So, one formula can be used for both pieces, with only the radii being different.

[MaplePrimes is refusing to display my worksheet. I'll copy and paste the plaintext, and you'll need to download it to see the 2D output.]

The area subtended in a circle of radius R by a chord of length L is
AreaChord:= (L,R)-> 
    local x; 
    2*int(sqrt(R^2-x^2) - sqrt(R^2-(L/2)^2), x= 0..L/2)

Solve for the y-coordinates of H and G so that we can get the length of that chord.
C1:= x^2 + y^2 = L^2:
C2:= (x-R)^2 + y^2 = R^2:
sol:= solve({C1,C2}, {x,y}, explicit);


add(AreaChord~(2*eval(y, sol[1]), [L,R])) assuming L > R, R > 0;

A:= simplify(%) assuming L^2 < 2*R^2;

fsolve(eval(A, R=1) = Pi/2, {L});
                       
{L = 1.158728473}

Download Circles.mw

This can be solved with LinearAlgebra:-LinearSolve in exactly the same way as a problem that you asked yesterday.

The R5 must be a typo. The given vectors are clearly in R4.

There seems to be some missing connection between your two "Suppose...." statements. The only variables in the first are the us, and there are no us in the second. Is the matrix whose columns are the us? Is v a purely symbolic vector? If both of these are "yes", then b1 = u1[1]*v[1] + u2[1]*v[2] + u3[1]*v[3] + u4[1]*v[4], or, more succinctly, A[1, ..] . v.

You want the coefficients of a linear combination of vectors that equals another vector. The command for that is LinearSolve. Note that the xs do not play any numeric role in this process. The solution that we obtain will be correct for any xs.

LinearAlgebra:-LinearSolve(
    < <71, 73, -153, -259, -108, 245> |
      <37, 189, 287, -167, 279, -51>  |
      <-199, -200, -62, 59, 262, -70> |
      <48, 295, 18, 235, 209, 279>
    >,
    <6143, 20711, 8974, -30368, 18964, 17937>
);

 

The commands

A:= <
    < -17, -29, 6, -81, 20>     |
    <-65, -11, -47, 18, -15>    |
    <-240, 90, -265, 495, -175> |
    <-53, 70, 84, -80, 61>      |
    <9, 0, 46, -55, -37>        |
    < 176, -280, -520, 540, -96>
>;
LinearAlgebra:-NullSpace(A);

will return a set of two vectors. Any linear combination of those vectors other than identical 0 is a solution to the problem. The solution can also be obtained from LinearSolve:

LinearAlgebra:-LinearSolve(A, <0, 0, 0, 0, 0>);

The solution will be returned as a single vector with two parameters (with names such as _t1[3]). Giving those parameters any values other than both gives a solution to the problem.

Like this:

Has:= (expr, excp, x)-> local Z; has(subsindets(expr, excp, ()-> Z), x):
expr:=1/exp(z)*arcsinh(x*exp(C[1]))+x*C[1]*sin(exp(x))+3*exp(C[1]*y)*sqrt(sin(exp(3*C[1]))):
expr2:=1/exp(z)*arcsinh(x*exp(C[1]))+x*sin(exp(x))+3*exp(C[1]*y)*sqrt(sin(exp(3*C[1]))):
Has(expr, specfunc(exp), C[1]);
                              true

Has(expr2, specfunc(exp), C[1]);
                             false

 

First 96 97 98 99 100 101 102 Last Page 98 of 395