vv

13837 Reputation

20 Badges

9 years, 319 days

MaplePrimes Activity


These are answers submitted by vv

psol := dsolve([ode1, ode2, x(0) = 50, y(0) = 10], numeric, output=listprocedure);
px:=eval(x(t),psol);

fsolve(px(t)=60, t=0..5);
       0
.9330351416

You can also use
fsolve(px-60, 0..5);

 

Do you want to use Maple as a typewriter? Maple is supposed to be used as a powerful mathematical tool. However:

`2+3+10`;
                             2+3+10
% = parse(%);
                          2+3+10 = 15
 

BesselJ  is a "nice" function, so, Int should not have problems.
If you want a better timing and do not need >15 digits, try

evalf( Int(S, t=0..1, method=_d01ajc) );  # S = your sum

If it's still slow, extract the terms of the sum in a list
L:=convert(S,list);

and integrate them one by one to find the problematic ones.

for i to nops(L) do
   'L'[i]=evalf( Int(L[i], t=0..1, method=_d01ajc) );
od;

 

 

For non-square matrices having polynomial entries in a single variable, the best tool is the Smith Form.
So, the rank can be obtained at once, and it's easy to include everything in a procedure.

A := <b,1,3 | 4,b,6>:
B := <b,1,3 | 4,b+1,6>:
with(LinearAlgebra):
SmithForm(A), SmithForm(B);

So A has rank < 2 iff b=2, and B has always rank 2.

I have posted a year ago a work with this title at the Maple Application Center here.
Please do not expect miracles. It works mainly for not very complicated rational functions f. It has been reported that a 64 bit version of Maple is needed.

That's because your function has not critical points (in the variables a,b,theta).

Please note that Maple contains commands to find extremal points; see ?maximize, ?minimize, ?Optimization:-Minimize  etc (see also the Student package).

Your input must be the sequence of the partial sums i.e.  1, 1+4, 1+4+9, ...
Note that FindSequenceFunction is a Mathematica command, not Maple.

L := [1, 5, 14, 30, 55]:
rec:=gfun:-listtorec(L,u(n)); # ==> the recurrence
rsolve(rec[1], u(n));         # ==> solution of the recurrence

      rec := [{(-n-3)*u(n+3)+5*u(n+2)+(4+n)*u(n+1), u(0) = 1, u(1) = 5, u(2) = 14}, ogf]
      (1/3)*n^3+3/2*(n^2)+13/6*n+1

The indices n start from 0,  If you want them starting from 1 you must add

simplify(eval(%,n=n-1));

        (1/3)*n^3+(1/2)*n^2+(1/6)*n

Use

m := subs(phi(u) = 1/2, k);

or, better:

eval( k, phi = (z -> 1/2) );

You have a hard to detect typo:

ics := Y(b) = Ts-Tb;  (D(Y))(-b) = 0;

instead of

ics := Y(b) = Ts-Tb,  (D(Y))(-b) = 0;

In the first place you should not unprotect GAMMA (which is an important function in Maple). Why not use Gamma instead which is free and looks the same?

You also use ArrayTools:-Alias which is used for low-level manipulation and could be incompatible with Grid (I have not tested).
See also the help page of Grid:-Seq about Grid:-Set.
Do you obtain the expected results when using seq instead of Seq?

P.S. Using 2D math input + Document mode + "special" names for variables such as your `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`   makes debugging very difficult.  This could be OK for a presentation but not for programming!

You want the singular points.
For your
expr := (a-b) / (b-a^3);    # be careful with the parentheses!
singular( expr, {a,b} );
     
{a = a, b = a^3}

So, you have infinitely many singular points (a is arbitrary and b=a^3).

It is not clear what are your intentions. For a minimization problem, usually the command detects the singularities.
E.g.

minimize(1/x, x=-1..2, location);
   
-infinity, {[{x = 0}, -infinity]}

 

You cannot. And you do not need this.
CompressedSparseForm  is supposed to be used for external programs/platforms.

restart;

T:=mtaylor(f(x+u, y+v, z+w), [u,v,w], 4):

T1:=eval(convert(T,diff),[u=fNx/dx, v=(dy-fNy)/dy, w=fNz/dz]):

PDETools[declare](f(x,y,z));  #optional

` f`(x, y, z)*`will now be displayed as`*f

(1)

T1;

f(x, y, z)+(diff(f(x, y, z), x))*fNx/dx+(diff(f(x, y, z), y))*(dy-fNy)/dy+(diff(f(x, y, z), z))*fNz/dz+(1/2)*(diff(diff(f(x, y, z), x), x))*fNx^2/dx^2+(diff(diff(f(x, y, z), x), y))*fNx*(dy-fNy)/(dx*dy)+(diff(diff(f(x, y, z), x), z))*fNx*fNz/(dx*dz)+(1/2)*(diff(diff(f(x, y, z), y), y))*(dy-fNy)^2/dy^2+(diff(diff(f(x, y, z), y), z))*(dy-fNy)*fNz/(dy*dz)+(1/2)*(diff(diff(f(x, y, z), z), z))*fNz^2/dz^2+(1/2)*(diff(diff(diff(f(x, y, z), x), y), y))*fNx*(dy-fNy)^2/(dx*dy^2)+(diff(diff(diff(f(x, y, z), x), y), z))*fNx*(dy-fNy)*fNz/(dx*dy*dz)+(1/2)*(diff(diff(diff(f(x, y, z), x), z), z))*fNx*fNz^2/(dx*dz^2)+(1/6)*(diff(diff(diff(f(x, y, z), y), y), y))*(dy-fNy)^3/dy^3+(1/2)*(diff(diff(diff(f(x, y, z), y), y), z))*(dy-fNy)^2*fNz/(dy^2*dz)+(1/2)*(diff(diff(diff(f(x, y, z), y), z), z))*(dy-fNy)*fNz^2/(dy*dz^2)+(1/6)*(diff(diff(diff(f(x, y, z), z), z), z))*fNz^3/dz^3+(1/6)*(diff(diff(diff(f(x, y, z), x), x), x))*fNx^3/dx^3+(1/2)*(diff(diff(diff(f(x, y, z), x), x), y))*fNx^2*(dy-fNy)/(dx^2*dy)+(1/2)*(diff(diff(diff(f(x, y, z), x), x), z))*fNx^2*fNz/(dx^2*dz)

(2)

 

L must be numeric.

restart;
with(IntegrationTools):
L:=5:
simplify(int(f(x), x = 0 .. L*Ts)-Split(int(f(x), x = 0 .. L*Ts), [i*Ts, i = 0 .. L])):lprint(%);

       int(f(x), x = 0 .. 5*Ts)-(int(f(x), x = 0 .. Ts)) -
         (int(f(x), x = Ts .. 2*Ts))-(int(f(x), x = 2*Ts .. 3*Ts))-(int(f(x), x = 3*Ts .. 4*Ts))-(int(f(x), x = 4*Ts .. 5*Ts))
combine(%);

         0

 

If you just want to parallelize some numerical computations (without int, sum etc, see ?thread-safe) you can use Threads:-Seq.
Example

f := proc(i) local k; 
if   i=1 then    add(1/evalf((k+sin(k))^(k/(k+1))),k=1..5*10^4)
elif i=2 then    add(1/evalf((k+sin(k))^(k/(k+2))),k=1..6*10^4)
elif i=3 then    add(1/evalf((k+sin(k))^(k/(k+3))),k=1..6*10^4)
elif i=4 then    add(1/evalf((k+sin(k))^(k/(k+4))),k=1..3*10^4)
fi
end:

CodeTools:-Usage([Threads:-Seq(f(i), i=1..4)]);
CodeTools:-Usage([seq(f(i), i=1..4)]);  # without threads, for comparison

 

First 59 60 61 62 63 64 65 Last Page 61 of 120