Kitonum

21525 Reputation

26 Badges

17 years, 74 days

MaplePrimes Activity


These are answers submitted by Kitonum

Example a) 
Let  the points E(1,0), F(0,1), G(0,3), H(3,0). The Green's Theorem 
{\displaystyle \oint \limits _{C}(P\,dx+Q\,dy)=\iint \limits _{D}\left({\frac {\partial Q}{\partial x}}-{\frac {\partial P}{\partial y}}\right)\,dx\,dy}

restart;
with(VectorCalculus):
SetCoordinates(cartesian[x, y]):
P:=x^2*y: Q:=x*y^2:
I1:=LineInt(VectorField(<P, Q>), Path(<cos(t), sin(t)>, t=0..Pi/2)): # Integration along the EF curve
I2:=LineInt(VectorField(<P, Q>), Path(<0,t>, t=1..3)): # Integration along the FG curve
I3:=LineInt(VectorField(<P, Q>), Path(<3*cos(t),3*sin(t)>, t=Pi/2..0)): # Integration along the GH curve
I4:=LineInt(VectorField(<P, Q>), Path(<t,0>, t=3..1)): # Integration along the HE curve
A:=I1+I2+I3+I4; # Left side of Green's formula
B:=int(eval((diff(P,y)-diff(Q,x))*r, [x=r*cos(t),y=r*sin(t)]), [r=1..3, t=0..Pi/2]); # Right side of Green's formula


Example b) can be solved similarly.

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],[0.01,0], width=0, head_width=0.2, head_length=0.3, shape=arrow):
arrow_y:=arrow([0,5.7],[0,0.01], 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, ... )

Edited.

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);
First 11 12 13 14 15 16 17 Last Page 13 of 290