Kitonum

13999 Reputation

24 Badges

11 years, 189 days

MaplePrimes Activity


These are answers submitted by Kitonum


 

L__lsubs := (8*z22l^2*(z22p^2)*(z12p^2)*((((1/4)*(r^2*m__r)+I__wsl+I__zsl)*(L^2)+(1/4)*(r^2*I__r))*(z12l^2)+L^2*eta__l*(z11l^2)*(I__zpl+I__wpl+I__zpkl))*acc_l+2*z22l^2*(z12l^2)*(r*(L^2*m__r+I__r)*acc_p+2*L^2*m__r*(-phi_dot*sin(aphi)*v_y+cos(aphi)*acc_y-phi_dot*cos(aphi)*v_x-sin(aphi)*acc_x))*(z22p^2)*r*(z12p^2))*(1/(8*z12l^2*(z22l^2)*(z12p^2)*(z22p^2)*(L^2)))+F__x[1]*r__m[1]*sin(alpha__m[1])*omega__m-F__y[1]*r__m[1]*cos(alpha__m[1])*omega__m+F__x[2]*r__m[2]*sin(alpha__m[2])*omega__m-F__y[2]*r__m[2]*cos(alpha__m[2])*omega__m+F__x[3]*r__m[3]*sin(alpha__m[3])*omega__m-F__y[3]*r__m[3]*cos(alpha__m[3])*omega__m+F__x[4]*r__m[4]*sin(alpha__m[4])*omega__m-F__y[4]*r__m[4]*cos(alpha__m[4])*omega__m+F__x[5]*r__m[5]*sin(alpha__m[5])*omega__m-F__y[5]*r__m[5]*cos(alpha__m[5])*omega__m+F__x[6]*r__m[6]*sin(alpha__m[6])*omega__m-F__y[6]*r__m[6]*cos(alpha__m[6])*omega__m+F__x[7]*r__m[7]*sin(alpha__m[7])*omega__m-F__y[7]*r__m[7]*cos(alpha__m[7])*omega__m+F__x[8]*r__m[8]*sin(alpha__m[8])*omega__m-F__y[8]*r__m[8]*cos(alpha__m[8])*omega__m+F__x[9]*r__m[9]*sin(alpha__m[9])*omega__m-F__y[9]*r__m[9]*cos(alpha__m[9])*omega__m+F__x[10]*r__m[10]*sin(alpha__m[10])*omega__m-F__y[10]*r__m[10]*cos(alpha__m[10])*omega__m+.5000000000*F__x[21]*r__m[21]*sin(alpha__m[21])*omega__m-.5000000000*F__y[21]*r__m[21]*cos(alpha__m[21])*omega__m-(-D__l*v_l+M__sl)*(z12l^2)*(z22l^2)*s_l*(1/z11l^2)*(1/z21l^2):

solve(L__lsubs, v_l):
algsubs(z12l^2*L^2*z11l^2*z21l^2=K, %):
collect(%,K):
V__kl := subs(K=z12l^2*L^2*z11l^2*z21l^2, %);

-.2500000000*(-2.*m__r*phi_dot*r*v_x*cos(aphi)-2.*m__r*phi_dot*r*v_y*sin(aphi)+1.*acc_l*m__r*r^2+1.*acc_p*m__r*r^2-2.*acc_x*m__r*r*sin(aphi)+2.*acc_y*m__r*r*cos(aphi)+4.*omega__m*F__x[1]*r__m[1]*sin(alpha__m[1])+4.*omega__m*F__x[2]*r__m[2]*sin(alpha__m[2])+4.*omega__m*F__x[3]*r__m[3]*sin(alpha__m[3])+4.*omega__m*F__x[4]*r__m[4]*sin(alpha__m[4])+4.*omega__m*F__x[5]*r__m[5]*sin(alpha__m[5])+4.*omega__m*F__x[6]*r__m[6]*sin(alpha__m[6])+4.*omega__m*F__x[7]*r__m[7]*sin(alpha__m[7])+4.*omega__m*F__x[8]*r__m[8]*sin(alpha__m[8])+4.*omega__m*F__x[9]*r__m[9]*sin(alpha__m[9])+4.*omega__m*F__x[10]*r__m[10]*sin(alpha__m[10])+2.*omega__m*F__x[21]*r__m[21]*sin(alpha__m[21])-4.*omega__m*F__y[1]*r__m[1]*cos(alpha__m[1])-4.*omega__m*F__y[2]*r__m[2]*cos(alpha__m[2])-4.*omega__m*F__y[3]*r__m[3]*cos(alpha__m[3])-4.*omega__m*F__y[4]*r__m[4]*cos(alpha__m[4])-4.*omega__m*F__y[5]*r__m[5]*cos(alpha__m[5])-4.*omega__m*F__y[6]*r__m[6]*cos(alpha__m[6])-4.*omega__m*F__y[7]*r__m[7]*cos(alpha__m[7])-4.*omega__m*F__y[8]*r__m[8]*cos(alpha__m[8])-4.*omega__m*F__y[9]*r__m[9]*cos(alpha__m[9])-4.*omega__m*F__y[10]*r__m[10]*cos(alpha__m[10])-2.*omega__m*F__y[21]*r__m[21]*cos(alpha__m[21])+4.*I__wsl*acc_l+4.*I__zsl*acc_l)*z11l^2*z21l^2/(D__l*s_l*z12l^2*z22l^2)-.2500000000*(-4.*L^2*M__sl*s_l*z12l^4*z22l^2+(4.*I__wpl*acc_l*eta__l+4.*I__zpkl*acc_l*eta__l+4.*I__zpl*acc_l*eta__l)*L^2*z11l^4*z21l^2+(I__r*acc_l*r^2+I__r*acc_p*r^2)*z11l^2*z12l^2*z21l^2)/(D__l*L^2*s_l*z12l^4*z22l^2)

(1)

 


 

Download simpl.mw

Here is a procedure for this:

restart;
MatrixPoly:=proc(nu,M)
local k, Poly, POL; 
for k while k <= M do
Poly[k] := simplify(sum(x^i*GAMMA(nu+1)/(factorial(i)*GAMMA(2*nu)), i = 0 .. k-1));
end do:
POL := <seq(Poly[k], k = 1 .. M)>;
Matrix(M,M, (i,j)->Poly[i]((j-1)/(M-1)));
end proc:

# Examples
MatrixPoly(1,3);
MatrixPoly(1,4);

 

Edit. Regarding the second problem, it seems I am guessing that you want to create a vector consisting of the values of some function if the argument runs from   to   through equal steps (total  M  points). If so then

Vec:=(a,b,f,M) -> <seq(f(a+(b-a)*k/(M-1)),k=0..M-1)>:

# Example
Vec(1,2,sin,10)

 

We can put quotes around function names and omit the square brackets. This will work a little faster:

plot3d('R_ep'(epsilon, t-n, n, 'qN_ep'(epsilon, t-n, n)), n = 1 .. t, epsilon = 10^(-8) .. 10^(-1));

 

I do not see any bugs in these calculations. Note that  symbolic option works with symbolic expressions. When working with numeric expressions, it is simply ignored. Compare

simplify((p^3)^(1/3),symbolic);
simplify(((-1)^3)^(1/3),symbolic);

                               p
                     1/2+I*sqrt(3)*(1/2)


The second calculation is also correct, as the default Maple works in the complex domain, and returns the principal value of the root (of three values). If you work in the real domain, then use the  surd  function instead of raising to the power 1/3:

surd(-1, 3);

                                 -1

Maple does not simplify the value for (-1)^(1/7)  (in contrast to (-1)^(1/3)), because it is not expressed in radicals, but can be calculated numerically:

simplify((-1)^(1/7));
evalf(%);

                                  (-1)^(1/7)
                    0.9009688678+0.4338837392*I


Maple can also convert   (-1)^(1/7)  to trigonometric form:

convert((-1)^(1/7), trig);
# Or
evalc((-1)^(1/7));

                            cos((1/7)*Pi)+I*sin((1/7)*Pi)
                            cos((1/7)*Pi)+I*sin((1/7)*Pi)

I is protected in Maple (it is the imaginary unit). I replaced I with J :

matrix_inversion_new.mw
 

Use  factor  instead of  collect :

A:=factor(c4*dnub*kpbr*ksr*nur*nurdel + c4*dnur*kpbr*ksr*nub*nurdel);
`*`(op(1..3,A))*expand(`*`(op(4..5,A)));

                       A := c4*kpbr*ksr*nurdel*(dnub*nur+dnur*nub)
                      c4*kpbr*ksr*(dnub*nur*nurdel+dnur*nub*nurdel)

restart;
f:=(a+b)*x1+(a^2+b^2)*(x1+x2^2)+c*(x2-x3)*a*b:
p:=[a+b,a^2+b^2,c*b*a]:
R:=p=~1:
cof:=[seq(algsubs(R[i], [op(f)][i]),i=1..nops(p))];

                    cof := [x1, x2^2+x1, x2-x3]

In Maple 2018 we can make it significantly shorter (I mean vv's answer):

Op := cosh(cos(2*t)); 
simplify(convert(Op, exp)); 
map(int, %, t = 0 .. 2*Pi);

                       

Edit. The same code works in Maple 2015 - 2017. It probably also works in Maple 2019 (I don't have this version).

 

 

You have to give different names for different values of  , so I replaced  Sol_f[H]  with  Sol_f[k] . Next, you should get the data for each  k  in the form of a Matrix or Array. In the example, when creating the matrix  M , I divided the range  x=0..1  into 10 parts. Of course you yourself can choose any number of parts. Below I show how this can be done for k = 1. You can export these data to Excel using  ExcelTools:-Export  command. Read help for this.

 

Download Untitled_new.mw

 

Try:
<x^`1`, x^`2`, x^`3`>;


or it can be done programmatically if the vector is already created:

X:=<x^1,x^2,x^3>;
map(t->`if`(degree(t)=1,t^`1`,op(1,t)^convert(op(2,t), symbol)), X);


Edit.

Use the  iterationlimit  option.
An example  (the first 10 iteration):


 

restart;
f:=exp((x-1)^2+(y-2)^2);
for n from 1 to 10 do
Optimization:-Minimize(f,iterationlimit=n);
od;

exp((x-1)^2+(y-2)^2)

 

Warning, limiting number of major iterations has been reached

 

[1.81901572956640600, [x = HFloat(1.0), y = HFloat(1.226504332999335)]]

 

Warning, limiting number of major iterations has been reached

 

[1.32496336351766475, [x = HFloat(1.0), y = HFloat(1.4695428303052498)]]

 

Warning, limiting number of major iterations has been reached

 

[1.08640405640444282, [x = HFloat(1.0), y = HFloat(1.7121229227272186)]]

 

Warning, limiting number of major iterations has been reached

 

[1.00875957757874946, [x = HFloat(1.0), y = HFloat(1.9066113761809975)]]

 

Warning, limiting number of major iterations has been reached

 

[1.00009123567627167, [x = HFloat(1.0), y = HFloat(1.9904484810343832)]]

 

Warning, limiting number of major iterations has been reached

 

[1.00000000834270875, [x = HFloat(1.0), y = HFloat(1.999908661570679)]]

 

Warning, limiting number of major iterations has been reached

 

[1., [x = HFloat(1.0), y = HFloat(1.9999999915877624)]]

 

[1., [x = HFloat(1.0), y = HFloat(2.0)]]

 

[1., [x = HFloat(1.0), y = HFloat(2.0)]]

 

[1., [x = HFloat(1.0), y = HFloat(2.0)]]

(1)

 


We see that already at the 8th iteration, the desired accuracy was achieved.

Edit.

Download number_iter.mw

with(plots):
with(plottools):
setoptions(style=patch,view=[-5..5,-5..5], scaling=constrained):
basis_i:=polygon([[0,0],[1,0],[0,1]],color=red):

N:=20:
F:=(x,y) -> (1-k/N)*<x,y> + k/N*(A.<x,y>):
L := transform((x,y)->convert(F(x,y),list)):
A:=<<2,1>|<-1,1>>;
                          
frames:=seq(display(L(basis_i)),k=0..N):

display(frames, insequence=true);

         

Or

with(plots):
with(plottools):
setoptions(style=patch,view=[-5..5,-5..5], scaling=constrained):
basis_i:=polygon([[0,0],[1,0],[1,1],[0,1]],color=red):

N:=20:
F:=(x,y) -> (1-k/N)*<x,y> + k/N*(A.<x,y>):
L := transform((x,y)->convert(F(x,y),list)):
A:=<<2,1>|<-1,1>>;
                          
frames:=seq(display(L(basis_i)),k=0..N):

display(frames, insequence=true);

         

Or here is another technique for animating linear transformation of a square grid:

restart;
with(plots):
with(plottools):
Square_grid:=display(seq(line([0,i],[5,i],color=red),i=0..5),seq(line([j,0],[j,5],color=red),j=0..5)):

F:=(x,y) -> (1-t)*<x,y> + t*(A.<x,y>):
L := transform((x,y)->convert(F(x,y),list)):
A:=<<2,1>|<-1,1>>:

animate(display,[L(Square_grid)], t=0..1, frames=60, scaling=constrained, size=[700,500]);

         


If you want to get an animation of a n-th iteration of this mapping, replace the last line of code with

animate(display,[(L@@n)(Square_grid)], t=0..1, frames=60, scaling=constrained, size=[700,500]);

where  n>=2  is an integer.

Edit.


 

restart;

f := ((1 - a)^2 + a^2*((1 - exp(-y))*(1 - exp(-x)) - 2 + exp(-x) + exp(-y)) + a*(2 - exp(-x) - exp(-y) + (1 - exp(-y))*(1 - exp(-x))))/(1 - a*exp(-x)*exp(-y))^3;

((1-a)^2+a^2*((1-exp(-y))*(1-exp(-x))-2+exp(-x)+exp(-y))+a*(2-exp(-x)-exp(-y)+(1-exp(-y))*(1-exp(-x))))/(1-a*exp(-x)*exp(-y))^3

(1)

a := 3/10; f;
A:=int(f*exp(-x)*exp(-y), x = 0 .. y + t) assuming y>0,y+t>0;

3/10

 

(91/100+(39/100)*(1-exp(-y))*(1-exp(-x))-(21/100)*exp(-x)-(21/100)*exp(-y))/(1-(3/10)*exp(-x)*exp(-y))^3

 

10*exp(y)*(10*exp(2*y+2*t)-13*exp(y+t)+3)/(100*exp(4*y+2*t)-60*exp(2*y+t)+9)

(2)

s := IntegrationTools:-Change(Int(A, y = 0 .. infinity),y1=2*y+t, y1);
simplify(value(s)) assuming t>0; # The final result
plot(%, t=0..10); # The plot of this function

Int(5*exp((1/2)*y1-(1/2)*t)*(10*exp(y1+t)-13*exp((1/2)*y1+(1/2)*t)+3)/(100*exp(2*y1)-60*exp(y1)+9), y1 = t .. infinity)

 

(3*30^(1/2)*(exp(-(1/2)*t)-(13/3)*exp((1/2)*t)+(10/3)*exp((3/2)*t))*arccoth((1/3)*exp((1/2)*t)*30^(1/2))+30*exp(t)-9)/(-18+60*exp(t))

 

 

 

 


Edit.

Download stat1_new1.mw

For a better understanding of the rule of the numbering of these points, I made an animation of this process. I reduced the number of points to 70, otherwise the file turned out to be too large and there were problems. We see that the numbering occurs in a spiral of Archimedes, which spins counterclockwise with an angular pitch of approximately 138 degrees:

sunflower_new1.mw

  

 Edit.    

We use polar coordinates. First we find  r0  corresponding to the intersection of these surfaces:


 

restart;
x:=r*cos(phi): y:=r*sin(phi):
solve({z=x^2+y^2,z=8-x^2-y^2});
r0:=sqrt(eval(z,%[1]));
plot3d([[x,y,8-r^2],[x,y,r^2]], r=0..r0, phi=0..2*Pi, scaling=constrained);

{phi = phi, r = 2, z = 4}, {phi = phi, r = -2, z = 4}

 

2

 

 

 


 

Download polar.mw

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