Kitonum

16690 Reputation

24 Badges

12 years, 274 days

MaplePrimes Activity


These are answers submitted by Kitonum

If you just type  a^3*sqrt(a);  Maple calculates it as  a^(7/2) . The desired display requires a special procedure. Procedure  P  displays an expression of the type  symbol^fraction  in the desired form.

P:=proc(p::symbol^fraction)
local e, a, n, k, m;
uses InertForm;
e:=op(2,p); a:=op(1,p);
n:=floor(e); k:=e-n; m:=surd(a^numer(k),denom(k));
`if`(n=0,m,`%*`(a^n,m));
Display(%,inert=false);
end proc:

Examples of use:

P(a^(7/2));
P(b^(8/3));
P(a^(2/5));

                                                

 

 

To avoid this bug, after differentiating with respect to  t  in the resulting series, you can simply write separately the term for k = 1 :

restart;
S:=Sum(epsilon^k*f[k](t)/k!, k=1..infinity);
S1:=diff(S, t);
S1:=eval(op(1,S1),k=1)+Sum(op(1,S1),k=2..infinity);
S2:=simplify(diff(S1,epsilon$2));

           

The first 5 terms of the series  S2 :

seq(eval(op(1,S2), k=n), n=2..6);

        

 

Figure shows a part of the surface inside a sphere of radius 4.5 :

restart;
with(plots):
x0 := x - Pi/4;
y0 := y - Pi/4;
z0 := z - Pi/4;
f := (x,y,z)->10*sin(x0)*sin(y0)*sin(z0) + 10*sin(x0)*cos(y0)*cos(z0) + 10*cos(x0)*sin(y0)*cos(z0) + 10*cos(x0)*cos(y0)*sin(z0) - 7/10*cos(4*x) - 7/10*cos(4*y) - 7/10*cos(4*z);
implicitplot3d(piecewise(sqrt(x^2+y^2+z^2)>4.5, undefined, f(x,y,z)-9),  x=-4.5 .. 4.5, y= -4.5 .. 4.5,  z=-4.5 .. 4.5, grid = [100, 100, 100], style = patchnogrid);

         

 

You write your system, first in vector form (as it is defined), and then convert to normal form and solve using  dsolve  command:

restart;
Sys:=diff(<x1(t),x2(t)>,t)=~<-4,-2;6,3>.<x1(t),x2(t)>+<2/(exp(t)+1),-3/(exp(t)+1)>;
dsolve(convert(Sys,set) union {x1(0)=0,x2(0)=ln(2)});

You missed the multiplication sign:

evalf(((12*sqrt(13))/13 - 3/4)/(1 + ((12*sqrt(13))/13)*(3/4)));

                                                 0 .7374399056

Use  plots:-textplot  command for this. For example, add the new line  Anim4  to your code (for the example1):

Anim4 := animate(textplot, [[op(convert(Position(t)+(1.3/4)*Vitesse(t), list)), "V"], align = [right, below], font = [times, bold, 18]], t = t0 .. t1, frames = 100):

 

When creating complex animations, it is convenient to first write a procedure that creates one frame and then use  plots:-animate  command. Here's the original example:

restart;

P:=proc(t)
local f, g, alpha, beta, Position, Vitesse, Accélération, P1, P2, V1, V2 ;
uses plots, plottools;
f := t->sin(3*t)*cos(t);
g := t->cos(3*t)*sin(t);
alpha := (1/4)*Pi;
beta := 3*Pi*(1/4);
Position := <f(t), g(t)>;
Vitesse := <(D(f))(t), (D(g))(t)>;
Accélération := <(D@@2)(f)(t), (D@@2)(g)(t)>;
P1:=plot([f(s), g(s), s=alpha .. t], color=green, thickness=2);
P2:=plot([[f(t), g(t)]], style=point, symbol=solidcircle, color=blue, symbolsize=20);
V1:=arrow(Position,0.1*Vitesse, width=0.015, color=blue); # Vector of vitesse
V2:=arrow(Position,0.1*Accélération, width=0.015, color=red); # Vector of accélération
display(P1,P2,V1,V2);
end proc:

plots:-animate(P,[t], t=Pi/4..3*Pi/4, frames=90, size=[500,500]);

                             

 

When simplifying complex expressions, it is often useful to replace some subexpression with a name and use subs  or  algsubs  commands, and instead of  simplify  use the  factor  command with the required options:

The set of points  z=x+I*y  on the complex plane satisfying this equation  Eq  is empty . See below

restart;
z:=x+I*y:
Eq:=evalc(abs(2*z-I)=Im(z+1-I)); # The equation Eq is equivalent to the system S
S:={Eq^2, y>=1};
solve(Eq);
is(-3*y^2+2*y<0) assuming y>=1;

                         

 

5 points define a polynomial of degree <=4 :

CurveFitting:-PolynomialInterpolation([[1,2],[2,3],[3,4],[4,6],[5,10]], x);
plot(%, x=0..5, tickmarks=[6,11], gridlines, scaling=constrained, size=[300,500]);

                  

Addition. If you still want to get a polynomial of degree 5, then you need to specify one more point. I have defined it with a parameter  a . We see that as a parameter we can take any  a<>17 :

CurveFitting:-PolynomialInterpolation([[1,2],[2,3],[3,4],[4,6],[5,10],[6,a]], x);

  

In the solution above, nowhere are the forces 70 lb and 60 lb taken into account. 
In this problem, the unknown quantities are: the reaction of the support  OA (say F), the weight of the pot (say P) , and the 1st coordinate  x  of point  A. To find them, we compose a system of 3 equations with 3 unknowns. After finding  x , the coordinates of all points will be known and it will be easy to find all the angles. The sum of all forces applied to point  A  should equal 0.

restart;
local O;
O:=<0,0,0>: A:=<x,6,2>: B:=<-3,0,4>: C:=<5/2,0,5*sqrt(3)/2>:
AC:=C-A; AB:=B-A; AO:=O-A;
assume(x>0): 
vOA:=A/sqrt(A.A)*F; # Force vector in the direction of OA 
vAB:=AB/sqrt(AB.AB)*70; # Force vector in the direction of AB   
vAC:=AC/sqrt(AC.AC)*60; # Force vector in the direction of AC  
vP:=<0,0,-P>; # Force vector vertically down 
Sys:={seq((vOA+vAB+vAC+vP)[i]=0, i=1..3)};
Sol:=fsolve(Sys, {F,P,x});
x:=eval(x,Sol);
`Angle BAC`=evalf(arccos(AB.AC/sqrt(AB.AB)/sqrt(AC.AC))*180/Pi)*degrees; 
`Angle OAC`=evalf(arccos(AO.AC/sqrt(AO.AO)/sqrt(AC.AC))*180/Pi)*degrees;

                       

 

Edit.

i:=1: k:=3:
G[i,k]=abs(u[i] - u[k])-(u[i]-u[k])^2;

                                        

You can generate your table as a matrix:

Matrix(5, (i,j)->`if`(i>=j,'y[i,j]'=y[i,j], ``));

 

 

restart;                    
T := (p*a^(-Phi(xi))+q+r*a^Phi(xi))/ln(a):                    
u[0] := C[0]+C[1]*a^Phi(xi)+C[2]*a^(2*Phi(xi)):                          
u[1] := diff(u[0], xi):               
d[1] := C[1]*a^Phi(xi)*T*ln(a)+2*C[2]*a^(2*Phi(xi))*T*ln(a):         
u[2] := diff(d[1], xi):     
d[2] := C[1]*a^Phi(xi)*T*ln(a)*(p*a^(-Phi(xi))+q+r*a^Phi(xi))+C[1]*a^Phi(xi)*(-p*a^(-Phi(xi))*T*ln(a)+r*a^Phi(xi)*T*ln(a))+4*C[2]*a^(2*Phi(xi))*T*ln(a)*(p*a^(-Phi(xi))+q+r*a^Phi(xi))+2*C[2]*a^(2*Phi(xi))*(-p*a^(-Phi(xi))*T*ln(a)+r*a^Phi(xi)*T*ln(a)):                                     
expand((2*k*k)*w*beta*d[2]-(2*alpha*k*k)*d[1]-2*w*u[0]+k*u[0]*u[0]):     
subsindets(%,identical(a^Phi(xi)), t->z);
collect(%, z);
subs(z=a^Phi(xi), %);

Use  unapply  instead of a function in arrow notation:

restart;
K := x^3*y^4 + 6*x^2*y^3 + 3*x*y^4 + x^2*y^2 + 2*x*y^3;
f := unapply(K, x,y); 
f(t, x);


You can see for yourself that when using arrow notation  f:=(x,y)->K , the right-hand side  K  must be explicitly specified in terms of  x  and  y .

1 2 3 4 5 6 7 Last Page 1 of 256