Kitonum

21830 Reputation

26 Badges

17 years, 219 days

MaplePrimes Activity


These are answers submitted by Kitonum

It is easy to prove that your second graph is empty. Probably you rewrote something wrong. I modified the second equation a bit to make the graph look like your second graph in the picture:


 

restart;
z:=x+I*y;
eq1:=evalc(abs(z-1)+abs(z-I)=2);
eq2:=evalc(abs(abs(z-1)-abs(z+1))=1);
plots:-implicitplot(eq1, x=-4..4, y=-4..4, color=red, gridrefine=3);
plots:-implicitplot(eq2, x=-4..4, y=-4..4, color=blue, gridrefine=3);

x+I*y

 

((x-1)^2+y^2)^(1/2)+(x^2+(y-1)^2)^(1/2) = 2

 

abs(((x-1)^2+y^2)^(1/2)-((x+1)^2+y^2)^(1/2)) = 1

 

 

 

 



Edit. Let us prove that the equation  abs(z-I) - abs(z+1)  =  2  has no solutions for complex numbers  z=x+I*y . This is most easily done using the fact that   abs(z1 - z2)  is the distance between the points  z1  and  z2 . Consider 3 points  z1=Iz2=-1 and  . It follows from the triangle inequality that  abs(z-z1) - abs(z-z2) < abs(z1-z2) = sqrt(2)<2

Download z.mw

If you need to do this more than once, then (as a development of vv's idea) a simple procedure  Sort  can be used to reduce typing:

restart;
S:=[seq(_C||k=c[k], k=0..10)]:
sol:=dsolve(diff(y(x),x) = x+y(x),y(x));

Sort:=s->sort(subs(S,s)):

Sort(sol); 

 

Use  piecewise  instead of  if .. fi  :


 

restart; u1 := (1/960000)*(((x__A-200)^2+y__A^2)*0.1e-2); w := piecewise(u1 <= 0.1e-2, -.5772-ln(u1), -.5772-ln(u1)+u1-u1^2/(2*factorial(2))+u1^3/(3*factorial(3))-u1^4/(4*factorial(4))+u1^5/(5*factorial(5))-u1^6/(6*factorial(6))+u1^7/(7*factorial(7))-u1^8/(8*factorial(8))+u1^9/(9*factorial(9))-u1^10/(10*factorial(10))+u1^11/(11*factorial(11))-u1^12/(12*factorial(12)))

u1 := 1.041666667*10^(-9)*(x__A-200)^2+1.041666667*10^(-9)*y__A^2

 

piecewise(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2 <= 0.1e-2, -.5772-ln(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2), -.5772-ln(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)+0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2-(1/4)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^2+(1/18)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^3-(1/96)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^4+(1/600)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^5-(1/4320)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^6+(1/35280)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^7-(1/322560)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^8+(1/3265920)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^9-(1/36288000)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^10+(1/439084800)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^11-(1/5748019200)*(0.1041666667e-8*(x__A-200)^2+0.1041666667e-8*y__A^2)^12)

(1)

s := 6.87*10^(-3)*w; plot3d(s, x__A = -1300 .. 200, y__A = -1300 .. 200)

 

``


 

Download if_new.mw

I do not know the reasons for this behavior, but to immediately get the desired position of the constants use the  sort  command:

restart;
ode:=diff(diff(y(x),x),x)+8*diff(y(x),x)+25*y(x) = 1:
sol:=sort(dsolve(ode));

                    


This code in Maple 2018.2

Here is another proof without complex numbers using the well-known rotation matrix by an angle. We take the unit vector  <1,0>  and rotate it first by the angle of  2*x , we get the vector  . Rotating the same vector  <1,0>  sequentially, first by the angle  , and then again by , we get a vector  . Obviously  X=Y . At the same time, we proved another formula  cos(2*x)=cos(x)^2-sin(x)^2 .


 

restart;
A:=<cos(x),-sin(x); sin(x),cos(x)>;  # The rotation matrix by the angle x
v:=<1,0>;
X:=eval(A,x=2*x).v;
Y:=A.(A.v);

X[2]=Y[2]; # The desired equality

Matrix(2, 2, {(1, 1) = cos(x), (1, 2) = -sin(x), (2, 1) = sin(x), (2, 2) = cos(x)})

 

Vector(2, {(1) = 1, (2) = 0})

 

Vector(2, {(1) = cos(2*x), (2) = sin(2*x)})

 

Vector[column](%id = 18446746521234725454)

 

sin(2*x) = 2*sin(x)*cos(x)

(1)


 

Download proof.mw

 

You are probably interested in calculating the area of the region bounded by a red closed curve below (this is not an ellipse of course).
It's easy to do numerically:


 

restart;
A:=plots:-implicitplot(y^2 = x^3 - 3*x - 1, x=-2..0, y=-1..1):
B:=plot(x^3 - 3*x - 1, x=-2..0,-1..1):
plots:-display(A,B, color=[red,blue]);
R:=[fsolve(x^3 - 3*x - 1, x=-2..0)];
2*int(sqrt(x^3 - 3*x - 1), x=R[1]..R[2], numeric);

 

[-1.532088886, -.3472963553]

 

1.848519838

(1)

 


 

Download int.mw

 

To solve your example, it is enough to know the simplest definitions related to the joint distribution of two random variables  X  and  Y . Let's introduce the notations:  f__XY  is the density function of the joint distribution of  X  and  Yf__X  is the density function of  X ,  f__Y  is the density function of  Y ,  f__X_Y  is the density function of the conditional distribution of  X  given  ,   f__Y_X  is the density function of the conditional distribution of  Y  given  .


 

restart;
f__XY:=(x,y)->piecewise(x>0 and x<y and y<1, 2, 0);
f__X:=x->int(f__XY(x,y), y=0..1);
f__Y:=y->int(f__XY(x,y), x=0..1);
f__X_Y:=(x,y)->f__XY(x,y)/f__Y(y);
f__X_Y(x,y); # The answer to question 1
f__X_Y(0.3,0.7);  # Example of use
f__Y_X:=(x,y)->f__XY(x,y)/f__X(x);

f__XY := proc (x, y) options operator, arrow; piecewise(0 < x and x < y and y < 1, 2, 0) end proc

 

f__X := proc (x) options operator, arrow; int(f__XY(x, y), y = 0 .. 1) end proc

 

f__Y := proc (y) options operator, arrow; int(f__XY(x, y), x = 0 .. 1) end proc

 

f__X_Y := proc (x, y) options operator, arrow; f__XY(x, y)/f__Y(y) end proc

 

piecewise(0 < x and x < y and y < 1, 2, 0)/(2*y*piecewise(y < 0, 0, 1)-2*piecewise(y < 1, 0, 1)*y)

 

1.428571429

 

proc (x, y) options operator, arrow; f__XY(x, y)/f__X(x) end proc

(1)

int(f__X_Y(x,0.7), x=0.5..1);  # The answer to question 2

.2857142857

(2)

 


 

Download XY.mw

You have chosen too narrow a range of values for the contours. If we increase it, we get more interesting pictures, for example:

restart;
randomize():
a, b, c_3, c_4, A_5:='rand(-5..5)'()$5;
A := a*(A_5)^3-b; B := 3*a*(A_5)^2-3*b/(A_5); C := (c_3)*(A_5)-(c_4);
u:=3*y^2+2*x^3*B/A+3*x^2*C/A;
plots:-contourplot(u, x=-2.25..2.25, y=-2.25..2.25, axes=boxed, contours=[seq(-10..10,1)],grid=[200,200], coloring=["Blue","Red"], size=[500,500]);

                                

Below are 2 solutions to the problem. In the first one, we randomly set all the necessary parameters. In the second one, we use  Explore  command for this:


 

``

restart;
randomize():
a, b, c_3, c_4, A_5:='rand(-5..5)'()$5;
A := a*(A_5)^3-b; B := 3*a*(A_5)^2-3*b/(A_5); C := (c_3)*(A_5)-(c_4);
u:=3*y^2+2*x^3*B/A+3*x^2*C/A;

-5, 4, -4, 5, 2

 

-44

 

-66

 

-13

 

3*y^2+3*x^3+(39/44)*x^2

(1)

plots:-contourplot(u, x=-2.25..2.25, y=-2.25..2.25, axes=boxed, contours=[seq(-2.5..-1.3,0.1)], grid=[80,80], coloring=["Blue","Red"], size=[500,500]);

 

 

restart;
P:=[a, b, c_3, c_4, A_5]:
A := a*(A_5)^3-b; B := 3*a*(A_5)^2-3*b/(A_5); C := (c_3)*(A_5)-(c_4);
u:=3*y^2+2*x^3*B/A+3*x^2*C/A;
Explore(plots:-contourplot(u, x=-2.25..2.25, y=-2.25..2.25, axes=boxed, contours=[seq(-2.5..-1.3,0.1)], grid=[80,80], coloring=["Blue","Red"], size=[500,500]), parameters= (P=~ -5..5));

A_5^3*a-b

 

3*a*A_5^2-3*b/A_5

 

A_5*c_3-c_4

 

3*y^2+2*x^3*(3*a*A_5^2-3*b/A_5)/(A_5^3*a-b)+3*x^2*(A_5*c_3-c_4)/(A_5^3*a-b)

(2)

``


MaplePrime did not display the result of the last command. See the attached file for this.

 

Download contour_new.mw


 

restart;

eq9_30 := T__e_n = 2*(s/s_hat) / ((1+r*s/s_hat)^2+(s/s_hat)^2);

T__e_n = 2*s/(s_hat*((1+r*s/s_hat)^2+s^2/s_hat^2))

(1)

eq9_31 := solve(diff(rhs(eq9_30), s)=0,s);

s_hat/(r^2+1)^(1/2), -s_hat/(r^2+1)^(1/2)

(2)

eq9_32a :=  T__e_np = simplify(subs(s=eq9_31[1] , rhs(eq9_30))) assuming r::real;

T__e_np = (r^2+1)^(1/2)/(r^2+(r^2+1)^(1/2)*r+1)

(3)

Desired := T__e_np = 1/(sqrt(r^2 + 1) + r);

T__e_np = 1/((r^2+1)^(1/2)+r)

(4)

simplify(algsubs(r^2+1=t^2,eq9_32a)) assuming t>0;

T__e_np = 1/(r+t)

(5)

subs(t=sqrt(r^2+1), %);

T__e_np = 1/((r^2+1)^(1/2)+r)

(6)

 


Addition - another way:

T__e_np := sqrt(r^2+1)/(r^2+sqrt(r^2+1)*r+1);
numer(T__e_np)*sqrt(r^2+1)/expand(denom(T__e_np)*sqrt(r^2+1));
simplify(%);

                      

 

Download Q20201208_new.mw

Maple simply doesn't know what it should return if  k  is a symbol. Therefore, we must provide for this in the body of the procedure. Below is a possible solution to the problem:
 

restart;

divide5_new := proc(g, k)
  local x, r;
  if type(k,numeric) then if k < 3 then return 0 else return unapply((1/5)*g(i, x), i, x) fi;
else return piecewise(k<3,0,unapply((1/5)*g(i, x),i,x)) fi;
end proc:

# Examples

f :=  (i,x) -> x^2+i :

f1 := divide5_new(f, i);
f2 := divide5_new(f, 2);
f3 := divide5_new(f, 4);

piecewise(i < 3, 0, proc (i, x) options operator, arrow; (1/5)*x^2+(1/5)*i end proc)

 

0

 

proc (i, x) options operator, arrow; (1/5)*x^2+(1/5)*i end proc

(1)

 


 

Download divide5_new.mw

  BrettKnoss I have simplified  Carl's code a bit. I think this will make it clearer for you. To study the convergence at the ends of the convergence interval, we used the n-th term test: If , then the series diverges  (from wiki)  . Since the results are not 0, the series diverges at both ends.

restart;
f:= (x-1)/(x+2);
s:= convert(f, FormalPowerSeries);
c:= unapply(op([2,1],s), k);
L:= limit(abs(c(k+1)/c(k)), k= infinity);
solve(L < 1, x);
``;
# Investigation on the ends
RealDomain:-limit(eval(c(k),x=-2),k=infinity); 
RealDomain:-limit(simplify(eval(c(k),x=2)),k=infinity);

                       

 

 

Download ic.mw

Procedure  P  returns the list of  N  pairs of such numbers  [p, q] :


 

restart;

P:=proc(N::posint)
local k, n, p, m, q, u;
uses NumberTheory;
k:=0;
for n from 1 do
p:=ithprime(n);
for m from 1 to n do
q:=ithprime(m);
if pi(p)=q-pi(q) then k:=k+1; u[k]:=[p,q]; break fi;
od;
if k=N then return convert(u,list) fi;
od;
end proc:

 

# Example of use
P(100);

[[2, 2], [13, 11], [17, 13], [29, 17], [31, 19], [43, 23], [67, 29], [71, 31], [97, 37], [107, 41], [109, 43], [131, 47], [157, 53], [181, 59], [191, 61], [223, 67], [233, 71], [239, 73], [269, 79], [281, 83], [313, 89], [359, 97], [379, 101], [383, 103], [401, 107], [409, 109], [431, 113], [503, 127], [523, 131], [569, 137], [571, 139], [619, 149], [631, 151], [659, 157], [691, 163], [719, 167], [751, 173], [787, 179], [797, 181], [857, 191], [859, 193], [881, 197], [883, 199], [971, 211], [1039, 223], [1061, 227], [1063, 229], [1091, 233], [1117, 239], [1123, 241], [1201, 251], [1231, 257], [1279, 263], [1301, 269], [1303, 271], [1361, 277], [1381, 281], [1399, 283], [1453, 293], [1549, 307], [1567, 311], [1571, 313], [1597, 317], [1693, 331], [1723, 337], [1789, 347], [1801, 349], [1831, 353], [1873, 359], [1931, 367], [1979, 373], [2003, 379], [2027, 383], [2069, 389], [2113, 397], [2137, 401], [2207, 409], [2273, 419], [2281, 421], [2347, 431], [2351, 433], [2383, 439], [2399, 443], [2441, 449], [2521, 457], [2543, 461], [2549, 463], [2579, 467], [2671, 479], [2707, 487], [2719, 491], [2777, 499], [2797, 503], [2837, 509], [2927, 521], [2939, 523], [3083, 541], [3137, 547], [3217, 557], [3257, 563]]

(1)

 


Edit.

Download P1.mw

In fact, we have a nonlinear inequality with the parameter . Maple usually cannot solve such inequality in a closed form. But it is easy to write a procedure  (named  F  below) that, for each value of the parameter , finds the corresponding range for  r . Now you can use this procedure by specifying values for c:

restart;
F:=c->solve({-r+c+1 + sqrt(r^2 - 2*r*c -r +2*c )<1, 0<r, r<1}, r):


Examples of use:

F(0.1), F(0.5), F(0.9);

             {r <= .2000000000, .1900000000 < r}, {.7500000000 < r, r < 1.}, {.9900000000 < r, r < 1.}

Using the  rand  command, we give your parameters some random values from the appropriate ranges:


 

NULL

restart;
with(DETools):
randomize():
a_1:=rand(1..5)():
b_1:=rand(2..7)():
c:=rand(1..8)():
d:=rand(0..4)():
e:=rand(0..10)():
A := a_1*c^3-b_1; B := 3*a_1*c^2-3*b_1/c; C := c*d-e;
sys := {diff(x(t), t) = y(t), diff(y(t), t) = (B*x(t)^2+C*x(t)-e)/A};
initialdataset:={seq(seq([x(0) = f, y(0) = g], f = -5 .. 5), g = -5 .. 5)}:
DEplot(sys, [x, y], t = -3 .. 3, initialdataset, x = -6 .. 6, y = -6 .. 6, colour = black, thickness = 2, style = line, linestyle = 1, axes = boxed, linecolor = red, scaling = constrained, arrows = medium);

622

 

1866/5

 

-5

 

{diff(x(t), t) = y(t), diff(y(t), t) = (3/5)*x(t)^2-(5/622)*x(t)-5/311}

 

 

 


If you want your initial parameters to take not only integers, but also fractional values in float format, then write  a_1:=rand(1...5.)() and so on. I have not set values for  f  and  g  parameters, so Maple builds not one, but a whole family of curves. Of course, you yourself can set these parameters in the same way.

Download rand.mw

First 47 48 49 50 51 52 53 Last Page 49 of 292