Kitonum

21470 Reputation

26 Badges

17 years, 48 days

MaplePrimes Activity


These are answers submitted by Kitonum

To obtain a numerical solution, you must specify the parameter values and add the initial conditions.

An example of the solution:

restart;
Sys:={-(9/14)*R(t)^(19/14)-(285/196)*(diff(R(t), t, t))/R(t)^(9/14)+(2565/2744)*(diff(R(t), t))^2/R(t)^(23/14) = -k*(4*lambda+1/a(t)^3),
R(t)= 6*((diff(a(t), t))^2/a(t)^2+(diff(a(t),t,t))/a(t))}:
k:=2: lambda:=1:
Sol:=dsolve(Sys union {R(0)=0.5,a(0)=1.5,D(R)(0)=0,D(a)(0)=1}, {R(t),a(t)}, numeric);
plots:-odeplot(Sol,[[t,R(t)],[t,a(t)]], t=0..7, color=[red,blue]);

                           

Another way to solve the problem is to call  RealDomain  package. Then all calculations Maple does in the real domain:

with(RealDomain):
P:=plot([(x^3-x^2)^(1/3), x-1/3, [[0,0]], [[1,0]], [[2/3,0]], [[0,-4^(1/3)/3]], [t,-4^(1/3)/3,t=0..2/3], [2/3,t,t=0..-4^(1/3)/3] ], x=-2.5..2.5, y=-2.3..2.3, style=[line$2,point$4,line$2], linestyle=[1,3,2$2], color=[red,black,red$4,black$2], thickness=[2,1], symbol=solidcircle, symbolsize=[8,8,11,11], size=[600,500], scaling=constrained, caption = typeset("A plot of   ", ``(x^3-x^2)^(1/3)), captionfont=[times,16]):
T:=plots:-textplot([[0.75,0.15,2/3], [0.15,-0.7,-4^(1/3)/3], [0.9,1,y=x-1/3]]):
plots:-display(P,T);

       

 

 

This can be done in several ways. Here are two ways:

convert(3^665, string)[-10..-1];  # The last 10 digits
                                                               "7817543843"

seq(convert(3^665, base, 10)[i], i=10..1,-1);
                                                       
 7, 8, 1, 7, 5, 4, 3, 8, 4, 3

Try this:

Vv := Eigenvalues(prod);
simplify(Vv);

Input:
 

SymmetricReduction[
 2*i1^4*i2*i3 + 2*i1^4*i2*i4 + 2*i1^4*i2*i5 + 2*i1^4*i3*i4 + 
  2*i1^4*i3*i5 + 2*i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  3*i1*i2^2*i4 + 3*i1*i2^2*i5 + 3*i1*i2*i3^2 + 10*i1*i2*i3*i4 + 
  10*i1*i2*i3*i5 + 3*i1*i2*i4^2 + 10*i1*i2*i4*i5 + 3*i1*i2*i5^2 + 
  i1*i3^3 + 3*i1*i3^2*i4 + 3*i1*i3^2*i5 + 3*i1*i3*i4^2 + 
  10*i1*i3*i4*i5 + 3*i1*i3*i5^2 + i1*i4^3 + 3*i1*i4^2*i5 + 
  3*i1*i4*i5^2 + i1*i5^3 + 4*i2^2*i3*i4 + 4*i2^2*i3*i5 + 
  4*i2^2*i4*i5 + 4*i2*i3^2*i4 + 4*i2*i3^2*i5 + 4*i2*i3*i4^2 + 
  4*i2*i3*i5^2 + 4*i2*i4^2*i5 + 4*i2*i4*i5^2 + 4*i3^2*i4*i5 + 
  4*i3*i4^2*i5 + 4*i3*i4*i5^2, {i2, i3, i4, i5}]

Output:

{i1^4 + (48 i1 + 24 i1^2 + 12 (-4 i1 - 2 i1^2) + 
     6 (-8 i1 - 4 i1^2 - 2 (-4 i1 - 2 i1^2)) + 
     4 (-4 - 12 i1 - 6 i1^2 - 5 (-4 i1 - 2 i1^2) - 
        2 (-8 i1 - 4 i1^2 - 2 (-4 i1 - 2 i1^2)))) i2 i3 i4 i5 + 
  3 i1^3 (i2 + i3 + i4 + i5) + (12 + 3 (-8 - 2 (-4 - 2 i1) - 4 i1) + 
     7 (-4 - 2 i1) + 6 i1) i2 i3 i4 i5 (i2 + i3 + i4 + i5) + 
  3 i1^2 (i2 + i3 + i4 + i5)^2 + 
  i1 (i2 + i3 + i4 + i5)^3 + (4 i1^3 + 2 i1^4) (i2 i3 + i2 i4 + 
     i3 i4 + i2 i5 + i3 i5 + i4 i5) + (8 i1^2 + 4 i1^3) (i2 + i3 + 
     i4 + i5) (i2 i3 + i2 i4 + i3 i4 + i2 i5 + i3 i5 + 
     i4 i5) + (4 i1 + 2 i1^2) (i2 + i3 + i4 + i5)^2 (i2 i3 + i2 i4 + 
     i3 i4 + i2 i5 + i3 i5 + i4 i5) + (8 i1 + 4 i1^2 + 
     2 (-4 i1 - 2 i1^2)) (i2 i3 + i2 i4 + i3 i4 + i2 i5 + i3 i5 + 
     i4 i5)^2 + (4 i1 + 12 i1^2 + 6 i1^3 + 
     3 (-8 i1^2 - 4 i1^3)) (i2 i3 i4 + i2 i3 i5 + i2 i4 i5 + 
     i3 i4 i5) + (4 + 12 i1 + 6 i1^2 + 5 (-4 i1 - 2 i1^2) + 
     2 (-8 i1 - 4 i1^2 - 2 (-4 i1 - 2 i1^2))) (i2 + i3 + i4 + 
     i5) (i2 i3 i4 + i2 i3 i5 + i2 i4 i5 + i3 i4 i5) + (4 + 
     2 i1) (i2 + i3 + i4 + i5)^2 (i2 i3 i4 + i2 i3 i5 + i2 i4 i5 + 
     i3 i4 i5) + (8 + 2 (-4 - 2 i1) + 4 i1) (i2 i3 + i2 i4 + i3 i4 + 
     i2 i5 + i3 i5 + i4 i5) (i2 i3 i4 + i2 i3 i5 + i2 i4 i5 + 
     i3 i4 i5), 0}


Check in Maple:

P:=i1^4 + (48*i1 + 24*i1^2 + 12*(-4*i1 - 2*i1^2) + 
     6*(-8*i1 - 4*i1^2 - 2*(-4*i1 - 2*i1^2)) + 
     4*(-4 - 12*i1 - 6*i1^2 - 5*(-4*i1 - 2*i1^2) - 
        2*(-8*i1 - 4*i1^2 - 2*(-4*i1 - 2*i1^2))))*i2*i3*i4*i5 + 
  3*i1^3*(i2 + i3 + i4 + i5) + (12 + 3*(-8 - 2*(-4 - 2*i1) - 4*i1) + 
     7*(-4 - 2*i1) + 6*i1)*i2*i3*i4*i5*(i2 + i3 + i4 + i5) + 
  3*i1^2*(i2 + i3 + i4 + i5)^2 + 
  i1*(i2 + i3 + i4 + i5)^3 + (4*i1^3 + 2*i1^4)*(i2*i3 + i2*i4 + 
     i3*i4 + i2*i5 + i3*i5 + i4*i5) + (8*i1^2 + 4*i1^3)*(i2 + i3 + 
     i4 + i5)*(i2*i3 + i2*i4 + i3*i4 + i2*i5 + i3*i5 + 
     i4*i5) + (4*i1 + 2*i1^2)*(i2 + i3 + i4 + i5)^2*(i2*i3 + i2*i4 + 
     i3*i4 + i2*i5 + i3*i5 + i4*i5) + (8*i1 + 4*i1^2 + 
     2*(-4*i1 - 2*i1^2))*(i2*i3 + i2*i4 + i3*i4 + i2*i5 + i3*i5 + 
     i4*i5)^2 + (4*i1 + 12*i1^2 + 6*i1^3 + 
     3*(-8*i1^2 - 4*i1^3))*(i2*i3*i4 + i2*i3*i5 + i2*i4*i5 + 
     i3*i4*i5) + (4 + 12*i1 + 6*i1^2 + 5*(-4*i1 - 2*i1^2) + 
     2*(-8*i1 - 4*i1^2 - 2*(-4*i1 - 2*i1^2)))*(i2 + i3 + i4 + 
     i5)*(i2*i3*i4 + i2*i3*i5 + i2*i4*i5 + i3*i4*i5) + (4 + 
     2*i1)*(i2 + i3 + i4 + i5)^2*(i2*i3*i4 + i2*i3*i5 + i2*i4*i5 + 
     i3*i4*i5) + (8 + 2*(-4 - 2*i1) + 4*i1)*(i2*i3 + i2*i4 + i3*i4 + 
     i2*i5 + i3*i5 + i4*i5)*(i2*i3*i4 + i2*i3*i5 + i2*i4*i5 + 
     i3*i4*i5);

expand(P) - Teller;
length(Teller);
length(P);


                                              0
                                           4308
                                            969
 

All the plotting for the first curve. For the second curve everything is done similarly.

f:=x->sqrt(abs(x-1));
y:=f(a)+D(f)(a)*(x-a);
plots:-animate(plot,[ [y, [[a,f(a)]] ], x=a-2..a+2, -1..3, style=[line,point], color=red, thickness=2, symbolsize=15, scaling=constrained], a=3..1.00001, background=plot(f, -1..5, color=blue), frames=90);

                       

The  Sol  procedure for Newton method.
Formal parameters: eta  (should be >1) and eps (positive number specifying an accuracy).

restart;
Sol:=proc(eta,eps::positive)
local y, n, k;
global F;
k:=-ilog10(eps);
Digits:=k+2;
if eta<=1 then error "Should be eta>1" fi;
F:=(y,eta)->eta*(2+9*exp(-eta*y))-22*eta*y;
y[0]:=0.;
for n from 1 do
y[n]:=y[n-1]-F(y[n-1],eta)/D[1](F)(y[n-1],eta);
if abs(y[n]-y[n-1])<eps then break fi;
od;
evalf[max(k,1)](y[n]);
end proc:

Example of use and check:

y0:=Sol(2, 0.0001);
y01:=fsolve(F(y,2), y=0..1);
abs(y0-y01);
plot(F(y,2), y=0..1);


The  Bis  procedure for the bisection method.

restart;
Bis:=proc(eta,eps::positive)
local a, b, c, n, k;
global F;
k:=-ilog10(eps);
Digits:=k+2;
if eta<=1 then error "Should be eta>1" fi;
F:=(y,eta)->eta*(2+9*exp(-eta*y))-22*eta*y;
a:=0.;  b:=1.;
for n from 1 do
c:=(a+b)/2;
if F(a,eta)*F(c,eta)<0 then b:=c else a:=c fi;
if abs(a-b)<eps then break fi;
od;
evalf[max(k,1)](c);
end proc:


Example of use:

y0:=Bis(2, 0.0001);


Edit.

You do not need  isolve  command. (j-1)/m<=t<j/m  is equivalent to  (j-1)<=t*m<j , therefore
j-1=floor(t*m) ,   j=floor(t*m) + 1


Addition. If you still want to use  isolve  command, then it's easy to do as some procedure:

F:=(m,t)->isolve({t>=(j-1)/m, t<j/m}):


Example of use:

F(2.5, 0.7);
                                         
 {j = 2}

You have a second-order equation, so for each solution you need two initial conditions:

ode1 := diff(x(t), t, t) = (5*9.80665)*sin((1/6)*Pi)-(10*(10-sqrt(x(t)^2+25)))*x(t)/sqrt(x(t)^2+25)-diff(x(t),t);
DEtools:-DEplot(ode1, x(t), t = -2 .. 2, x = -8 .. 8, color = blue, stepsize = 0.5e-1, [seq([x(0) = (1/4)*k, D(x)(0)=0], k = -20 .. 20, 4)], linecolor=red);

              

Arrows are plotted only for first-order equations.

restart:  with(linalg):
S:=matrix(3,3,[s11,s12,s13,s21,s22,s23,s31,s32,s33]):
X:=matrix(3,1,[x1,x2,x3]):
A:=matrix(3,3, (i,j)->S[i,j]/X[j,1]);

Xm:=evalm(transpose(h)&*transpose(X));
S/~Xm;
 # memberwise division: S / Xm

Xd:=diag(x1,x2,x3);  # make X the diagonal of a square matrix
A:=evalm(S&*inverse(Xd));
 

Example:

P_X:=Vector(10, symbol=v);

seq(P_X[i]<1, i=1..10);


Addition for beginners. The command  seq  is one of the most powerful and frequently used commands in Maple. It can often substitute for loops, both simple and nested (in the latter case, nested sequences are used). Here are 2 more examples of using this command:

seq(ithprime(n), n=1..50);   # First 50 prime numbers

n:=50:
seq(seq(seq(`if`(a^2+b^2=c^2, a^`2`+b^`2`=c^`2`, NULL), b=a+1..n-1), a=1..n-2), c=3..n);   
# All Pythagorean triangles with hypotenuse not exceeding 50


Edit.

I do not think that this sum can be found in closed form for any  . But for integer positive  r  the solution can be written as a procedure:

restart;
S:=r->simplify(sum((a+k*d)^r, k=1..n));


Examples of use:

S(2);
S(3);
S(6);

See  wiki  for details.

Example of calculation (norm in the space  C[-1,1]):

restart;
f:=x->x^3-x:
maximize(abs(f(x)), x=-1..1);
                                                       
 2*sqrt(3)*(1/9)

 

NumberTheory:-Totient(n)  returns the number of positive integers coprime to   and not greater than  . See help for details.
 

Addition. Another way:

restart;
with(Physics):
phi:=n->add(KroneckerDelta[igcd(n,k),1], k=1..abs(n)-1);
NumberTheory:-Totient(14);
phi(14);

 


Edit.
 

See  here  about this.

Of cause you can just write  3+1/7 .

First 126 127 128 129 130 131 132 Last Page 128 of 290