Kitonum

21530 Reputation

26 Badges

17 years, 84 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;
A:=(-cos(theta) + 1)*z^2  + cos(theta):
local cos: 
B:=op([1,2], A)*(1-cos(theta))+op(2, A):
B;

                                              

 

You are plotting a curve in space, not in a plane. Therefore, replace the last line of code with

plots:-spacecurve([x__1, x__2, x__3], t2 = 0 .. (1/3)*tau, color=red);

 

azido_displacement_new.mw

 

Replace the last line of your code with two lines:

V2:=x+I*y: V3:=u+I*v:
solve({eq1, eq2}, {x,y,u,v}) assuming real;
                                       
 {u = -1.*I*v, v = v, x = -1.*I*y, y = y}

The result obtained means that there are an infinite number of solutions depending on two parameters  y  and  v .

Use  plots:-contourplot  command instead. See help on this command.

PS. If you still want to use  listcontplot  command, then use a linear transformation  [1..m, 1..n]->[x1..x2, y1,,y2], which is given by the obvious formulas

F:=(x,y)->[x1+(x2-x1)/(m-1)*(x-1), y1+(y2-y1)/(n-1)*(y-1)]

and then  plottools:-transform command.

 

Edit.

For not too large numbers, I think  length  command is the best option. An alternative to length is ilog10  command:

length(12345678910);
ilog10(12345678910)+1;
                                                       
11
                                                        11

Moreover, length command probably uses  ilog10  in its code. However, both commands fail for very large numbers:

length(12345^(123456789));
ilog10(12345^(123456789))+1;
        
Error, numeric exception: overflow
        Error, numeric exception: overflow


The workaround is very simple - you just need to use the well-known property of logarithms:

floor(123456789*evalf[20](log10(12345))+1);
                                                           
505122353

 

 

Y := {Theta[i, j, 2]+2*Omega[i, j, 2]+4*GAMMA[i, j, 2], Omega[i, j, 1]+3*GAMMA[i, j, 1]+Omega[i, j, 2]+3*GAMMA[i, j, 2], -Theta[i, j, 1]+2*GAMMA[i, j, 1]+Omega[i, j, 2]+3*GAMMA[i, j, 2]};
nops(Y);

with the step  0.1 :

N:=40:
plot([seq([x,sin(x)], x=-2..2, (2-(-2))/N)], style=point, symbol=solidcircle);

# Or

x:=-2+n*0.1:
plot([seq([x, sin(x)], n=0..N)], style=point, symbol=solidcircle);

 

The equation  x^2-y^2+4*x=0  on the plane defines a hyperbola with the explicit equation  y=sqrt(x^2+4*x)  for  y>0 . Its asymptote will have the equation  y=x+2 . I understood this task how to find the smallest positive integer  x  so that the distance from the point on the graph to the asymptote was <0.001 . Here is a solution:

eq:=x^2-y^2+4*x:
sol:=solve(eq, y);
plot([solve(eq, y)[1], x+2], x=-3..8, -1..10, color=[red,blue], linestyle=[1,3]);
# Visualization
solve({x+2-sol[1]<0.001, x>0}, x);

                          


So the answer is  x=1999
 

You wrote "I want Maple to treat   as a constant and  u  as the variable..." Use a functional operator for this:

nu3 := u-> -sqrt(-2*sqrt(w)*sqrt(w+2)*u^4+2*u^4*w+4*sqrt(w)*sqrt(w+2)*u^2+u^4-4*u^2*w-2*sqrt(w)*sqrt(w+2)-2*u^2+w^2+2*w+1)+sqrt(-2*sqrt(w)*sqrt(w+2)*u^4+2*u^4*w+4*sqrt(w)*sqrt(w+2)*u^2+u^4-4*u^2*w-2*sqrt(w)*sqrt(w+2)-2*u^2+2*sqrt(-2*sqrt(w)*sqrt(w+2)*u^4+2*u^4*w+4*sqrt(w)*sqrt(w+2)*u^2+u^4-4*u^2*w-2*sqrt(w)*sqrt(w+2)-2*u^2+w^2+2*w+1)+2)+w-1:
series(nu3(u), u = 0);

An example with some options:

plot( [sin(x), cos(x)], x=-1..2*Pi, color=[red,blue], thickness=2, tickmarks=[[seq(i*Pi/4=sign(i)*(45*abs(i))^`o`, i=-1..8)],  default], scaling=constrained, size=[900,400], labels=[x,y], legend=["y=sin(x)","y=cos(x)"], labelfont=[times,bold,16], legendstyle=[font=[times,16]]);


Edit.

restart;
S := {0.2, 0.5}:
R, Q := op(S);

R;
Q;


# Or

restart;
S := {0.2, 0.5}:
R:=S[1];
Q:=S[2];
R, Q;

 

Should be  de1 :=  ...;  de2 :=  ... ;   instead of    de1 =  ...;  de2 =  ... ;

Miquel  procedure allows you to visualize Miquel's theorem about five circles. The user himself arbitrarily sets the configuration parameters (any 5 numbers in the range  0..2*Pi). These numbers are the polar angles of the intersection points of blue circles with a stationary red circle (radius 1). The centers of all the blue circles lie on the red circle. Of course, this does not prove the theorem in the strict sense of the word, but it allows everyone to see clearly its fairness. The procedure does not use any special geometric packages, only  plottools  package for specifying lines and circles and  plots:-display command for plotting everything.


 

The procedure code

restart;
Miquel:=proc(L::list)  # L is the list of numbers from 0 to 2*Pi
local L1, s, t, r, Dist, S, T, eq, Sol, A, P, LineEq, Eq, B, P1;
uses plots, plottools;
L1:=sort(evalf~(L));
assign(seq(s[i]=L1[i], i=1..5)); s[6]:=s[1]+2*Pi;
assign(seq(t[i]=s[i]/2+s[i+1]/2, i=1..5));
assign(seq(r[i]=sqrt((cos(t[i])-cos(s[i]))^2+(sin(t[i])-sin(s[i]))^2), i=1..5));
Dist:=(p,q)->sqrt((p[1]-q[1])^2+(p[2]-q[2])^2);
assign(seq(S[i]=[cos(s[i]),sin(s[i])], i=1..5));
assign(seq(T[i]=[cos(t[i]),sin(t[i])], i=1..5));
assign(seq(eq[i]=((x-T[i][1])^2+(y-T[i][2])^2=r[i]^2), i=1..5));
eq[6]:=eq[1]; eq[0]:=eq[5];
Sol:=map(P->[seq(eval([x,y],p),p=P)],[seq(solve([eq[i],eq[i-1]], [x,y]), i=1..5)]);
assign(seq(A[i]=select(t->is(Dist([0,0],t)=min(Dist([0,0],Sol[i,1]),Dist([0,0],Sol[i,2]))), Sol[i])[], i=1..5)); A[6]:=A[1];
LineEq:=(P,Q)->(y-P[2])*(Q[1]-P[1])=(x-P[1])*(Q[2]-P[2]);
assign(seq(Eq[i]=LineEq(A[i],A[i+1]), i=1..5)); Eq[6]:=Eq[1]; Eq[7]:=Eq[2];
assign(seq(B[i]=eval([x,y],solve({Eq[i],Eq[i+2]},[x,y])[]), i=1..5));
P:=polygon([B[1],B[3],B[5],B[2],B[4]], style=line, thickness=2);
P1:=polygon([A[1],B[5],A[2],B[1],A[3],B[2],A[4],B[3],A[5],B[4]], color="LightGreen");
display(seq(circle([cos(t[i]),sin(t[i])],r[i],color=blue), i=1..5), circle([0,0], color=red), P, P1, scaling=constrained, axes=none);
end proc:
 

Examples of use

L:=[1,1.9,3,4.1,5.4];

[1, 1.9, 3, 4.1, 5.4]

(1)

Miquel(L);

 

Miquel([seq(rand(0...evalf(2*Pi))(), i=1..5)]);  # Parameters are specified randomly

 

 


 

Download 111.mw

Your objective function  z  depends only on variables  x[i,j] , and the set of constraints also depends additionally on y[i]  and  u[i]  variables, which actually play the role of parameters (and the result should depend on these parameters). I think that Maple simply does not have the tools for solving similar problems (I do not know if such tools exist at all). To get a solution you must specify the values of these parameters.

restart;
eu := -2*n^2*B^2+2*n*B^2*p-2*n*B^2*p^2+n*B^2-B^2*p+B^2*p^3+n*c*d;
Eq1:=u=`p^2`+n-p:  Eq2:=v=`p^3`+n-p:
expand(subs([p^2=solve(Eq1,`p^2`), p^3=solve(Eq2,`p^3`)], eu)):
collect(%, [u,v]);
subs([subs(`p^2`=p^2, Eq1), subs(`p^3`=p^3, Eq2)], %);

                              

 

 


                                          

First 133 134 135 136 137 138 139 Last Page 135 of 290