Kitonum

21540 Reputation

26 Badges

17 years, 108 days

MaplePrimes Activity


These are answers submitted by Kitonum


 

restart;

local D;
l:=0.5;a:=0.1; rho:=2700;h:=.0005;
E:=72.4*10^9;v:= 0.3;
n:=6;
m:=1;

AD:=10;
mu:=(2*a*2.35)/l;
nu:=sin(mu*l/(2*a))/sinh(mu*l/(2*a)); omega[m,n]:= 3067.173621;

.5

 

.1

 

2700

 

0.5e-3

 

0.7240000000e11

 

.3

 

6

 

1

 

10

 

.9400000000

 

.1369508410

 

3067.173621

(1)

 

E:=1:k[1,1]:=-5.660173062*10^10:k[1,2]:=-2.8552873062*10^10:k[1,3]:=-8.68528173062*10^10:k[1,4]:=-7.6788528173062*10^10:k[1,5]:=-1.52568528173062*10^10:k[2,1]:=-15.660173062*10^10:k[2,2]:=-21.8552873062*10^10:k[2,3]:=-18.68528173062*10^10:k[2,4]:=-71.6788528173062*10^10:k[2,5]:=-10.52568528173062*10^10:
k[3,1]:=-5.65257260173062*10^10:k[3,2]:=-27.8552552873062*10^10:k[3,3]:=-81.6854428173062*10^10:k[3,4]:=-9.67858528173062*10^10:k[3,5]:=-3.52568528173062*10^10:
k[4,1]:=-51.111660173062*10^10:k[4,2]:=-21.811552873062*10^10:k[4,3]:=-18.68528173062*10^10:k[4,4]:=-17.6788528173062*10^10:k[4,5]:=-11.52568528173062*10^10:
k[5,1]:=-6.660173062*10^10:k[5,2]:=-61.852873062*10^10:k[5,3]:=-82.68528173062*10^10:k[5,4]:=-72.6788528173062*10^10:k[5,5]:=-21.52568528173062*10^10

-0.2152568528e12

(2)

 

 

S:=(Matrix([[rho*h*omega[m,n]^2+k[1, 1],k[1,2],k[1,3],k[1,4]],[k[2,1],rho*h*omega[m,n]^2+k[2,2],k[2,3],k[2,4]],[k[3,1],k[3,2],k[3,3]+rho*h*omega[m,n]^2,k[3,4]],[k[4,1],k[4,2],k[4,3],k[4,4]+rho*h*omega[m,n]^2]])).(Vector(1..4,[[A],[B],[C],[D]]))=-E*(Vector(1..4,[k[1,5],k[2, 5],k[3,5],k[4,5]]));

(Vector(4, {(1) = -0.5658903042e11*A-0.2855287306e11*B-0.8685281731e11*C-0.7678852817e11*D, (2) = -0.1566017306e12*A-0.2185401729e12*B-0.1868528173e12*C-0.7167885282e12*D, (3) = -0.5652572602e11*A-0.2785525529e12*B-0.8168417280e12*C-0.9678585282e11*D, (4) = -0.5111166017e12*A-0.2181155287e12*B-0.1868528173e12*C-0.1767758280e12*D})) = (Vector(4, {(1) = 0.1525685282e11, (2) = 0.1052568528e12, (3) = 0.3525685282e11, (4) = 0.1152568528e12}))

(3)

solve(convert((lhs-rhs)(S), list))

{A = -.1373190087, B = -.1795797543, C = 0.3604957767e-1, D = -0.7148975043e-1}

(4)

 


Addition. You do not need to form a system of equations in any form. Using the  LinearAlgebra:-LinearSolve  command you can solve the system simply by specifying the matrix of coefficients in front of the unknowns and the vector of the right side:

M:=(Matrix([[rho*h*omega[m,n]^2+k[1, 1],k[1,2],k[1,3],k[1,4]],[k[2,1],rho*h*omega[m,n]^2+k[2,2],k[2,3],k[2,4]],[k[3,1],k[3,2],k[3,3]+rho*h*omega[m,n]^2,k[3,4]],[k[4,1],k[4,2],k[4,3],k[4,4]+rho*h*omega[m,n]^2]]));
V:=-E*(Vector(1..4,[k[1,5],k[2, 5],k[3,5],k[4,5]]));
LinearAlgebra:-LinearSolve(M, V);

Download solve_(1)_new.mw

The  AlmostCarmichaelNumbers  procedure finds all the numbers that meet your requirements for a number  k  and for a range  (which you specify when using) .

AlmostCarmichaelNumbers:=proc(k::posint,R::range)
local T, N, m, n, L;
T:=table(); N:=0; m:=lhs(R);
for n from `if`(m::odd,m,m+1) by 2 to rhs(R) do
L:=ifactors(n);
if nops(L[2])=k then if `and`(map(t->is(t[2]=1),L[2])[]) and `+`(seq(`if`(irem(n-1,t[1]-1)=0,1,0),t=L[2]))=k-1 then N:=N+1; T[N]:=n fi; fi;
od;
convert(T, list);
end proc:

Examples of use for k=3, 4, 5 :

AlmostCarmichaelNumbers(3,1..10000);
AlmostCarmichaelNumbers(4,1..10000);
AlmostCarmichaelNumbers(5,1..10000);
         
    

A:=(-108*q - 12*sqrt(12*p^3 + 81*q^2))^(1/3)/6;
B:=(A^3)^(1/3);
c:=op([1,2], B);
subsop([1,2]=-(c^2)^(1/2), B);


Addition. This method can be used in some cases when simplifying radicals, for example:

restart;
A:=sqrt(11-4*sqrt(6))+sqrt(21+6*sqrt(6));
sqrt(A^2);

 

The differential equation must be entered with explicit indication of the derivative (not differentials) using Maple syntax. For your example, you can do this:

restart;
de:=2*y*dx+3*x*dy=0;
subs([dy=diff(y(x),x)*dx,y=y(x)], de);
dsolve(%, y(x));

             

 

Just differentiate your equation 2 times, taking  y as a function of  :

restart;
Curves:=x^2+A*y(x)^2=B:
Eq:=diff(Curves,x,x);
dsolve({Eq,y(0)=sqrt(B/A),D(y)(0)=0}, y(x), implicit);
solve(%, B)=B;

         


Edit. Sure enough the right solution is Rouben's one, not me. I forgot to eliminate the constant  . Rouben very politely "did not notice" this error.

You can do this (like as in the original post) without  DataFrame  , using only matrices:

A:=Matrix(3, (i,j)->i);
DF:=< <<D1|D2|D3>, A> | <``,D1,D2,D3> >;

    

You can use the  Explore  command for this:

Explore(plot([sqrt(a*x^3+b*x^2+c*x+d),-sqrt(a*x^3+b*x^2+c*x+d)], x=-3..3, color=red, view=-7..7), a=-3...3., b=-3...3., c=-3...3., d=-3...3.);

 

Maple's possibilities are not limitless, so just reduce the ranges for calculations. It is easy to check that one of the roots is exact 0:


 

restart; Digits := 20

r1 := sqrt(2^2-I*z)

(4-I*z)^(1/2)

(1)

r2 := sqrt(2^2+I*z)

(4+I*z)^(1/2)

(2)

F := -r2*(r1^2-(1/5)*2^2)^2*cosh((1/150)*r1*Pi)*sinh((1/150)*r2*Pi)+r1*(r2^2-(1/5)*2^2)^2*cosh((1/150)*r2*Pi)*sinh((1/150)*r1*Pi)+z*(-r1^2+r2^2)*cosh((1/150)*r1*Pi)*cosh((1/150)*r2*Pi)

-(4+I*z)^(1/2)*(16/5-I*z)^2*cosh((1/150)*(4-I*z)^(1/2)*Pi)*sinh((1/150)*(4+I*z)^(1/2)*Pi)+(4-I*z)^(1/2)*(16/5+I*z)^2*cosh((1/150)*(4+I*z)^(1/2)*Pi)*sinh((1/150)*(4-I*z)^(1/2)*Pi)+(2*I)*z^2*cosh((1/150)*(4-I*z)^(1/2)*Pi)*cosh((1/150)*(4+I*z)^(1/2)*Pi)

(3)

RootFinding:-Analytic(F, z, re = -1000 .. 1000, im = -100 .. 5000)

-.32383214677931941878, -47.436599289272340538, 0.21483438735350000000e-19*I

(4)

eval(F, z = 0)

0

(5)

``


 

Download calculs_new.mw

You can use the inert form  Diff  that will not be calculated, but can be calculated at any time with the command  value :

u[1](T[1], T[2], T[3]):=exp(T[1]*I):
Diff(diff(u[1](T[1], T[2], T[3]), T[1]), T[2]);
value(%);

                                             

 

Of course, you can make inert differentiation for both variables:

u[1](T[1], T[2], T[3]):=exp(T[1]*I):
Diff(u[1](T[1], T[2], T[3]), T[1], T[2]);
value(%);

 

Here are 2 customised legends with vertical alignment (text rotation is available only from Maple 2018):

restart;
with(plots):
Plots:=plot([t^2,t^3], t=-2..2, color=[blue,red], linestyle=[1,3], view=-2..2, labels=[t,"x,y"]):
Lines:=plot([[1.6,t,t=0.9..1.3],[1.9,t,t=0.9..1.3]], color=[blue,red], linestyle=[1,3]):
Labels:=textplot([[1.55,1.55,x=t^2,rotation=Pi/2],[1.85,1.55,y=t^3,rotation=Pi/2]]):
display(Plots, Lines, Labels);

           

 

Use  seq  command for this.

Example:

seq(sin(x), x=0..evalf(Pi/4), 0.1);

     0, 0.9983341665e-1, .1986693308, .2955202067, .3894183423, .4794255386, .5646424734, .6442176872

Check:=proc(n)
local L;
L:=ifactors(n);
if n>1 and type(n,odd) and (not isprime(n)) and `and`(map(t->is(t[2]=1),L[2])[]) and `or`(map(t->is(irem(n-1,t[1]-1)=0),L[2])[]) then true else false fi;
end proc: 

Example of use:
Check(561);
                           
 true


The previous answer skipped checking of square free.

restart: 
with(plots):
animate(plot, [[sqrt(x)-1, sqrt(x)], x = 0..t, filled = true, color=["Blue", "Red"], view = [0..20, 0..5]], t = 0..20);

    

Edit.

with(plots):
r:=<cos(t), sin(t), t>:
dr:=diff(r, t):
A:=spacecurve(r, t = -5 .. 5, color=black):
B:=seq(spacecurve(r+s*dr, s = -2 .. 2, color=black), t = -5 .. 5, 0.1):
display(A,B, view=[-1..1,-1..1,-5..5]);

    

Addition. We can also animate this:

with(plots):
r:=<cos(t), sin(t), t>:
dr:=diff(r, t):
A:=spacecurve(r, t = -5 .. 5, color=black):
B:=b->seq(spacecurve(r+s*dr, s = -2 .. 2, color=black, thickness=0), t = -5 .. b, 0.1):
animate(display,['B'(b)], b=-5..5, frames=100, background=A, view=[-1..1,-1..1,-5..5], orientation=[60,55]);

   

P:= proc(n::posint)
option remember;
   if n=1 then return 1 fi;
   if type(P(n-1)+1,prime) then return P(n-1)+1 else
   if type(P(n-1),even) then return (n-1)+2 else P(n-1)+3 fi; fi;
end proc:

seq(P(n), n=1..20);
    
1, 2, 3, 6, 7, 10, 11, 14, 10, 11, 14, 13, 16, 17, 20, 17, 20, 19, 22, 23

The code above exactly corresponds to the conditions set by you in the first post.

To get the sequence you suggest, you must write

P:= proc(n::posint)
option remember;
   if n=1 then return 1 fi;
   if type(P(n-1)+1,prime) then return P(n-1)+1 else
   if type(P(n-1),even) then return P(n-1)+2 else P(n-1)+3 fi; fi;
end proc:

seq(P(n), n=1..20);
       
 1, 2, 3, 6, 7, 10, 11, 14, 16, 17, 20, 22, 23, 26, 28, 29, 32, 34, 36, 37

Edit.

First 86 87 88 89 90 91 92 Last Page 88 of 290