Kitonum

21440 Reputation

26 Badges

17 years, 36 days

MaplePrimes Activity


These are answers submitted by Kitonum

Use  %.  or  %*  instead of  :

sum(i %. a, i=1..3);
                                               


Another option is to use  ``(...)  construction to avoid the summation of similar terms. Then all the individual terms of the series are enclosed in parentheses, and it is convenient to compare:

sum(``(i*a), i=1..3);
                                               

 This construction is often useful in other cases. For example, if you need to clearly show the definition of the number  10!  then it can be done in 3 ways:

``(10)!=product(``(k), k=1..10);
# or
``(10)!=`%.`(seq(k, k=1..10));
# or
``(10)!=`%*`(seq(k, k=1..10));
                                          

 

Edit.                                   

Try this:

simplify(-sqrt((r-2*M)*(-r/(-r+2*M))^eta/r)*X*sqrt(-((r-2*M)/r)^eta*r/(-r+2*M))/f) assuming r>0, r-2*M>0, eta::real;


Edit.

 

In fact, Maple knows this, but this syntax  convert(sin(alpha), radical)  is required for output. Maple can express in real radicals trigonometric functions of any angle multiple of 3 degrees:


 

for k from 3 to 87 by 3 do
%sin(k*Pi/180)=convert(sin(k*Pi/180), radical);
od;

%sin((1/60)*Pi) = (-(1/16)*2^(1/2)-(1/8)*(5+5^(1/2))^(1/2)+(1/16)*2^(1/2)*5^(1/2))*3^(1/2)-(1/16)*2^(1/2)+(1/8)*(5+5^(1/2))^(1/2)+(1/16)*2^(1/2)*5^(1/2)

 

%sin((1/30)*Pi) = (1/8)*2^(1/2)*3^(1/2)*(5-5^(1/2))^(1/2)-1/8-(1/8)*5^(1/2)

 

%sin((1/20)*Pi) = -(1/4)*(5-5^(1/2))^(1/2)+(1/8)*2^(1/2)*(5^(1/2)+1)

 

%sin((1/15)*Pi) = (1/8-(1/8)*5^(1/2))*3^(1/2)+(1/8)*2^(1/2)*(5+5^(1/2))^(1/2)

 

%sin((1/12)*Pi) = (1/4)*2^(1/2)*(3^(1/2)-1)

 

%sin((1/10)*Pi) = -1/4+(1/4)*5^(1/2)

 

%sin((7/60)*Pi) = ((1/8)*3^(1/2)+1/8)*(5-5^(1/2))^(1/2)-(1/16)*2^(1/2)*(5^(1/2)+1)*3^(1/2)+(1/16)*2^(1/2)*(5^(1/2)+1)

 

%sin((2/15)*Pi) = -(1/8)*2^(1/2)*(5-5^(1/2))^(1/2)+(1/8+(1/8)*5^(1/2))*3^(1/2)

 

%sin((3/20)*Pi) = (1/8)*2^(1/2)+(1/4)*(5+5^(1/2))^(1/2)-(1/8)*2^(1/2)*5^(1/2)

 

%sin((1/6)*Pi) = 1/2

 

%sin((11/60)*Pi) = (-(1/16)*2^(1/2)+(1/8)*(5+5^(1/2))^(1/2)+(1/16)*2^(1/2)*5^(1/2))*3^(1/2)-(1/16)*2^(1/2)-(1/8)*(5+5^(1/2))^(1/2)+(1/16)*2^(1/2)*5^(1/2)

 

%sin((1/5)*Pi) = (1/4)*2^(1/2)*(5-5^(1/2))^(1/2)

 

%sin((13/60)*Pi) = (-(1/8)*3^(1/2)+1/8)*(5-5^(1/2))^(1/2)+(1/16)*2^(1/2)*(5^(1/2)+1)*3^(1/2)+(1/16)*2^(1/2)*(5^(1/2)+1)

 

%sin((7/30)*Pi) = (1/8)*2^(1/2)*3^(1/2)*(5+5^(1/2))^(1/2)+1/8-(1/8)*5^(1/2)

 

%sin((1/4)*Pi) = (1/2)*2^(1/2)

 

%sin((4/15)*Pi) = ((1/8)*5^(1/2)-1/8)*3^(1/2)+(1/8)*2^(1/2)*(5+5^(1/2))^(1/2)

 

%sin((17/60)*Pi) = ((1/8)*3^(1/2)+1/8)*(5-5^(1/2))^(1/2)+(1/16)*2^(1/2)*(5^(1/2)+1)*3^(1/2)-(1/16)*2^(1/2)*(5^(1/2)+1)

 

%sin((3/10)*Pi) = 1/4+(1/4)*5^(1/2)

 

%sin((19/60)*Pi) = ((1/8)*(5+5^(1/2))^(1/2)+(1/16)*2^(1/2)-(1/16)*2^(1/2)*5^(1/2))*3^(1/2)+(1/16)*2^(1/2)*5^(1/2)-(1/16)*2^(1/2)+(1/8)*(5+5^(1/2))^(1/2)

 

%sin((1/3)*Pi) = (1/2)*3^(1/2)

 

%sin((7/20)*Pi) = -(1/8)*2^(1/2)+(1/4)*(5+5^(1/2))^(1/2)+(1/8)*2^(1/2)*5^(1/2)

 

%sin((11/30)*Pi) = (1/8)*2^(1/2)*3^(1/2)*(5-5^(1/2))^(1/2)+1/8+(1/8)*5^(1/2)

 

%sin((23/60)*Pi) = (-1/8+(1/8)*3^(1/2))*(5-5^(1/2))^(1/2)+(1/16)*2^(1/2)*(5^(1/2)+1)*3^(1/2)+(1/16)*2^(1/2)*(5^(1/2)+1)

 

%sin((2/5)*Pi) = (1/4)*2^(1/2)*(5+5^(1/2))^(1/2)

 

%sin((5/12)*Pi) = (1/4)*2^(1/2)*(1+3^(1/2))

 

%sin((13/30)*Pi) = (1/8)*2^(1/2)*3^(1/2)*(5+5^(1/2))^(1/2)+(1/8)*5^(1/2)-1/8

 

%sin((9/20)*Pi) = (1/4)*(5-5^(1/2))^(1/2)+(1/8)*2^(1/2)*(5^(1/2)+1)

 

%sin((7/15)*Pi) = (1/8)*2^(1/2)*(5-5^(1/2))^(1/2)+(1/8+(1/8)*5^(1/2))*3^(1/2)

 

%sin((29/60)*Pi) = (-(1/16)*2^(1/2)+(1/8)*(5+5^(1/2))^(1/2)+(1/16)*2^(1/2)*5^(1/2))*3^(1/2)+(1/8)*(5+5^(1/2))^(1/2)+(1/16)*2^(1/2)-(1/16)*2^(1/2)*5^(1/2)

(1)

 


 

Download sine.mw

You can do this using  plots:-textplot  and  plot  commands as follows:

The code:

restart;
with(plots):
T:=[[0,0.9, "2*5+8 = 2*5+8"], font=[times,20]]:
T1:=textplot(op(T)):
Line:=plot([[t,0.87,t=-0.56..-0.28],[t,0.87,t=0.1..0.38]], color=black):
display(T1, Line, size=[300,70], view=[-1..1,0.6..1.3], axes=none);

Output:
                                            


You can even make an animation of this. For the animation we used the technique from this post .

The code:

A:=animate(textplot,subsop(1=[T[1,1..2][],T[1,3][1..round(i)]],T), i=0..length(T[1,3]), frames=40, paraminfo=false, view=[-1..1,0.6..1.3], size=[300,70], axes=none):
B1:=animate(plot,[[t,0.87,t=-0.56..a], color=black], a=-0.56..-0.28, frames=10, paraminfo=false):
B2:=animate(plot,[[t,0.87,t=0.1..a], color=black], a=0.1..0.38, frames=10, paraminfo=false):
display([A, display(op([1,-1,1],A),B1), display(op([1,-1,1],A),op([1,-1,1],B1),B2)], insequence);

  Output: 

                       

Premature calculation occurs, before the substitution of values  i  into the series. This is easy to see if you write down it as an inert sum:

Sum(0^i/i!, i=0..infinity);
                                                      

 
For correct calculation use  eval  command:

eval(sum(x^i/i!, i=0..infinity), x=0);
                                                             
1
 

I also did not understand exactly what you want to plot. You have a system of 5 unknown functions of the variable  t . Below I showed how you can plot the graph  V  vs  t. For other functions, everything is the same.

DEplot({diff(C(t), t) = rho*lambda*S(t)+rho*epsilon*lambda*V(t)+(1-q)*eta*I(t)-(mu+beta+chi)*C(t), diff(I(t), t) = (1-rho)*lambda*S(t)+(1-rho)*epsilon*lambda*V(t)+chi*C(t)-(mu+alpha+eta)*I(t), diff(R(t), t) = beta*C(t)+q*eta*I(t)-(mu+delta)*R(t), diff(S(t), t) = (1-p)*pi+phi*V(t)+delta*R(t)-(mu+lambda+vartheta)*S(t), diff(V(t), t) = p*pi+vartheta*S(t)-(epsilon*lambda+mu+phi)*V(t)}, {C(t), I(t), R(t), S(t), V(t)}, t = 0 .. 300, number = 5, stepsize = .1, [[S(0) = 8200, V(0) = 2800, C(0) = 200, I(0) = 210, R(0) = 200]], linecolour = t, axes = BOXED, scene = [t, V(t)]);

 

In fact, you study the monotonicity of the function  x-> (3*x-1)/(x^3+2*x+1)  in some intervals (for example for  x>0). For this instead  is  and  assume  command, I would just have used a plot, and to refine the intervals of increase and decrease, I would use the derivative:

restart;
f := x-> (3*x-1)/(x^3+2*x+1):
plot(f, 0..10, size=[700,300]);
R1:=solve({diff(f(x), x)>0, x>0});
R2:=solve({diff(f(x), x)<0, x>0});
evalf([R1, R2]);

 

I successfully restarted your worksheet and saved it again. Probably the cause of the problem was in the absence of any delimiters between the individual lines of your code (I had put them).

Plot_Diff_Temperature_new.mw

local D:
with(LinearAlgebra):
A:=RandomMatrix(1,1);
B:=RandomMatrix(1,5);
C:=RandomMatrix(5,1);
D:=RandomMatrix(5,5);
Matrix(2,2,{(1,1)=A,(1,2)=B,(2,1)=C,(2,2)=D});


Another way:

local D:
with(LinearAlgebra):
A:=RandomMatrix(1,1);
B:=RandomMatrix(1,5);
C:=RandomMatrix(5,1);
D:=RandomMatrix(5,5);
Matrix(2,2, ['A', 'B', 'C', 'D']):
M:=%;


Edit.

1. cutin  and  cutout  commands work only in 3D. If you try to run them in 2D, you receive an error message.

2. Yes,  project  command allows you to get shadows from some objects in 2D and 3D, but only with orthogonal projection. For an arbitrary projection, you can use  plottools[transform]  command.

with(plots): with(plottools):
P:=polygon([[0,0],[0,1],[1,1]], color=blue):
P1:=polygon([[0,0,1],[0,1,1],[1,1,1]], color=blue):
Q1:=polygon([[0,0,1],[0,1,1],[1,1,1]], color=grey):
display(cutin(P,1/2), axes=normal);  # An error
display(cutin(P1,1/2), axes=normal, view=[0..1,0..1,0..2]);
display(cutout(P,1/2), axes=normal);  # An error
display(cutout(P1,1/2), axes=normal, view=[0..1,0..1,0..2]);
display(cutout(P1,1/2), project(cutout(Q1,1/2), [[0,0,0],[1,0,0],[0,1,0]]), view=[0..1,0..1,0..2], axes=normal);  # Getting an shadow 

 

Formal parameters of the procedure: is a certain number, and  n  is a positive integer.

restart;
EVALF:=proc(x,n::posint)
local m;
m:=ilog10(evalf(x));
Digits:=m+n+3;
Float(round(Float(evalf(x), n)), -n);
end proc:
 

 
Examples of use:

EVALF(Pi, 3);
                                            
3.142

EVALF(Pi, 15);
                                  
3.141592653589793


Edit.

To obtain a numerical solution, you must specify the parameter values and add the initial conditions.

An example of the solution:

restart;
Sys:={-(9/14)*R(t)^(19/14)-(285/196)*(diff(R(t), t, t))/R(t)^(9/14)+(2565/2744)*(diff(R(t), t))^2/R(t)^(23/14) = -k*(4*lambda+1/a(t)^3),
R(t)= 6*((diff(a(t), t))^2/a(t)^2+(diff(a(t),t,t))/a(t))}:
k:=2: lambda:=1:
Sol:=dsolve(Sys union {R(0)=0.5,a(0)=1.5,D(R)(0)=0,D(a)(0)=1}, {R(t),a(t)}, numeric);
plots:-odeplot(Sol,[[t,R(t)],[t,a(t)]], t=0..7, color=[red,blue]);

                           

Another way to solve the problem is to call  RealDomain  package. Then all calculations Maple does in the real domain:

with(RealDomain):
P:=plot([(x^3-x^2)^(1/3), x-1/3, [[0,0]], [[1,0]], [[2/3,0]], [[0,-4^(1/3)/3]], [t,-4^(1/3)/3,t=0..2/3], [2/3,t,t=0..-4^(1/3)/3] ], x=-2.5..2.5, y=-2.3..2.3, style=[line$2,point$4,line$2], linestyle=[1,3,2$2], color=[red,black,red$4,black$2], thickness=[2,1], symbol=solidcircle, symbolsize=[8,8,11,11], size=[600,500], scaling=constrained, caption = typeset("A plot of   ", ``(x^3-x^2)^(1/3)), captionfont=[times,16]):
T:=plots:-textplot([[0.75,0.15,2/3], [0.15,-0.7,-4^(1/3)/3], [0.9,1,y=x-1/3]]):
plots:-display(P,T);

       

 

 

This can be done in several ways. Here are two ways:

convert(3^665, string)[-10..-1];  # The last 10 digits
                                                               "7817543843"

seq(convert(3^665, base, 10)[i], i=10..1,-1);
                                                       
 7, 8, 1, 7, 5, 4, 3, 8, 4, 3

Try this:

Vv := Eigenvalues(prod);
simplify(Vv);

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