vv

12453 Reputation

19 Badges

9 years, 285 days

MaplePrimes Activity


These are answers submitted by vv

The ODE  y'(x) = x * ln(y(x))  has separable variables. But the variables can be separated only if ln(y) <> 0  i.e.  y <> 1.
So, for the IC =  {y(1) = y0}, (y0 <> 1),  the variables can be separated, and after integration one obtains the unique solution (near x=1).
For y(1) = 1 this is not possible, but in this case y = 1 is actually the unique solution.

When the ODE is solved without IC, Maple finds the generic (and general) solution, valid in domains for which y<>1. This solution does not contain the constant y(x) = 1 solution.

 

@nm 

If you want to  pass by value "r", so changes inside the function do not update the global variable with same name
then use copy:

foo:=proc(r)
    local r1:=copy(r);
    r1:-b:=5;
    eval(r1)
end proc;

 

In Maple 2018:

evalf(frac(Pi^20));

       23.

is obviously a (semi-)bug!

P:=5625*t^2*tan((1/2)*t)^2*(1/299)+22201*t^2*(1/1196): # 0 < t < Pi
plot([4*P+t^2,P, t=0..0.25]);

plot([4*P+t^2,P, t=0..Pi]);

You mean 2r (not 8r).

Use add because the sum is finite and sum has special evaluation rules.

coords := [t, r, theta, varphi]:
add(diff(r^2, coords[k]), k = 1 .. 4);

           2r

If you really prefer sum then use:

sum('diff'(r^2, coords[k]), k = 1 .. 4);

 

> restart;
> Digits := 15;
                          Digits := 15
;
> aG := 8.202046; bG := -12.31377; cG := -818043.42; aP := 0.8e4; bP := 0.3e5; cP := 0.1e5; fP := 0.3e8; ak := 0.92e18; bk := 0.11e19; fk := 0.46e22;
                         aG := 8.202046
                        bG := -12.31377
                                         5

                      cG := -8.1804342 10
                          aP := 8000.
                          bP := 30000.
                          cP := 10000.
                                    7

                          fP := 3 10
                                     17

                         ak := 9.2 10  
                                     18

                         bk := 1.1 10  
                                     21

                         fk := 4.6 10  

> x0 := 0.25e-1;
                          x0 := 0.025


> G := unapply(exp(cG*x^7+bG*x+aG),x);
> F := unapply((6*fP*x^5+3*cP*x^2+2*bP*x+aP)/(fk*x^6+bk*x^2+ak*x),x);
> K := unapply(x-x0,x);

                 /             5  7                        \

    G := x -> exp\-8.1804342 10  x  - 12.31377 x + 8.202046/
                      8  5           2                   

                1.8 10  x  + 30000. x  + 60000. x + 8000.

      F := x -> -----------------------------------------

                       21  6         18  2         17    

                 4.6 10   x  + 1.1 10   x  + 9.2 10   x  
                      K := x -> x - 0.025
;
> ff:=Int(K(x)*F(x)*(Int(G(t)*F(t), t = x .. xmax)), x = x0 .. xmax); # xmax  =  0.21 .. 0.24
        /xmax                                        /            

       |                        1                    |            

ff :=  |      -------------------------------------- |(x - 0.025)

       |            21  6         18  2         17   |            

      /0.025  4.6 10   x  + 1.1 10   x  + 9.2 10   x \            

 

                                              /  /xmax

  /      8  5           2                   \ | |      

  \1.8 10  x  + 30000. x  + 60000. x + 8000./ | |      

                                              | |      

                                              \/x      

 

                    1                    /   /             5  7

  -------------------------------------- \exp\-8.1804342 10  t

        21  6         18  2         17                         

  4.6 10   t  + 1.1 10   t  + 9.2 10   t                       

 

                          \ /      8  5           2           

   - 12.31377 t + 8.202046/ \1.8 10  t  + 30000. t  + 60000. t

 

               \\   

          \\   ||   

   + 8000.// dt|| dx

               ||   

               //   

> ff:=simplify(convert(ff,rational));
                                     /xmax

                   1                |      

ff := ----------------------------  |      

      4000000000000000000000000000  |      

                                   /1/40   

 

                            /                                   

              1             |           /       5       2       

  ------------------------- |(40 x - 1) \90000 x  + 15 x  + 30 x

    /        5            \ |                                   

  x \230000 x  + 55 x + 46/ \                                   

 

        /  /xmax                                             

      \ | |                  1             /   /  40902171  7

   + 4/ | |      ------------------------- |exp|- -------- t

        | |        /        5            \ \   \     50      

        \/x      t \230000 t  + 55 t + 46/                   

 

                                                           \\   

     1231377     4101023\ /       5       2           \\   ||   

   - ------- t + -------| \90000 t  + 15 t  + 30 t + 4/| dt|| dx

     100000      500000 /                              /   ||   

                                                           //   
;
                      K := x -> x - 0.025
;
> den:=denom(ff);
              den := 4000000000000000000000000000
;
> f1:=unapply(ff*den,xmax);
                /xmax                           /            

               |                  1             |           /

f1 := xmax ->  |      ------------------------- |(40 x - 1) \

               |        /        5            \ |            

              /1/40   x \230000 x  + 55 x + 46/ \            

 

                               /  /xmax                          

         5       2           \ | |                  1            

  90000 x  + 15 x  + 30 x + 4/ | |      -------------------------

                               | |        /        5            \

                               \/x      t \230000 t  + 55 t + 46/

 

   /   /  40902171  7   1231377     4101023\ /       5       2

   |exp|- -------- t  - ------- t + -------| \90000 t  + 15 t

   \   \     50         100000      500000 /                  

 

                  \\   

             \\   ||   

   + 30 t + 4/| dt|| dx

              /   ||   

                  //   
;
> A,B := evalf(f1(0.21)), evalf(f1(0.24));
           A, B := 26.9691518877175, 26.9691522198837
;
> evalf[20](f1(0.21));
> evalf[20](f1(0.24));
                     26.969151887717505150
                     26.969152219883640121

> [A,B]/den;
        [                   -27                     -27]

        [6.74228797192938 10   , 6.74228805497092 10   ]
;
> plot(f1, 0.21 .. 0.24, title="f * den");  # f is almost constant

;
>

 

normalization.mw

In Maple 2018 such animations are very easy.

restart;
with(plots):
P:=proc()
local i, t:=rand(-0.5..0.5), txt:="Very Easy!", col:=[red,blue,green,gold];
textplot([
   seq([i*100, 3, txt[i], rotation=t(), color=col[i-1 mod 4 + 1]], i=1..length(txt))
],
'font'=["times","roman",floor(60*(1+t()/2))])
end:

animate(P, [],  u=1..30, frames=30);

(for q=0.6, N=0)

 

F:=1.666666667*a*tanh(29.57459897*a^2-25.70807505)*ln((2*a^2+1.2*a-1.378524)/(2*a^2-1.2*a-1.378524))-2;

1.666666667*a*tanh(29.57459897*a^2-25.70807505)*ln((2*a^2+1.2*a-1.378524)/(2*a^2-1.2*a-1.378524))-2

(1)

plot([Re,Im](F),a=0.1e-3 .. 2);

 

plot( (2*a^2+1.2*a-1.378524)/(2*a^2-1.2*a-1.378524), a=0.1e-3 .. 2);

 

int(F, a = 0.1e-3 .. 2, numeric);  # Maple crash (mserver)

 

There is no universal recipe. In your example:

expr := 7*ln(arcsin(x))-(1/2)*ln(x-1)*sin(x)-(1/2)*ln(x+1)+f:
eval(expr, ln = ln@abs);

 

Here is another splitting procedure.
It's very simple but should work in (almost) all situations.
X0 is a point in the domain of definition (the default being [0,0,...])

   

SplitX:=proc(expr, X::list(name), X0:=0)
local f,A,c,n:=nops(X);
if X0=0 then A:=0*~X else A:=X0 fi;
f:=seq(eval(expr, X=~(subsop(i=X[i],A))),i=1..n);
c:=simplify(expr/mul(f));
if depends(c,X) then WARNING("Unsplitable") fi;
[c,f]
end:

 

Examples

 

SplitX(x*y, [x,y], [2,2]);

[1/4, 2*x, 2*y]

(1)

SplitX(-y+4*x^3*y,[x,y],[1,1]);

[1/3, 4*x^3-1, 3*y]

(2)

SplitX(-(y-exp(x))/(x-2),[x,y],[1,1]);

Warning, Unsplitable

 

[(y-exp(x))/((-1+exp(x))*(-y+exp(1))), -(1-exp(x))/(x-2), y-exp(1)]

(3)

SplitX(1-x+y^2-x*y^2,[x,y],[0,0]);

[1, -x+1, y^2+1]

(4)

(x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*sqrt(x^2*y-y);
SplitX(%, [x,y], [2,1]) assuming y>0;

(x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*(x^2*y-y)^(1/2)

 

[(9/5)*3^(1/2)*exp(2), (x^2+1)*exp(-x)*3^(-x-1)*(x^2-1)^(1/2), 5*y^(9/2)*exp(-1-y)*3^(-2-y)*3^(1/2)]

(5)

 


 

Download SplitX.mw

To check whether a list (or set) A has zero entries you can use
evalb(A = 0*~A);
or
is(A = 0*~A);

There are more efficient ways for large lists/sets.
 

 

Your series

diverges for any x. Usually it is better to avoid such a formula for a divergent series.

f := x -> piecewise(x < 0, 3^(-(1/3)*x^2), 1/2*2^(5^(-x)));
R := x -> int(f(t), t = x .. x+l):
L := x -> int(f(t), t = x-l .. x):
DD := x -> (R(x)-L(x))/(R(x)+L(x)):

DD(x);

It would be a good idea to use R := (x,h) -> int(f(t), t = x .. x+h):  etc
 

It is not a good idea to use LaTeX here. It is easier to use (and read) the Maple language.
Your set is   S = { k in N : f(k) = 0 }, where

f:= k -> floor((k-1)/2) - floor(k*log10(Pi));

To determine whether S is finite, a bit of math + Maple is enough:

limit(f(k), k=infinity);
      infinity

So, S is finite.

It is easy to use Maple to find the cardinality of S (i.e. the number of elements). Try it.

 

( Loss of significance).

Here is a simpler example.

F:=x -> sqrt(1+x^2)+x;
G:=x -> 1/(sqrt(1+x^2)-x);  # F = G

F(1008.)=G(1008.);
F(1009.)=G(1009.);  # !!??
F(1010.)=G(1010.);

                   2016.000496 = 2016.129032
                   2018.000496 = 2016.129032
                   2020.000495 = 2020.202020

 

First 60 61 62 63 64 65 66 Last Page 62 of 111