Kitonum

21440 Reputation

26 Badges

17 years, 37 days

MaplePrimes Activity


These are answers submitted by Kitonum

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);

g:=-18+2*x-8*y+5*z=0;
a:=tcoeff(lhs(g));
g-a;

                   -18 + 2 x - 8 y + 5 z = 0
                              -18
                      2 x - 8 y + 5 z = 18
 

 

U := {A[1], A[2], B[2]}:
op~(0, U);

                                   {A, B}


Addition. Another option with  map  command:

map(u->op(0,u), U);

AdvanceDate("Jan-01-1981", 13214);
AdvanceDate(%, -13214);

                                                     "Mar-07-2017"
                                                     "Jan-01-1981"

 

First, I plotted your equations in the desired ranges, they specified the boundaries for the roots:

Digits:=20:

plots:-implicitplot([focdeltapioptS2Tbeta_eg, focbetapioptS2Tbeta_eg], beta=-0.1..1, delta=-0.1..1, color=[red,blue], thickness=2,  gridrefine=5, axes=box);
 
fsolve([focdeltapioptS2Tbeta_eg, focbetapioptS2Tbeta_eg], {beta=0.2..0.6, delta=-0.1..0.1});  
# The first solution 
fsolve([focdeltapioptS2Tbeta_eg, focbetapioptS2Tbeta_eg], {beta=-0.1..0.1, delta=0.2..0.6});  # The second solution
 

               

 Addition. You can substitute the solutions found in the equations and make sure that they satisfy them with high accuracy.

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