13999 Reputation

11 years, 189 days

Simplification...

 > 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, %);
 (1)
 >

Procedure...

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

Option...

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

No bugs...

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 :

factor...

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)

A way...

```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]

Shorter in Maple 2018...

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

Solution...

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.

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.

iterationlimit ...

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

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

Edit.

```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.

assuming, IntegrationTools:-Change...

 > 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 := 3/10; f; A:=int(f*exp(-x)*exp(-y), x = 0 .. y + t) assuming y>0,y+t>0;
 (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
 >
 >

Edit.

Animation of this...

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.

polar...

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