Kitonum

21525 Reputation

26 Badges

17 years, 74 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;
ls:=["a", "b", "c", "d", "e"]:
selectremove(t->ListTools:-Search(t,ls)::odd, ls);

                        

 

The easiest way to solve the problem is to show your graphs in the  x  and  y ranges (using the  view  option), where the differences are clearly visible:

restart:
with(plots):
f1:=x->0.95*x;
f2:=x->0.99*x;
f3:=x->0.991*x;
p1:=plot(f1(x),x=0..10,color=red):
p2:=plot(f2(x),x=0..10,color=blue):
p3:=plot(f3(x),x=0..10,color=green):
P1:=display(p1,p2,p3, caption="Plot 1", captionfont=[times,16]); 
P2:=display(p1,p2,p3, view=[9.5..10,9.2..9.7],caption="Plot 2", captionfont=[times,16]);
display(<P1 | P2>);

  

 

Download plotting1.mw

Edit.

Maple finds the answer through elliptic functions. Unfortunately, the result is quite cumbersome:

restart;
y:=Int((k/2*x^2+x+c)/sqrt(lambda^2*(1+k*x)^4 - (k/2*x^2+x+c)^2), x);
value(y):
simplify(%);


Download Int.mw

Edit. In my opinion, the value of this overall result is rather dubious. With some parameters and variable  values, you can get  0 or negative numbers under the root. It is much more reliable to first set the values of the parameters, and only then calculate the integral.

Use  add  instead of  sum  when summing a specific finite number of terms. The  sum  command is used if at least one of the summation limits is a symbol or the infinity:

restart;
seq(add(x^r*(add((-1)^s*binomial(r, s)*pochhammer((a+s+1)*d, n), s = 0 .. r))/factorial(r), r = 0 .. n), n = 0 .. 4);

 

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

First 45 46 47 48 49 50 51 Last Page 47 of 290