Kitonum

20726 Reputation

26 Badges

16 years, 151 days

MaplePrimes Activity


These are answers submitted by Kitonum

Examples:

restart;
L:=[a,b,c,d]:
L1:=map(t->t$3, L);
combinat:-permute(L1, 3);
nops(%);
combinat:-choose(L1, 3);
nops(%);

 

 

I think you are working in the real domain. So

restart;
is(-ln(1/c)=ln(c)) assuming c>0;

                                                 true

You can easily do this using the  InertForm  package:

restart;
b := Matrix(3, 6, [[-1/2, 0, 1/2, 0, 0, 0], [0, 0, 0, -1/2, 0, 1/2], [0, -1/2, -1/2, 1/2, 1/2, 0]]);
InertForm:-Display((1/2)%*(2*b), inert=false);

                                 

 

To plot arrows at the ends of the axes, as well as for labels for the axes (near the ends of the axes), you can use the tools of the  plots  package:

restart;
with(plots):
y:=x->1/abs(x):
arrow_x:=arrow([-4.7,0],[9.4,0], width=0, head_width=0.2, head_length=0.3, shape=arrow):
arrow_y:=arrow([0,-0.7],[0,6.4], width=0, width=0, head_width=0.3, head_length=0.2, shape=arrow):
label_x:=textplot([4.5,-0.3,"x"], font=[times,bold,16]):
label_y:=textplot([-0.5,5.5,"y"], font=[times,bold,16]):
display(plot(y, -4.7..4.7, -0.7..5.7, color=red, thickness=2), arrow_x, arrow_y, label_x, label_y);

                               


To avoid labels for the axes that Maple builds by default, we used the operator form of specifying the function  plot(y, -4.7 .. 4.7, ... )

Maple already has such a built-in procedure called the  combinat:-randperm  (random permutation).

Example of use:

restart;
randomize():
n:=70: m:=30:
combinat:-randperm([1$n, 0$m]);

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

As a possible alternative to the  surd  command, you can call the RealDomain package first:

restart;
with(RealDomain):
plot(x^(1/3), x=-10..10);

 

A linear polynomial  x - (-8.0)^(1/3)  has a single root. It is called the principal value of a root. To find all the roots (numerically and symbolically) do

fsolve(x^3-(-8.0), complex);
solve(x^3-(-8));

                                  -2., 1.-1.73205080756888*I, 1.+1.73205080756888*I
                                           -2, 1-I*sqrt(3), 1+I*sqrt(3)

I don't see a worksheet here. 0.*I  can be simplified like this

restart;
simplify(0.*I, zero);
convert(%, rational);

You can use the  assign  command for this:

restart;
L:=<<1 | 2 | 3>; <4 | 5 | 6>>; 
assign(seq('L'[q,  q+1]=0 , q=1..2)):
L;

 
Addition:  You can specify the matrix L shorter by  L := <1,2,3; 4,5,6>;                                         

To obtain a real solution, it can be useful to indicate ranges  for the unknowns:

fsolve({eq1, eq2, eq3}, {A = -1000 .. 1000, B = -1000 .. 1000, P = -1000 .. 1000});
   

 {A = -433.53753742943393337,   B = 851.37601658861368581,   P = 2.6078455290044397554}

Maple does not understand arbitrary sums with an incomprehensible number of terms. The sum must be specific. For such sums the  add  command should be used:

An example:

restart;
fcn1:=add(N[i]*z[i]^2, i=1..10):
diff(fcn1, N[3]);

                                                   

 

Both solutions are correct, as confirmed by the  odetest  command. One solution is obtained from another simply by replacing arbitrary constants:

``

(1)

interface(version);

`Standard Worksheet Interface, Maple 2018.2, Windows 10, October 23 2018 Build ID 1356656`

(2)

Physics:-Version();

"C:\Program Files\Maple 2018\lib\update.mla", `2018, October 24, 4:22 hours, version in the MapleCloud: unable to determine, version installed in this computer: not installed`

(3)

restart;

ode :=[diff(x(t), t) = (3*x(t))/2 + 2*y(t), diff(y(t), t) = x(t)/2 + y(t)];
Sol:=dsolve(ode);
odetest(Sol, ode);

[diff(x(t), t) = (3/2)*x(t)+2*y(t), diff(y(t), t) = (1/2)*x(t)+y(t)]

 

{x(t) = _C1*exp((1/4)*(5+17^(1/2))*t)+_C2*exp(-(1/4)*(-5+17^(1/2))*t), y(t) = (1/8)*_C1*exp((1/4)*(5+17^(1/2))*t)*17^(1/2)-(1/8)*_C2*exp(-(1/4)*(-5+17^(1/2))*t)*17^(1/2)-(1/8)*_C1*exp((1/4)*(5+17^(1/2))*t)-(1/8)*_C2*exp(-(1/4)*(-5+17^(1/2))*t)}

 

[0, 0]

(4)

Sol1:=simplify(dsolve(ode,[x(t),y(t)]));

{x(t) = -(1/2)*_C2*(17^(1/2)-1)*exp(-(1/4)*(-5+17^(1/2))*t)+(1/2)*_C1*exp((1/4)*(5+17^(1/2))*t)*(17^(1/2)+1), y(t) = _C1*exp((1/4)*(5+17^(1/2))*t)+_C2*exp(-(1/4)*(-5+17^(1/2))*t)}

(5)

odetest(Sol1, ode);

[0, 0]

(6)

Sol2:=simplify(eval(Sol,[_C1=_C1*(sqrt(17)+1)/2, _C2=-_C2*(sqrt(17)-1)/2]));

{x(t) = -(1/2)*_C2*(17^(1/2)-1)*exp(-(1/4)*(-5+17^(1/2))*t)+(1/2)*_C1*exp((1/4)*(5+17^(1/2))*t)*(17^(1/2)+1), y(t) = _C1*exp((1/4)*(5+17^(1/2))*t)+_C2*exp(-(1/4)*(-5+17^(1/2))*t)}

(7)

is(Sol2=Sol1);

true

(8)

 

Download why_solution_changes_nov_27_2023_new.mw

Expr:=3/16-3/16*m2^2-m2/4*tanh(2*k-2*c)+m2/16*tanh(4*k+2*c)-m2/4*tanh(2*k+2*c)+3*m2/8*tanh(2*c);
select(t->has(t,tanh), Expr);

You use the same name to create different objects: a point in 3d and a procedure. Use a different name, for example:

restart;
with(geom3d):
Point:=(a,b,c)->point(P, a,b,c);
detail(Point(1,2,3));

Point := proc (a, b, c) options operator, arrow; geom3d:-point(P, a, b, c) end proc

 

Geom3dDetail(["name of the object", P], ["form of the object", point3d], ["coordinates of the point", [1, 2, 3]])

(1)

 


 

Download Point.mw

First 6 7 8 9 10 11 12 Last Page 8 of 285