Kitonum

21475 Reputation

26 Badges

17 years, 49 days

MaplePrimes Activity


These are answers submitted by Kitonum

Replace the line  v:=t->%  with the line  v:=unapply(%, t)

For the label do the same.

Explore(plots:-display(plots:-textplot([2,-10,k=evalf[3](a)+2], font=[times,bold,16]), plot((a+2)*x+6, x = -5 .. 5, view = -10 .. 10)), parameters = [a = -4.0 .. 3], initialvalues = [a = 1]);

Example:

V:=LinearAlgebra:-RandomVector(10, generator = -10. .. 10.);
seq(`if`(V[i]>0, [i, V[i]], NULL), i=1..10);

Use the differential operator  D  for this:

f:=(x,y)->(x^3+y^3)^(1/3);
g:=D[1](f);
g(1,y);

                

When working with exact (symbolic) expressions, we should simplify it as much as possible:

a:=abs(tan(Pi/5)-sqrt(5-2*sqrt(5)));
convert(a, radical);                     
signum(0, %, 0);

                 
 

In your picture I see  an expression:=an expression . To the left there must be a name, not an expression.

If you want to refer to an equation  A=B  later, you must give it a name, for example  eq:=A=B

You can use  plots:-tubeplot  command to paint different parts of the same axis in different colors.

Example:

restart;
P:=plot3d([r*cos(t),r*sin(t),r^2], r=0..1,t=0..2*Pi,  axes=normal, lightmodel=none):
r:=0.007:
Xpos:=plots:-tubeplot([t,0,0],t=0..1,radius=r, style=surface, color=red):
Ypos:=plots:-tubeplot([0,t,0],t=0..1,radius=r, style=surface, color=red):
Zpos:=plots:-tubeplot([0,0,t],t=0..1.45,radius=r, style=surface, color=red):
Xneg:=plots:-tubeplot([t,0,0],t=-1..0,radius=r, style=surface, color=blue):
Yneg:=plots:-tubeplot([0,t,0],t=-1..0,radius=r, style=surface, color=blue):
Zneg:=plots:-tubeplot([0,0,t],t=-0.45..0,radius=r, style=surface, color=blue):
plots:-display(P,Xpos,Ypos,Zpos,Xneg,Yneg,Zneg);

       



Addition. You can make the negative parts of the axes invisible if set  color=white :

restart;
P:=plot3d([r*cos(t),r*sin(t),r^2], r=0..1,t=0..2*Pi,  axes=normal, lightmodel=none, tickmarks=[[0,0.5,1],[0,0.5,1],[0,0.5,1,1.5]]):
r:=0.007:
Xpos:=plots:-tubeplot([t,0,0],t=0..1.2,radius=r, style=surface, color=red):
Ypos:=plots:-tubeplot([0,t,0],t=0..1.2,radius=r, style=surface, color=red):
Zpos:=plots:-tubeplot([0,0,t],t=0..1.55,radius=r, style=surface, color=red):
Xneg:=plots:-tubeplot([t,0,0],t=-1..0,radius=r, style=surface, color=white):
Yneg:=plots:-tubeplot([0,t,0],t=-1..0,radius=r, style=surface, color=white):
Zneg:=plots:-tubeplot([0,0,t],t=-0.45..0,radius=r, style=surface, color=white):
plots:-display(P,Xpos,Ypos,Zpos,Xneg,Yneg,Zneg);

       
 

 

Use  view  option.

Example:

plot3d(4*y-y^2, x=1..3.5, y=0.5..3.5, axes=normal);  # Without view option
plot3d(4*y-y^2, x=1..3.5, y=0.5..3.5, view=[0..4, 0..4, 0..5], axes=normal);  # With view option


 

p:=[3,6,-1]: q:=[4,-2,2]:
pq:=<q-p>;
whattype(pq);

 

Of course, this is easy to write down as a procedure whose parameters are the beginning and end of a vector:

VectorByPoints:=proc(p::list,q::list)
<q-p>;
end proc:

VectorByPoints([3,6,-1], [4,-2,2]);

plots:-implicitplot(w=-4.918231636*z^3+2.486861786*z^2+.8573483099*z+2.341623514, w=-3..7, z=-3..3);


I did not quite understand the question 2). If you just want a part of the graph from above in the specified ranges, then write:

plots:-implicitplot(w=-4.918231636*z^3+2.486861786*z^2+.8573483099*z+2.341623514, w=-2..3, z=-0.5..0.5, view=[-2..3, -0.5..0.5]);


If you want the initial equation (w against z) in the specified ranges, then write:

plot(-4.918231636*z^3+2.486861786*z^2+.8573483099*z+2.341623514, z=-2..3, -0.5..0.5);


if you have a new variable  u=z/H  then the change  z=H*u  should be done first with a specific  H  in the initial equation  w=-4.918231636*z^3+2.486861786*z^2+.8573483099*z+2.341623514


Edit.


 

In the help on  evalc  command we can read "The fundamental assumption that evalc makes is that unknown variables represent real-valued quantities". Therefore evalc immediately treats   as a real number and often ignores  assuming  or  assume .  When using  evalc with symbolic complex numbers just write  x+I*y  instead  z :

z:=x+I*y:
evalc(Re((Re(z)+I*Im(z))^2));
evalc(z-Re(z)-I*Im(z)); 

                                                x^2-y^2
                                                     0


Addition. If you want the result to be expressed through z-variable, you can do the reverse substitution:

z:=x+I*y:
evalc(Re((Re(z)+I*Im(z))^2)):
subs([x=Re('z'),y=Im('z')], %);

                                   Re(z)^2-Im(z)^2

Use the straightforward and simple syntax for this and you will not have any problems:

solve(0.042^x/0.021^x=4, x);
solve(0.260^y/0.065^y=1, y);

                          2.000000000
                               0.
 

In Maple 12 there was not  plottools:-getdata  command. Use  op  command instead. Your plot (let's call it P) contains several graphs.  op([1,1], P)  returns the data for the first graph as a numeric matrix, op([1,2], P)  is for the second graph and so on. Here is a simple example:

P:=plot([sin(x), cos(x)], x=-Pi..Pi, color=[red,blue]);
Q:=op(P);
data:=op([1,1], P);
plot(data);


Addition. If necessary, you can easily convert the received data from the matrix form to the list of lists, in which each sublist is the coordinates of some point on the graph:

convert(data, listlist);

Example:

restart;
A:=<a,b; c,d>;
LinearAlgebra:-Diagonal(A);  
# The output is a column vector
# or
seq(A[i,i], i=1..op([1,1], A));  # The output is a sequence


Do not use linalg package. It's deprecated.

Also you can use  lhs  and  rhs  commands for this:

CI:=OneSampleZTest(S, mu, sdev, confidence=0.95, output='confidenceinterval');

CI_lower:=lhs(CI);

CI_upper:=rhs(CI);

First 148 149 150 151 152 153 154 Last Page 150 of 290