Kitonum

21440 Reputation

26 Badges

17 years, 36 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;
y1:=-1;
y2:=eval(y, solve({y=x, x=2-y^2, x>0}));
int(1, [x=y..2-y^2, y=y1..y2]);
                                                            

 

x,y := 1,2;
x%+y=x+y;
                                               

 

Replace  sum  by  add . Now it works:

restart;                                                                  
with(plots):                                                               
g:=(x,y)->sin(Pi*(x+y))*(x^2+y^2);                                        
q:=(n,k,l,x,y)->binomial(n,k)*binomial(n-k,l)*(((1+x)/2)^k)*(((1+y)/2)^l)*(1-((1+x)/2)-((1+y)/2))^(n-k-l) ;

 K:=(n,x,y)->(((1+n)*(2+n))/4)*add(add(q(n,k,l,x,y)*int(int(q(n,k,l,t,u)*g(t,u),u=-1..-t),t=-1..1),l=0..n-k),k=0..n);  

p1:=plot3d(g(x,y),x=-1..1,y=-1..-x,color=blue):                           
p2:=plot3d(K(1,x,y),x=-1..1,y=-1..-x,color=brown):                        
p3:=plot3d(K(2,x,y),x=-1..1,y=-1..-x,color=yellow):                       
p4:=plot3d(K(5,x,y),x=-1..1,y=-1..-x,color=green):                        
p5:=plot3d(K(10,x,y),x=-1..1,y=-1..-x,color=red):                                                              
display([p1,p2,p3,p4,p5]);

 

 

restart;
int(eval(2*x^i*(x+n)^m*sqrt(-x^2+x), n=0), x = 0 .. 1);
int(2*x^i*(x+n)^m*sqrt(-x^2+x), x = 0 .. 1) assuming n>=1;
                                      

f := x->exp(x^5):  n := 3: 
f(0)+convert(f(x)-f(0), FormalPowerSeries):
evalindets(%, 'factorial(anything)', t->``(op(1,t))!):
subs(infinity = n-1, %): 
value(%);


                               


Edit.

restart; with(plots):
H := 11;
B := x; W := x;
t__E := (13100*(B*B)*H*(.23-.10)*1.2)/(1500*alpha);
A__t := 2*B*W+2*H*(B+W);
OF := alpha/A__t;
for alpha from 0.1 by 0.1 to 1.8 do XX[alpha] := solve({0 < x, OF < 0.6951871658e-2, t__E < 200}, x); XY1[alpha]:=[alpha,op([1,1],XX[alpha])];
XY2[alpha]:=[alpha,op([2,2],XX[alpha])];
 end do;
XY1:=sort(convert(XY1,list), (a,b)->a[1]<=b[1]); XY2:=sort(convert(XY2,list), (a,b)->a[1]<=b[1]);
plot([XY1, XY2], color=[blue,red]);

 

Because you did not submit the text of the code (only pictures), I show how this can be done with the example of 3 spheres:

g1:=x^2+y^2+z^2-16:  g2:=(x+1)^2+(y+3)^2+z^2-16:  g3:=x^2+y^2+(z+2)^2-16:
plots:-implicitplot3d(max(g1,g2,g3)=0,  x=-4.5..3.5, y=-4.5..2.5,z=-4.5..4.5, style=surface, axes=normal, scaling=constrained, lightmodel=light4, numpoints=1000000); 

 

                                   

Edit.

 

 

Did you forget to call  NumberTheory  package? See help on  NumberTheory:-ContinuedFraction  command. The parameters  q  and  t  should be specified.


restart;
y:=x->5*x^2:  x0:=-1:
 # Specify the function and the point
Dy:=limit((y(x0+t)-y(x0))/t, t=0);  # Find the derivative at the point x0
                                         

is(y(x0)=5);  # Check that the point (-1,5) is on the graph of y=5*x^2 
Tang:=y(x0)+Dy*(x-x0);  
# Find the tangent line at the point (-1,5)
                                    

plot([y(x), Tang, [[x0,y(x0)]]], x=-2..2, -6..12, color=[red,blue,red], style=[line,line,point], symbol=solidcircle, symbolsize=12, tickmarks=[default,spacing(1)], size=[200,500]);  # The plotting
                     

 

PS. The derivative was found using the limit (as OP wrote 'Use the formal definition of the derivative..."). Of course, it is shorter to look for the derivative at a point using the differential operator 

D(y)(-1);

 

Download _The_plotting.mw

In your method, you will always get a graph of the zero function, because your function is nonzero on a discrete set of points. Try another method:

restart;
plot([seq([i,t,t=0..1], i=1..5)], color=blue, view=[0..5.5, 0..1], size=[800,500]);

 

Here are 3 ways:

a:=2: b:=5:
plot([[0,-a],[0,a],[b,a],[b,-a],[0,-a]], linestyle=2, color=red, thickness=3, scaling=constrained);  # The first
plots:-display(plottools:-curve([[0,-a],[0,a],[b,a],[b,-a],[0,-a]], linestyle=2, color=red, thickness=3), scaling=constrained);  # The second
plots:-display(plottools:-rectangle([0,a],[b,-a], style=line, linestyle=2, color=red, thickness=3), scaling=constrained);  # The third

 

Edit.

Shorter:

subs([a=2*x,b=3*y], expand(sin(a+b)));

 

Here are the plots in 2 styles: as points and as a line:

X:=[seq(i, i=0..0.5, 0.05)]; 
Y:=[0.486935382154125, 0.485087274176440, 0.483255914856304, 0.481441076124814, 0.479642533998987, 0.477860068520125, 0.476093463645627, 0.474342507167362, 0.472606990609939, 0.470886709216958, 0.469181461771770];
plot(X,Y, view=0..1, style=point, color=red, symbol=solidcircle, symbolsize=12);
plot(X,Y, view=0..1, color=red, thickness=2);

 

Here is another way. First, we eliminate the variable  from the system of three equations, and then we plot the intersection of the two surfaces obtained.


 

restart;
f:=(x,t)->t^2*x^2 + t*x + 2*x - 1:
g:=(y,t)->t^2*y^3 + t*y^2 + 2*y - 1:
h:=(z,t)-> 2*t^2*z^3 + t*z + 3*z - t^2:

 

 

A:=eliminate({f(x,t),g(y,t), h(z,t)}, t);

 

[{t = -(-2*x*y^3+2*x^2*y+y^3-x^2)/(x^2*y^2-x*y^3)}, {4*x^2*y^6-6*x^3*y^4-2*x^2*y^5-4*x*y^6+4*x^4*y^2+2*x^3*y^3+5*x^2*y^4+x*y^5+y^6-4*x^4*y+x^3*y^2-3*x^2*y^3+x^4, 16*x^2*z^6-24*x^3*z^4-16*x*z^6+9*x^4*z^2+14*x^2*z^4+4*z^6-x^3*z^2-16*x^2*z^3+2*x*z^4+12*x^3*z-x^2*z^2+16*x*z^3-7*x^2*z-4*z^3+4*x^2-x*z-4*x+1}]

(1)

plots:-intersectplot(4*x^2*y^6-6*x^3*y^4-2*x^2*y^5-4*x*y^6+4*x^4*y^2+2*x^3*y^3+5*x^2*y^4+x*y^5+y^6-4*x^4*y+x^3*y^2-3*x^2*y^3+x^4=0, 16*x^2*z^6-24*x^3*z^4-16*x*z^6+9*x^4*z^2+14*x^2*z^4+4*z^6-x^3*z^2-16*x^2*z^3+2*x*z^4+12*x^3*z-x^2*z^2+16*x*z^3-7*x^2*z-4*z^3+4*x^2-x*z-4*x+1=0, x=0..0.3,y=0..0.3,z=0.5..1, numpoints=10000);

 

 


 

Download curves.mw

Finding the maximum of the function  f1  plays a key role in this problem. In the Preben's answer, the maximum was found (simply by calculating the values of the function on a discrete grid) with low accuracy (the third digit is incorrect).

Here is another way. After simplifying the function  f1, we used  Optimization:-Maximize  command to find the maximum.


 

restart;
xr:=1: ao:=sqrt(1+c^2): theta:=arctan(c): a:=ao*exp(I*theta): b:=I*0.5*Delta-a*(k-1)*xr*0.5: no:=1: AA:=5: theta1:=0: Omega:=10:
f:=sqrt(Pi/ao)*exp(-I*0.5*theta)*add(exp(b^2/a)*exp(-a*(k-1)^2*xr^2),k=1..1):alpha:=AA*exp(I*theta1):
f1:= AA^2+((Re(f))^2+(Im(f))^2)*Omega^2+2*Omega*Im(conjugate(alpha)*f):
f1:=simplify(f1) assuming real;
Optimization:-Maximize(f1,Delta=-1..1,c=-1..1);
Max:=%[1];
plot3d(f1/Max,Delta=-5..5,c=-5..5,axes=boxed,font=[1,1,18]);

100*(-Pi^(1/2)*(c^2+1)^(1/4)*(cos(Delta^2*c/(4.*c^2+4.))*sin(.5*arctan(c))-cos(.5*arctan(c))*sin(Delta^2*c/(4.*c^2+4.)))*exp(-Delta^2/(4.*c^2+4.))+Pi*exp(-Delta^2/(2.*c^2+2.))+(1/4)*(c^2+1)^(1/2))/(c^2+1)^(1/2)

 

[351.197939848496731, [Delta = HFloat(0.0), c = HFloat(-0.27417902446092207)]]

 

351.197939848496731

 

 

 


 

Download Normalization.mw

 

First 122 123 124 125 126 127 128 Last Page 124 of 289