Joe Riel

9530 Reputation

23 Badges

20 years, 27 days

MaplePrimes Activity


These are answers submitted by Joe Riel

I assume you mean

eq := x^(2/3) + y^(2/3) = 1:

Maples uses the principal root, which is complex for x,y < 0.  One way is to use the absolute value:

eq2 := subsindets(eq, symbol, abs);
plots:-implicitplot(eq2, x=-3..3,y=-3..3);

You might check out the Syrup package in the application center; it can quickly solve this circuit.

How about this,

z := (x^2+y^2)^(x^2*y^2):

Compute the limit along a line through 0

zx := subs(y=k*x, z):
limit(zx, x=0);
                      1

Try the seq procedure with the optional third argument.

spacecurve is a member of the plots package.  You can access it with the long name:

plots:-spacecurve(...);

or call with to permit accessing it with the shortname:

with(plots):
spacecurve(...);

 

convert(BesselK(1,x),Sum);

I don't know how to show this analytically in Maple, but generating the sequence of integers (via rounding) is easy enough.  The sequence corresponds to the hexagonal numbers, m*(2*m-1).

Maple, alas, doesn't not currently have a sort-in-place procedure that operates on rtable (Matrices).  You can accomplish this by converting to a listlist and sorting that. For example

A := <<5,3,6,2>|<0.9,0.99,0.8,0.85>>:
L := convert(A,listlist);
sort(L, (a,b) -> a[2]>b[2]);
Matrix(%);
                                  [3    0.99]
                                  [         ]
                                  [5    0.9 ]
                                  [         ]
                                  [2    0.85]
                                  [         ]
                                  [6    0.8 ]

For large Matrices you might use a modification of sorting-with-attributes:

n := op([1,1],A);
L2 := [seq(setattribute(SFloat(A[i,2]),i), i=1..n)]:
L3 := sort(L2,`>`);
Matrix([seq([A[attributes(L3[i])]], i=1..n)]);
                                  [3    0.99]
                                  [         ]
                                  [5    0.9 ]
                                  [         ]
                                  [2    0.85]
                                  [         ]
                                  [6    0.8 ]

 

The real challenge is making this reasonably fast.  Here is my first attempt, not particularly fast.  This isn't the nicest approach, from a pedagogical viewpoint.

Harmonic := module()
export ModuleApply;
local nmax;
    nmax := 1;
    ModuleApply := proc(n::posint)
    option remember;
    local k;
        procname(nmax) + add(1/k,k=nmax+1..n);
    end proc;
    ModuleApply(1) := 1;
end module:

A := proc(n::posint)
local k;
    for k while Harmonic(k) < n do end do;
    return k;
end proc:

harmonic1 := proc(n)
    Vector['row'](n, A);
end proc:

harmonic1(3);
                  [1, 4, 11]
 

 

The procedure you want is dsolve, not solve.  Also, you need to use y(x), not y, as the dependent variable:

ode := diff(y(x), x) = y(x)^2*exp(x);
dsolve(ode,y(x));                    
                                                  1
                                    y(x) = - ------------
                                             exp(x) - _C1

You can include an initial condition so that dsolve will solve for the integration constant:

 dsolve({ode,y(0)=y0}, y(x));         
                                                    y0
                                     y(x) = - ------------------
                                              exp(x) y0 - 1 - y0

You could use fsolve, which permits specifying a range:

fsolve((p+1)^2-p^2, p=0..infinity);
                                                           NULL
fsolve((p+1)^2-p^2, p=-infinity..0);          
                                                      -0.5000000000

Your loop is assigning a procedure, not a value. Try
b := Array(0..500, 0..500):
for i from 0 to 500 by 2 do
   b[i,0] := i!/...;
end do:

Solving this by hand is trivial.  Just split the sum into two sums and adjust the second summand so that it cancels all all but the first term of the first.  Of course, you need to demonstrate that the sum actually converges, but you should know how to do that (Maple can be helpful here).

 

The easiest way to do this is probably

C := c[0]*sqrt(x):
C*expand(y1/C);

Note that you should be using add rather than sum. Regardless, I don't understand why your computation has numerical coefficients; maybe you cut and pasted something else? Oh, I see, your c must have been defined in terms of c[0].  I'm surprised that worked, since c[0] is referenced...

You cannot readily do so.  Well, you could if you reassigned print, but I only recommend that when absolutely necessary. What you really want to do [from your previous posts] is to save data generated in a loop so that you can use it outside the loop.  One way to do that is to insert the data into a table.  For example

T := table():
for i to 10 do
   data := <generate data>:
   T[i] := data;
end do:
A := convert(T, 'list');

 

First 89 90 91 92 93 94 95 Last Page 91 of 114