Kitonum

21840 Reputation

26 Badges

17 years, 225 days

MaplePrimes Activity


These are answers submitted by Kitonum


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

 

We must specify the option  scene , for example  scene=[t, S(t)]  or  scene=[S(t), V(t)]  and etc. But if we do this, then the error appears about the existence of a singularity. In fact, since you have zero initial conditions, then we have zeros in the denominators of your system at  t = 0 

DEplot(sys, [S(t), V(t), C(t), I(t), R(t)], t = 0 .. 50, S = 0 .. 2, V = 0 .. 2, C = 0 .. 2, I = 0 .. 2, R = 0 .. 2, [[S(0) = 0, V(0) = 0, C(0) = 0, I(0) = 0, R(0) = 0]], stepsize = .1, linecolour = blue, thickness = 4, arrows = slim, scene = [t, S(t)]);
    Warning, plot may be incomplete, the following errors(s) were issued:
   cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly    set up

 

PS. You need to think about how correct your model is.

First, you specify the vectors  x  and  y , and then calculate the expressions  px  and  py , using for summation  add  command:

x:=<0, 1, 3>: y:=<2, 3, 4>: n:=3:
px:=x[1]+add((x[j]-x[1])^2, j=2..n)/add(x[j]-x[1], j=2..n);
py:=y[1]+add((x[j]-x[1])*(y[j]-y[1]), j=2..n)/add(x[j]-x[1], j=2..n);

                                                                         

restart;
PDEtools[declare]((f, g)(x), prime = x);
de1 := diff(f(x), x, x, x, x)-(H*H)*(diff(f(x), x, x))-R*(diff(f(x), x, x))*(diff(f(x), x))+R*(diff(f(x), x, x, x))*f(x);
de2 := diff(g(x), x, x)-(H*H)*g(x)-R*(diff(f(x), x))*g(x)+R*(diff(g(x), x))*f(x); 
dd1 := {de1 = 0, de2 = 0, f(0) = 0, f(1) = 1, g(0) = 1, g(1) = 1, (D(f))(0) = 0, (D(f))(1) = 0};
r1 := dsolve(eval(dd1, [R = 1, H = 1]),numeric, output = Array([0., 0.5e-1, .10, .15, .20, .25, .30, .35, .40, .45, .50, .55, .60, .65, .70, .75, .80, .85, .90, .95, 1.00]));
r2 := dsolve(eval(dd1, [R = 5, H = 5]),numeric, output = Array([0., 0.5e-1, .10, .15, .20, .25, .30, .35, .40, .45, .50, .55, .60, .65, .70, .75, .80, .85, .90, .95, 1.00]));
A:=plots:-odeplot(r1, [x, f(x)], x=0..5, color=red):
B:=plots:-odeplot(r2, [x, f(x)], x=0..5, color=blue):
plots:-display(A, B);

 

I had a similar problem with the Maple 2017 a few months ago. Try the following method. After the loading screen appears, open the task manager, then details, then find the processes   jogamp_exe...  and stop them (there are two such processes in my comp).

Formal parameters of the procedure: T  is the list of vertices of the original triangle, n  is the number of steps, C  is the color (optional, by default red).

Sierpinski:=proc(T::list,n::nonnegint,C::symbol:=red)
local Step;
uses plottools, plots;
Step:=L->map(t->op([[t[1],(t[1]+t[2])/2,(t[1]+t[3])/2],[(t[1]+t[2])/2,t[2],(t[2]+t[3])/2],[(t[1]+t[3])/2,(t[2]+t[3])/2,t[3]]]), L);
map(t->polygon(t,style=surface,color=C),(Step@@n)([T]));
display(%, axes=none, size=[600,600]);
end proc:


Example of use (animation):

plots:-display(seq(Sierpinski([[-1,0],[0,sqrt(3)],[1,0]], n)$7, n=0..7), insequence);

Output:

                      


Sierpinski.mw

P:=x*y*z+ x*y^2+x*y-y*z^2;
select(p->degree(p,x)<2 and degree(p,y)<2 and degree(p,z)<2, P);

 

Use  subsop  command:

restart;
f:=(3*beta[11]^2-4*beta[11]*sigma[11]+6*beta[12]^2-12*beta[12]*sigma[12]+2*sigma[11]^2+6*sigma[12]^2)*(1/sqrt(6*beta[11]^2-8*beta[11]*sigma[11]+12*beta[12]^2-24*beta[12]*sigma[12]+4*sigma[11]^2+12*sigma[12]^2))*(1/omega^2);
subsop(2=1/phi, f);

 

Maple knows this multiplication rule, only you have to multiply the entire inequality, not its individual operands:

(2<3)*(-1);
(k/m<=2/n)*(-1);

                                            

PS. Note that Maple always writes a sign of inequality in one direction, if necessary, rearranging the sides of the inequality. You can make Maple change the direction of the inequality only (as you wish), but it's not so simple, you need a special procedure for this.

First 125 126 127 128 129 130 131 Last Page 127 of 292