Kitonum

19004 Reputation

26 Badges

14 years, 85 days

MaplePrimes Activity


These are answers submitted by Kitonum

See help  ?examples,Physics .

 

restart;
T[e]:=1.2: T[i]:=0.01: delta[p]:=0.2:
V:=n(x)^2*((T[e]+T[i])/T[e])*((((n(x)-1)*(1+1/(2*delta[p]))))-ln(n(x))-ln(n(x))+ln(2*delta[p]));
Eq:=diff(n(x),x)=sqrt(-2*V);
dsolve({Eq, n(0)=1}, n(x), numeric);
plots:-odeplot(%,[x,n(x)], x=0..1);

 

Example:

d:=gcdex(x^3-1, x^5-1, x, 's', 't');
s, t;
is(d=s*(x^3-1)+t*(x^5-1));

                           

 

restart;
`&I;` = (1/64)*(`&D;`^4-d^4)*Pi;

                                           

 

Example 1) :

geometry:-conic(c, x^2+x*y+y^2+2*x-2*y, [x, y]):
geometry:-detail(c);

Knowing the lengths of the major and minor semiaxes and the center, you can easily write down the standard equation of this ellipse.

restart;
ina := proc (n) false end :
a := proc (n) option remember; local k;
if n < 5 then k := 2*n-1
else for k from 2 while ina(k) or igcd(k, a(n-1)) <> 1 or igcd(k, a(n-2)) <> 1 or igcd(k, a(n-3)) <> 1
do  od; 
fi; ina(k) := true; k;
end proc:

m:=40:
L:=[seq([n,a(n)], n = 1 .. m)];
plot(L, view=[0..m,0..a(m)], size=[800,500]);

 

Use the  randpoly  command for this:

restart;
randomize():
for k from 1 to 54 do
pol[k]:=sort(x^4+randpoly(x, coeffs = rand(0. .. 2.), dense, degree = 3));
od;

 

NULL

restart; with(plots)

NULL

f := proc (x) options operator, arrow; (1/120)*x^3-(1/40)*x^2-(9/4)*x end proc

T := unapply(Student[Calculus1][Tangent](f(x), x = a), a); l := 10; d := unapply(l*abs(cos(arctan((D(f))(a)))), a)

G := plot(f(x), x = -20 .. 20, color = blue)

animate(plot, [[T(a), [[a, f(a)]]], x = a-d(a) .. a+d(a), style = [line, point], color = red, thickness = 3, symbolsize = 12], a = -16 .. 16, frames = 90, background = G, view = -20 .. 20)

 

``

Download QuestionAnim_new.mw

It works:

restart;
with(plots):
with(plottools):
Explore(plot([a*x^2, a*x^2+1], x=-1...1., -3..3), a=-1...1.);

restart

alias(phi = phi(x, t), chi = chi(x, t), psi = psi(x, t), rho = rho(x, t))

phi, chi, psi, rho

(1)

A := -phi*(2*epsilon1*conjugate(epsilon1)*psi*conjugate(epsilon2)*conjugate(phi)*epsilon2*conjugate(psi)+epsilon1^2*conjugate(epsilon1)^2*psi*conjugate(phi)*conjugate(psi)+chi*conjugate(epsilon2)*epsilon2*conjugate(psi)*conjugate(rho)+epsilon1*rho*conjugate(epsilon1)*conjugate(phi)*conjugate(rho)+epsilon2^2*psi*conjugate(epsilon2)^2*conjugate(phi)*conjugate(psi))*lambda1-conjugate(lambda1)*conjugate(chi)*(epsilon2*psi*rho*conjugate(epsilon2)*conjugate(phi)+chi*conjugate(epsilon1)*psi*epsilon1*conjugate(psi)+chi*rho*conjugate(rho));

-phi*(2*epsilon1*conjugate(epsilon1)*psi*conjugate(epsilon2)*conjugate(phi)*epsilon2*conjugate(psi)+epsilon1^2*conjugate(epsilon1)^2*psi*conjugate(phi)*conjugate(psi)+chi*conjugate(epsilon2)*epsilon2*conjugate(psi)*conjugate(rho)+epsilon1*rho*conjugate(epsilon1)*conjugate(phi)*conjugate(rho)+epsilon2^2*psi*conjugate(epsilon2)^2*conjugate(phi)*conjugate(psi))*lambda1-conjugate(lambda1)*conjugate(chi)*(epsilon2*psi*rho*conjugate(epsilon2)*conjugate(phi)+chi*conjugate(epsilon1)*psi*epsilon1*conjugate(psi)+chi*rho*conjugate(rho))

(2)

A1 := simplify(subs({chi = exp((I*lambda*(1/2))*x-I*t/lambda), phi = exp(-(I*lambda*(1/2))*x+I*t/lambda), psi = exp(-(I*lambda*(1/2))*x-I*t/lambda), rho = exp((I*lambda*(1/2))*x+I*t/lambda)}, A), trig)

(-exp(-((1/2)*I)*(lambda^2*x+2*t)/lambda)*exp(((1/2)*I)*(lambda^2*x+2*t)/lambda)*epsilon2*conjugate(lambda1)*conjugate(epsilon2)*exp(((1/2)*I)*conjugate((-lambda^2*x+2*t)/lambda))-(exp(-((1/2)*I)*(lambda^2*x+2*t)/lambda)*(epsilon1*conjugate(epsilon1)+epsilon2*conjugate(epsilon2))^2*exp(((1/2)*I)*conjugate((lambda^2*x+2*t)/lambda))+exp(((1/2)*I)*(lambda^2*x+2*t)/lambda)*exp(-((1/2)*I)*conjugate((lambda^2*x+2*t)/lambda))*epsilon1*conjugate(epsilon1))*lambda1*exp(((1/2)*I)*(-lambda^2*x+2*t)/lambda))*exp(-((1/2)*I)*conjugate((-lambda^2*x+2*t)/lambda))-exp(-((1/2)*I)*(-lambda^2*x+2*t)/lambda)*(conjugate(lambda1)*(exp(-((1/2)*I)*(lambda^2*x+2*t)/lambda)*exp(((1/2)*I)*conjugate((lambda^2*x+2*t)/lambda))*epsilon1*conjugate(epsilon1)+exp(((1/2)*I)*(lambda^2*x+2*t)/lambda)*exp(-((1/2)*I)*conjugate((lambda^2*x+2*t)/lambda)))*exp(((1/2)*I)*conjugate((-lambda^2*x+2*t)/lambda))+exp(((1/2)*I)*(-lambda^2*x+2*t)/lambda)*exp(((1/2)*I)*conjugate((lambda^2*x+2*t)/lambda))*exp(-((1/2)*I)*conjugate((lambda^2*x+2*t)/lambda))*lambda1*epsilon2*conjugate(epsilon2))

(3)

simplify(evalc(A1))

-lambda1*(epsilon1^2+epsilon2^2+1)^2

(4)

 

NULL

Download simplification_new.mw

If we plot the expression under the square root sign in the denominator, then we see that this expression, as a function of  t , takes on parts of the interval not only positive, but also negative values, and at some points it is equal to 0. Therefore, we are dealing with an improper integral from a complex-valued function. If this integral is calculated over the interval where this expression is positive, then the numeric result is obtained instantly:

restart;
Expr:=4*x*y*(y^4+2*x*y-2)/sqrt((1-(2*x*y)^2+(-3*y^2+1)^2)*(1+(y^2-1)^2));
plot(eval(op(1,denom(Expr)), [x,y]=~ [-(1+sqrt(2))*cos(t)-(sqrt(2)-1)*sin(t), cos(t)-sin(t)]), t=0..2*Pi);
evalf(Int(eval(Expr, [x, y] =~ [-(1+sqrt(2))*cos(t)-(sqrt(2)-1)*sin(t), cos(t)-sin(t)]),t=Pi/2 .. 3*Pi/4));

                

In the Real Domain for the cube root, use the  surd  command. Your equation can probably only be solved numerically:

restart;
plot([9*log10(x + 1), surd(x,3)], x=-1..1, -1.5..1.5);
Student:-Calculus1:-Roots(9*log10(x + 1)=surd(x,3), x=-1..1);

                                         
 

                                                 [ - 0.1179028301,  0.,  0.1432344750]

I'm guessing that this column of numbers is received in a loop. If you want to convert these numbers to a list, then just give an indexed name to each number and then use the  convert(... , list) command to get the desired list.

Example:

restart;
for n from 1 to 10 do
L[n]:=ithprime(n):
print(%);
od:

convert(L, list);

                               2
                               3
                               5
                               7
                               11
                               13
                               17
                               19
                               23
                               29
              [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
 

restart:
CartProd:=proc(L::list({set,list}))
local n;
n:=nops(L);
if n=1 then return L[1] else
[seq(seq([op(p),l], l=L[n]), p=thisproc(L[1..n-1]))] fi;
end proc:


Examples of use:

CartProd([{a,b,c},{e,f}]);

CartProd([[0,1]$4]);

        [[a, e], [a, f], [b, e], [b, f], [c, e], [c, f]]

   [[0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], 

     [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1], 

     [1, 0, 0, 0], [1, 0, 0, 1], [1, 0, 1, 0], [1, 0, 1, 1], 

     [1, 1, 0, 0], [1, 1, 0, 1], [1, 1, 1, 0], [1, 1, 1, 1]]
 

Let us carry out the simplest qualitative analysis of the behavior of the roots of the equation  f(q)=0 . First of all, we note that since the function  f  is even, it is enough to consider only positive roots (for each root  q0 , the number  -q0  is also a root). Let us show that on any interval  (Pi/2+Pi*(n-1), Pi/2+Pi*n), where  n  is an integer and positive, equation  f(q)=0  has at least 1 root. This immediately implies that the equation has infinitely many roots.
At the ends of the above interval, the function takes negative values (for n > 2) and is continuous except for the only point  q  for which the condition  tan(q) - q = 0  is satisfied. At this point, the sign of the function necessarily changes from   to  . Hence the existence of the root. The figure below illustrates this behavior. The vertical red line is the vertical asymptote at the point  q  for which  tan(q) - q = 0  . The root itself  q0  will be extremely close to the right end of the interval (even for relatively small  n), but always less than this end:

limit(f(q), q=Pi/2+n*Pi)  assuming n::posint;
eval(%, n=4);
plot(f, Pi/2+3*Pi..Pi/2+4*Pi, color=red); 

                                                                  -4.*n^2-4.*n+29.24999998
                                                                            -50.75000002
                                                  


To find roots in any interval, we can use the  RootFinding:-Analytic  command with success, but each individual calculation must be performed in some interval  Pi/2+Pi*(n-1) .. Pi/2+Pi*n :

restart:
  with(RootFinding):
  a[1]:= .1093: k[3]:= 7.5*10^(-12): k[2]:= 3.8*10^(-12):
  d:= 0.2e-3: eta[1]:= 0.240e-1: alpha[2]:= -.1104:
  alpha[3]:= -0.1104e-2: eta[2]:= .1361: xi:= 1.219*10^(-6):
  alpha:= 1-alpha[3]^2/(a[1]*eta[1]): theta[0]:= 0.5e-1:
  Hc:= (Pi/d)*sqrt(k[2]/xi):
  H:= 5.5*Hc:
  lambda:= a[1]/(xi*H^2):
  f:= unapply((H/Hc)^2-4*q^2*(tan(q)-q/(1-alpha))/(Pi^2*(tan(q)-q)),q);

for n from 0 to 100 do
r:=Analytic(f(q), re=Pi/2+Pi*(n-1)..Pi/2+Pi*n, im=-1..1);
L[n]:=[n,r];
od:
L:=convert(L, list);

                       
L := [[-1], [0, 1.57942376642640], [1, 4.71262209961613], 

  [2, 7.85399406399405, 10.9955581135723], [3, 14.1371463457335], 

  [4, 17.2787394247345], [5, 20.4203335662126], 

  [6, 23.5619278325359], [7, 26.7035219764330], 

  [8, 29.8451159450471], [9, 32.9867097430933], 

  [10, 36.1283033908297], [11, 39.2698969105772], 

  [12, 42.4114903225772], [13, 45.5530836440255], 

  [14, 48.6946768891667], [15, 51.8362700696975], 

  [16, 54.9778631952095], [17, 58.1194562735900], 

  [18, 61.2610493113535], [19, 64.4026423139095], 

  [20, 67.5442352857770], [21, 70.6858282307535], 

  [22, 73.8274211520490], [23, 76.9690140523910], 

  [24, 80.1106069341120], [25, 83.2521997992155], 

  [26, 86.3937926494325], [27, 89.5353854862630], 

  [28, 92.6769783110160], [29, 95.8185711248365], 

  [30, 98.9601639287295], [31, 102.101756723583], 

  [32, 105.243349510183], [33, 108.384942289227], 

  [34, 111.526535061337], [35, 114.668127827068], 

  [36, 117.809720586919], [37, 120.951313341338], 

  [38, 124.092906090730], [39, 127.234498835458], 

  [40, 130.376091575855], [41, 133.517684312220], 

  [42, 136.659277044826], [43, 139.800869773923], 

  [44, 142.942462499739], [45, 146.084055222482], 

  [46, 149.225647942343], [47, 152.367240659499], 

  [48, 155.508833374111], [49, 158.650426086328], 

  [50, 161.792018796289], [51, 164.933611504120], 

  [52, 168.075204209940], [53, 171.216796913859], 

  [54, 174.358389615977], [55, 177.499982316390], 

  [56, 180.641575015186], [57, 183.783167712447], 

  [58, 186.924760408250], [59, 190.066353102666], 

  [60, 193.207945795763], [61, 196.349538487603], 

  [62, 199.491131178245], [63, 202.632723867744], 

  [64, 205.774316556153], [65, 208.915909243520], 

  [66, 212.057501929892], [67, 215.199094615311], 

  [68, 218.340687299818], [69, 221.482279983453], 

  [70, 224.623872666251], [71, 227.765465348247], 

  [72, 230.907058029473], [73, 234.048650709960], 

  [74, 237.190243389737], [75, 240.331836068833], 

  [76, 243.473428747273], [77, 246.615021425082], 

  [78, 249.756614102284], [79, 252.898206778902], 

  [80, 256.039799454956], [81, 259.181392130468], 

  [82, 262.322984805456], [83, 265.464577479940], 

  [84, 268.606170153936], [85, 271.747762827462], 

  [86, 274.889355500534], [87, 278.030948173166], 

  [88, 281.172540845375], [89, 284.314133517173], 

  [90, 287.455726188574], [91, 290.597318859591], 

  [92, 293.738911530236], [93, 296.880504200521], 

  [94, 300.022096870458], [95, 303.163689540056], 

  [96, 306.305282209327], [97, 309.446874878281], 

  [98, 312.588467546926], [99, 315.730060215272], 

  [100, 318.871652883328]]


We see that there are no roots in the interval  -Pi/2 .. Pi/2 , and in each subsequent interval there will be one root, except for the case  n=2 .

2 3 4 5 6 7 8 Last Page 4 of 271