Kitonum

21163 Reputation

26 Badges

16 years, 222 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;
z1:=2+3*I:
z2:=I:
op(z1);
op(z2);

                                                                         2, 3
                                                                          1

A reliable way to iterate over the sum of multiple terms is to simply make those terms elements of a list.

restart:
with(plottools): with(plots):
u:=[2,2]: v:=[2,-1]:
G1:=seq(line(-5*u+t*v,5*u+t*v,linestyle=2), t=-5..5):
G2:=seq(line(s*u-5*v,s*u+5*v,linestyle=2), s=-5..5):
U:=arrow(u, color=red, width=0.2):
V:=arrow(v, color=red, width=0.2):
plots:-display(U,V,G1,G2, size=[700,700], scaling=constrained, axes=none);
    

We have to use the  parametric  option:

restart;
solve({-x1+2*x2+(2-p)*x3=0,(2-p)*x2+x3=2, (1-p)*x1+2*x2+2*x3=p+3}, {x1,x2,x3}, parametric=true):
value(%);

   

Your syntax is correct and works successfully, but the following small improvements can be made:

1. The inequality  y>-1  can be omitted, since your region is itself above the line  y=-1 .
2. The  optionsexcluded = (color = white)  option can also be omitted, as it is done by default.
3. I equalized the ranges along the axes and shortened them a bit. With equal ranges, all shapes are unchanged and the  scaling=constrained  option is not required.

restart: with(plots):
inequal({y >= x^2+1, (x-1)^2+(y-1)^2 <= 16}, x = -3.5 .. 5.5, y = -3.5 .. 5.5, optionsfeasible = (color = grey));

       

Use the  factor  command for this:

factor(f);

                    A*sin(x)*theta(x)*(-m*omega^2+k)

By default, Maple calculates with 10 significant digits. Therefore, for a sufficiently large   of float type, we get ln(x+1) - ln(x) = 0. . If we increase the accuracy of the calculations, then the error disappears:

restart;
f := x->4*x*(ln(x+1)-ln(x)):
Digits := 50: 
evalf[10]~([seq(f(10.^n), n = 1 .. 10)]);

  [3.812407192, 3.980132341, 3.998001332, 3.999800013, 3.999980000, 3.999998000, 3.999999800, 3.999999980, 3.999999998, 4.000000000]

We can simply calculate this determinant and, equating it to  , we get a 4th degree equation for  w  with 2 parameters  d  and  k . Giving some values to these parameters, we find all values of  w . In the example below we find the real  d=2, k=1, w=sqrt(3)/3  for which  the determinant  is  0 :


 

restart;

with(LinearAlgebra):

A := Matrix([[k*w-1/sqrt(3), 0, 4*sqrt(2/3)+3*sqrt(2)*w*d, 4*sqrt(2/3)-3*sqrt(2)*w*d], [0, k*w-1/sqrt(3), 4*sqrt(2/3)+3*sqrt(2)*w*d, 4*sqrt(2/3)-3*sqrt(2)*w*d], [(1/2)*w*d+sqrt(2/3), 0, k*w+k*d/sqrt(3)-w*d-I*w*d-1/sqrt(3), I*w*d-1/sqrt(3)], [0, -(1/2)*w*d+sqrt(2/3), -I*w*d-1/sqrt(3), k*w-k*d/sqrt(3)+w*d+I*w*d-1/sqrt(3)]]);

Matrix(4, 4, {(1, 1) = k*w-(1/3)*sqrt(3), (1, 2) = 0, (1, 3) = (4/3)*sqrt(6)+3*sqrt(2)*w*d, (1, 4) = (4/3)*sqrt(6)-3*sqrt(2)*w*d, (2, 1) = 0, (2, 2) = k*w-(1/3)*sqrt(3), (2, 3) = (4/3)*sqrt(6)+3*sqrt(2)*w*d, (2, 4) = (4/3)*sqrt(6)-3*sqrt(2)*w*d, (3, 1) = (1/2)*w*d+(1/3)*sqrt(6), (3, 2) = 0, (3, 3) = k*w+(1/3)*k*d*sqrt(3)-w*d-I*w*d-(1/3)*sqrt(3), (3, 4) = I*w*d-(1/3)*sqrt(3), (4, 1) = 0, (4, 2) = -(1/2)*w*d+(1/3)*sqrt(6), (4, 3) = -I*w*d-(1/3)*sqrt(3), (4, 4) = k*w-(1/3)*k*d*sqrt(3)+w*d+I*w*d-(1/3)*sqrt(3)})

(1)

B:=Determinant(A);
Eq:=eval(B,[d=2,k=1]);
solve(Eq);
eval(B,[d=2,k=1,w=sqrt(3)/3]); # Check

(2/3)*k^2*w^2*6^(1/2)*2^(1/2)*d^2*3^(1/2)-((4/3)*I)*k^2*w^2*d^2-3*k^2*w^4*d^2*2^(1/2)+(2/3)*k^3*w^3*d^2*3^(1/2)+(2/9)*k^3*w*d^2*3^(1/2)-(4/3)*k*w^3*d^2*6^(1/2)+(2/3)*k*w^3*3^(1/2)*d^2+(4/9)*3^(1/2)*w^2*d^2*6^(1/2)+(2/9)*k*d^2*3^(1/2)*w-(4/9)*w*d^2*6^(1/2)*k-(2*I)*k^2*w^4*d^2+k^4*w^4-(1/9)*k^2*d^2-(11/3)*k^2*w^2-(1/3)*w^2*d^2-(2/3)*6^(1/2)*2^(1/2)*w*d^2*k-2*k*w^3*6^(1/2)*2^(1/2)*d^2+3*k*w^3*d^2*2^(1/2)*3^(1/2)+(4/9)*k^2*w^2*d^2*6^(1/2)*3^(1/2)+(2/3)*3^(1/2)*6^(1/2)*2^(1/2)*w^2*d^2+((2/9)*I)*k*d^2*3^(1/2)*w+((4/3)*I)*k*w^3*3^(1/2)*d^2-((8/3)*I)*k*w^3*d^2*6^(1/2)+((2/3)*I)*k^3*w^3*d^2*3^(1/2)+((8/9)*I)*3^(1/2)*w^2*d^2*6^(1/2)+(14/9)*3^(1/2)*k*w-(4/3)*k^3*w^3*3^(1/2)-((2/3)*I)*w^2*d^2-2*2^(1/2)*w^2*d^2-(4/3)*k^2*w^2*d^2-(1/3)*k^4*w^2*d^2-k^2*w^4*d^2

 

-4/9+(32/9)*3^(1/2)*w^2*6^(1/2)-(8*I)*w^4+(8*I)*w^3*3^(1/2)-((32/3)*I)*w^3*6^(1/2)+((32/9)*I)*3^(1/2)*w^2*6^(1/2)-8*w^3*6^(1/2)*2^(1/2)-12*w^4*2^(1/2)+4*w^3*3^(1/2)+(10/3)*w*3^(1/2)-(16/3)*w^3*6^(1/2)-(16/9)*w*6^(1/2)+12*w^3*2^(1/2)*3^(1/2)-(8/3)*6^(1/2)*2^(1/2)*w-(8*I)*w^2+((8/9)*I)*3^(1/2)*w-8*2^(1/2)*w^2-3*w^4+(16/3)*3^(1/2)*6^(1/2)*2^(1/2)*w^2-(35/3)*w^2

 

(1/15533733556225593)*(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)-15533733556225593*((-180775148479/388495499643+(111022067624/388495499643)*I)+(50106305920/388495499643)*2^(1/2)-((71540531744/388495499643)*I)*2^(1/2))/(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)+((40928/1079577)*I)*3^(1/2)*2^(1/2)+(174083/1079577)*3^(1/2)-(267316/1079577)*3^(1/2)*2^(1/2)-((50632/359859)*I)*3^(1/2), -(1/31067467112451186)*(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)+(15533733556225593/2)*((-180775148479/388495499643+(111022067624/388495499643)*I)+(50106305920/388495499643)*2^(1/2)-((71540531744/388495499643)*I)*2^(1/2))/(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)+((40928/1079577)*I)*3^(1/2)*2^(1/2)+(174083/1079577)*3^(1/2)-(267316/1079577)*3^(1/2)*2^(1/2)-((50632/359859)*I)*3^(1/2)+((1/2)*I)*3^(1/2)*((1/15533733556225593)*(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)+15533733556225593*((-180775148479/388495499643+(111022067624/388495499643)*I)+(50106305920/388495499643)*2^(1/2)-((71540531744/388495499643)*I)*2^(1/2))/(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)), -(1/31067467112451186)*(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)+(15533733556225593/2)*((-180775148479/388495499643+(111022067624/388495499643)*I)+(50106305920/388495499643)*2^(1/2)-((71540531744/388495499643)*I)*2^(1/2))/(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)+((40928/1079577)*I)*3^(1/2)*2^(1/2)+(174083/1079577)*3^(1/2)-(267316/1079577)*3^(1/2)*2^(1/2)-((50632/359859)*I)*3^(1/2)-((1/2)*I)*3^(1/2)*((1/15533733556225593)*(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)+15533733556225593*((-180775148479/388495499643+(111022067624/388495499643)*I)+(50106305920/388495499643)*2^(1/2)-((71540531744/388495499643)*I)*2^(1/2))/(265611425454935876316467597144620549893660289104*3^(1/2)-(782587540494658069900310508971611944375274105332*I)*3^(1/2)-373958946518800334108935688358258767448051176244*3^(1/2)*2^(1/2)+(498726741960108955283603614246046968199121550272*I)*3^(1/2)*2^(1/2)+9648094810073959321974105771237467499*(-(262494030946006112448*I)*2^(1/2)+(-2910182786878860486173+2598854356561503484904*I)+1142251446558238597120*2^(1/2))^(1/2))^(1/3)), (1/3)*3^(1/2)

 

0

(2)

``

``


 

Download det_new.mw

restart;
with(Student[Calculus1]):
soln := Roots(y-0.4646295e-3*tanh(y)+0.1839145082e-2*tanh(y)/(0.6000000000e-3*y^2-0.1840000000e-2), y);
map(t->t*I, soln);
p := 8*T(x, 7)*T(x, 2)+4*T(x, 5)*T(x, 1)+6*T(x, 3)*T(x, 3)+7*T(x, 1)*T(x, 4):
map(t->content(t)*`if`(type(primpart(t),`*`),convert(primpart(t),`+`),op(1,primpart(t))*op(2,primpart(t))), p);

                              8*T(x, 7)+8*T(x, 2)+4*T(x, 5)+11*T(x, 1)+12*T(x, 3)+7*T(x, 4)

Here is an another simple way (without select):

{seq(`if`(a>=5 and a<=15,a,NULL),a=A)};

 

move all terms to the left and take the numerator of the resulting fraction. In this case, the  expand  command is not required:

van_der_Waals := (p + a / V[m]^2) * (V[m] - b) = R * T:
numer((lhs-rhs)(van_der_Waals));
sort(%, V[m]);

 

restart;
Expr:=-a2/3 + a3 - (2*a4)/3 - (2*a5)/3:
Expr1:=-``(-Expr*3)/3; # The desired form
expand(Expr1); # The original form

 

Use functional notation:

restart

with(LinearAlgebra)

with(PDEtools)

with(Physics)

with(plots)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1)

``

U := proc (i, t) options operator, arrow; Matrix([[1+I*(q(i+1, t)-q(i, t))/lambda, I*(r(i+1, t)-r(i, t))/lambda], [I*(r(i+1, t)-r(i, t))/lambda, 1-I*(q(i+1, t)-q(i, t))/lambda]]) end proc

proc (i, t) options operator, arrow; Matrix([[1+I*(q(i+1, t)-q(i, t))/lambda, I*(r(i+1, t)-r(i, t))/lambda], [I*(r(i+1, t)-r(i, t))/lambda, 1-I*(q(i+1, t)-q(i, t))/lambda]]) end proc

(2)

``

V := proc (i, t) options operator, arrow; Matrix([[-((1/2)*I)*lambda, -r(i, t)], [r(i, t), ((1/2)*I)*lambda]]) end proc

proc (i, t) options operator, arrow; Matrix([[-((1/2)*I)*lambda, -r(i, t)], [r(i, t), ((1/2)*I)*lambda]]) end proc

(3)

NULL

z := diff(U(i, t), t)+U(i, t).V(i, t)-V(i+1, t).U(i, t)

Matrix(%id = 18446746137203957622)

(4)

NULL

Download CD_new.mw

2 errors in your code. In the EqBIS procedure, P, U, V must be Vectors, not lists. Also remove the space after the procedure name in your example (which Maple interprets as a multiplication sign). I also removed the unnecessary command RETURN:

EqBIS := proc(P, U, V)
local a, eq1, M1, t, PU, PV, bissec1;
a := (P - U)/LinearAlgebra:-Norm(P - U, 2) + (P - V)/LinearAlgebra:-Norm(P - V, 2);
M1 := P + a*t;
eq1 := op(eliminate({x = M1[1], y = M1[2]}, t));
op(eq1[2]); end proc;

EqBIS(<4, 5>, <11, 7/3>, <11, 5>);

 

First 15 16 17 18 19 20 21 Last Page 17 of 287