Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I would like to assign the values of basis vectors which are calculated by PlanePlot. Is there anyone who knows how to use them or how to imitate the command?

PlanePlot(z+tan(-Pi/2+alph||29)*(x*sin(-Pi/2+gam||29)-y*cos(-Pi/2+gam||29))=0, [x,y,z],showbasis):
normal vector: <-.2497, .7343e-1, 1.>
equation of plane: -.2497*x+.7343e-1*y+1.*z = 0.
point on plane nearest origin: <-0., 0., 0.>
basis vectors: <.7106e-1, .9959, -.5539e-1>, <.9678, -.5539e-1, .2457>

It looks like as below:

I was expanding an expressions, and found that Maple expands trig also. Then found there is a way to turn that off. Which is great. I tested it in my worksheet and it works. But when I put the same code inside my module, I get an error.  It seems like some scoping issue which I do not understand.

Here is a MWE

restart;
expr:=(1+x)*sin(3*x+k);
forget(expand);
expand(expandoff());
expandoff(cos,sin,exp);
F:=expand(expr);
forget(expand);

which gives 

Which does what I want. But inside a proc, the code fails

foo:=proc(expr)
local F;

forget(expand);
expand(expandoff());
expandoff(cos,sin,exp);
F:=expand(expr);
forget(expand);

end proc;

And now when calling it as 

expr:=x*sin(3*x+k);
foo(expr)

What Am I doing wrong? And how to make it work? I need to prevent expand() from expanding these functions. Help says that expand has memory table, and I want to clear that before and after doing this, so it does not affect later code.

Maple 2021.1

Update

I just found out, if I add a restart before defining my function, then the error goes away

restart;
expr:=(1+x)*sin(3*x+k);
forget(expand);
expand(expandoff());
expandoff(cos,sin,exp);
F:=expand(expr);
forget(expand);

restart;  # had to add this. But why??
foo:=proc(expr)
local F;

forget(expand);
expand(expandoff());
expandoff(cos,sin,exp);
F:=expand(expr);
forget(expand);
end proc;

#
expr:=(1+x)*sin(3*x+k);
foo(expr)

#no error. now it works

I need this to work repeatedly inside a module, so I can't do restart each time ofcourse like the above.

Even if I do restart before defining the function, next time I call it, it will fail:

 

restart; 
foo:=proc(expr)
local F;

forget(expand);
expand(expandoff());
expandoff(cos,sin,exp);
F:=expand(expr);
forget(expand);
end proc;

#
expr:=(1+x)*sin(3*x+k);
foo(expr); #OK
foo(expr); #FAILED

Very strange. 

We consider a fixed circle (C) tangent to a fixed line Δ at a given point O of this line. 
Circles Γ tangent to circles C in M and to the right Δ in N are studied.
 Show that the MN line passes through a fixed point I. Infer that the circles Γ remain orthogonal to a fixed circle.
My code is :
 restart; with(geometry);with(plots);
_EnvHorizontalName := 'x';_EnvVerticalName := 'y';
dist := proc (M, N) sqrt(Vdot(expand(M-N), expand(M-N))) end proc;
point(oo, 0, 3); p := 6;
point(N, 5, 0);
line(Delta, y = 0, [x, y]);
para := x^2 = 2*p*y;
solve(subs(x = 5, para), y); point(varpi, 5, 25/12);
line(alpha, [oo, varpi]); k := 3/(25/12);
point(M, (0+5*k)/(1+k), (3+25*k*(1/12))/(1+k)); 
circle(C, x^2+(y-3)^2 = 9, [x, y]);cir := implicitplot(x^2+(y-3)^2 = 9, x = -5 .. 5, y = -5 .. 7, color = blue);
Para := implicitplot(para, x = -40 .. 40, y = 0 .. 40, linestyle = 3, color = coral);
homothety(J, N, -k, M); coordinates(J);
circle(C1, (y-25/12)^2+(x-5)^2 = (25/12)^2, [x, y]);line(lNJ, [N, J]);
triangle(T1, [J, oo, M]); triangle(T2, [N, varpi, M]);
C1 := implicitplot((y-25/12)^2+(x-5)^2 = (25/12)^2, x = 2 .. 8, y = 0 .. 5, color = magenta);dr1 := draw([oo, Delta, varpi, N, M, J], printtext = true); dr2 := draw([alpha(color = black), lNJ(color = black), T1(color = green, filled = true), T2(color = green, filled = true)]);
inversion(M, M, C);
inversion(N, M, C);
Fig := proc (xOm)
local cir, c2, C2, C1, c3, C3, k, M, N, J, sol, dr, varpi;
global p, para, Para;
sol := solve(subs(x = xOm, para), y);
cir := (y-sol)^2+(x-xOm)^2 = sol^2; c2 := x^2+(y-3)^2 = 9;
geometry:-point(N, xOm, 0); sol := solve(subs(x = xOm, para), y);
geometry:-point(varpi, xOm, sol); k := 3/sol;
geometry:-point(M, xOm*k/(k+1), (3+k*sol)/(k+1));
geometry:-homothety(J, N, -k, M);
c3 := (x-(1/2)*xOm)^2+(y-3)^2 = (1/4)*dist(N, J)^2;
C1 := plots:-implicitplot(cir, x = -xOm .. 3*xOm, y = 0 .. 3*xOm, color = magenta);
C2 := plots:-implicitplot(c2, x = -xOm .. 2*xOm, y = 0 .. 2*xOm, color = blue);
C3 := plots:-implicitplot(c3, x = -xOm .. 2*xOm, y = 0 .. 2*xOm, color = blue);
dr := geometry:-draw([varpi, M, J]);
plots:-display([Para, C2, C1, C3, dr], view = [-xOm .. 3*xOm, -1 .. 3*xOm], axes = normal, scaling = constrained) end proc;

Fig(8);
display([seq(Fig(4+.8*i), i = 4 .. 15)]);
display({C1, Para, cir, dr1, dr2}, view = [-8 .. 8, -1 .. 8], axes = normal, scaling = constrained, size = [500, 500]);
I don't know what is that orthogonal circle to each tangent circles. Thank you to help me.

.

I can't find how to use Maple structured type, to check for say sin(x) and say sin(x)^2 without having to duplicate the code and make a structured type for each of the two cases. An example will explain.

I need to check if expression is of this form   m*sin(anything)^n*cos(anything)^r  Where in this example below, m,n,r can be integer or rational.     

The problem is that 'specfunc'(sin)^Or(integer,rational) will not match sin(x) but will only match if sin(x) is raised to an actual power different from default 1.

So I have to duplicate the check below, by writing Or('specfunc'(sin),'specfunc'(sin)^Or(integer,rational) and the same for cos(x). I am trying to avoid all this duplication, because as the structured type becomes more involved, it will hard to read and work with like this.

Is there a way to eliminate this? In Mathematica for example, this is done using the pattern   x_. where the little dot at the end there, allows for zero of more. So for the above, it will be  Sin[x_]^n_. and this will match Sin[anything] and also match Sin[anything]^2 

I know it is possible to use patmatch in Maple to do this, but is it possible without using pathmatch and just using structured types? as I am trying to do everything without having to use patmatch now.

restart;
my_type:=''`*`'( { Or('specfunc'(sin),'specfunc'(sin)^Or(integer,rational)),
                   Or('specfunc'(cos),'specfunc'(cos)^Or(integer,rational)),
                   Or(integer,rational)})';
type(3*sin(x)^2*cos(x)^3,my_type);
type(sin(x)^2*99*cos(x),my_type);
type(sin(x)*cos(x),my_type);
type(cos(x)*sin(x)^(1/2),my_type);

gives

btw, the help page for structured type mentiones zero or more occurances of but do not know how to do this for the above example

 

$-\Delta u=1$ in $D$

$\frac{\partial u}{\partial\nu}+(x_1^2+1)u=0$ on $\partial D$

where $D=\{(x_1,x_2) : x_1^2+x_2^2<1\}$.

restart;
line := x/100 - 1/2;
wave := cos(x / 5) * sin(x / 2); ## -1 <= wave <= 1
eq:= line - wave;
r1 := solve(line < -1); ## RealRange(-infinity,Open(-50))
r2 := solve(line > 1);  ## RealRange(Open(150),infinity)
## There are 27 solutions in RealRange(-50,150)

I searched Questions.  Found many solutions.  The only one that seems to work is Student[Calculus1]:-Roots()

Is there another way to do this?

I am trying to solve a system of polynomial equations (with rational number coefficients). For this I am computing its Gröbner basis using the F4 algorithm implemented in Maple. (`Groebner[Basis]`).

As far as I understand it, the algorithms solves the problem modulo one or more prime number and later reconstructs the full (rational number) solution. Usually it only takes a handfull of primes. But in my case it by now solved the problem successfully modulo about ~300 different primes, each time doing exactly the same computation (according to the log files running with `infolevel[GroebnerBasis]:=5`).

Could somebody enlighten me what this means? In particular, can I interpret this as indication that the system of equations does have or does not have a solution?

  • My system of equations is rather large. Each individual solve modulo a prime takes half an hour on a powerful workstation pc. Other computeralgebra systems without Faugère's algorithms cant solve it at all.
  • (part of) the output can be found here: https://gist.github.com/krox/484252f075eb19edd0ac865099a564ba . The curious thing to me is that each solve behaves exactly the same. So why is maple repeating it with different primes over and over again?

Hi there, I just wanna solve a nonlinear diff equation for a 2 variables function phi.

Boundary conditions :

  1. at the wall over NACA 0012 : the derivatives wrt x & y are null
  2. for y at infinity : the derivatives wrt x & y are null

How to deal with curved body unlike the flat plate ?

Thanks for your help in advance!

I want to compute the Lie derivative of a large expression in maple.
The expression is attached, there are 20 vars in total. But Maple cannot do that (after 7hrs of working!), but this is doable with another math tool which first turns the expression into subexpressions.
However, I want to do this in Maple.
I have already tried to simplify/combine/factor/use the Lie algebra package, none of them helped.
Any suggestion is highly appreciated

 

(6*m__1*(2*x[13]*x[12]*((x[12]*(cos(x[7])^2 - 2)*(x[17] - g__1)*cos(x[8])^2 - 2*x[12]*(x[17] - g__1)*cos(x[7])^2 + x[18]*cos(x[7])*sin(x[7])*sin(x[8]) + x[12]*(x[17] - g__1))*cos(x[6])^2 - 2*cos(x[8])*(x[12]*sin(x[8])*(x[17] - g__1)*sin(x[7]) + x[18]*cos(x[7])/2)*sin(x[6])*cos(x[6]) + x[12]*cos(x[8])^2*(x[17] - g__1))*cos(x[4])^5 + ((-x[12]*x[13]*x[18]*sin(x[4])*(cos(x[7])^2 - 2)*cos(x[8])^2 + (((x[17] - g__1)*x[12]^2 + (2*x[17] - 2*g__1)*x[13]^2 - x[19])*x[12]*sin(x[8])*cos(x[7])^2 - 3*(x[12]^2*x[18] - (2*x[20])/9)*sin(x[7])*cos(x[7])/2 - 2*((x[17] - g__1)*x[12]^2 + (2*x[17] - 2*g__1)*x[13]^2 - x[19])*x[12]*sin(x[8]))*cos(x[8]) + 4*(x[18]*cos(x[7])^2/2 + x[12]*sin(x[7])*sin(x[8])*(x[17] - g__1)*cos(x[7]) - x[18]/4)*sin(x[4])*x[13]*x[12])*cos(x[6])^2 + (2*((x[17] - g__1)*x[12]^2 + (2*x[17] - 2*g__1)*x[13]^2 - x[19])*sin(x[7])*x[12]*sin(x[6])*cos(x[8])^2 - 4*(x[12]*x[13]*sin(x[4])*sin(x[6])*(x[17] - g__1)*cos(x[7]) - x[13]*x[18]*sin(x[4])*sin(x[6])*sin(x[7])*sin(x[8])/2 - x[12]*x[15]*(x[17] - g__1)/24)*x[12]*cos(x[8]) - (3*(x[12]^2*x[18] - (2*x[20])/9)*sin(x[8])*cos(x[7])/2 + ((x[17] - g__1)*x[12]^2 + (2*x[17] - 2*g__1)*x[13]^2 - x[19])*sin(x[7])*x[12])*sin(x[6]))*cos(x[6]) + x[12]*(-x[13]*x[18]*cos(x[8])^2*sin(x[4]) + ((x[17] - g__1)*x[12]^2 + (2*x[17] - 2*g__1)*x[13]^2 - x[19])*sin(x[8])*cos(x[8]) + x[12]*sin(x[8])*(x[17] - g__1)*(sin(x[6])*sin(x[7])*x[15] + x[14]*cos(x[7]))/6))*cos(x[4])^4 + ((-5*x[12]^2*x[13]*(cos(x[7])^2 - 2)*(x[17] - g__1)*cos(x[8])^2 - sin(x[4])*(3*(x[12]^2*x[18] - (2*x[20])/9)*sin(x[8])*cos(x[7])^2/2 + ((x[17] - g__1)*x[12]^2 + (2*x[17] - 2*g__1)*x[13]^2 - x[19])*sin(x[7])*x[12]*cos(x[7]) - 3*(x[12]^2*x[18] - (2*x[20])/9)*sin(x[8]))*cos(x[8]) + 7*(x[12]*(x[17] - g__1)*cos(x[7])^2 - (2*x[18]*cos(x[7])*sin(x[7])*sin(x[8]))/7 - (5*x[12]*(x[17] - g__1))/7)*x[13]*x[12])*cos(x[6])^2 - (3*sin(x[4])*(x[12]^2*x[18] - (2*x[20])/9)*sin(x[7])*cos(x[8])^2 - 10*(x[18]*cos(x[7])/5 + x[12]*sin(x[8])*(x[17] - g__1)*sin(x[7]))*x[13]*x[12]*cos(x[8]) + sin(x[4])*(((x[17] - g__1)*x[12]^2 + (2*x[17] - 2*g__1)*x[13]^2 - x[19])*x[12]*sin(x[8])*cos(x[7]) - 3*(x[12]^2*x[18] - (2*x[20])/9)*sin(x[7])/2))*sin(x[6])*cos(x[6]) - 5*x[12]^2*x[13]*(x[17] - g__1)*cos(x[8])^2 - (3*sin(x[4])*(x[12]^2*x[18] - (2*x[20])/9)*sin(x[8])*cos(x[8]))/2 + (x[17] - g__1)*(x[15]*cos(x[7])*sin(x[4])*sin(x[6])/6 - x[14]*sin(x[4])*sin(x[7])/6 + x[13])*x[12]^2)*cos(x[4])^3 - (7*x[12]*((-(4*x[13]*x[18]*sin(x[4])*(cos(x[7])^2 - 2)*cos(x[8])^2)/7 + (((x[17] - g__1)*x[12]^2 + ((4*x[17])/7 - (4*g__1)/7)*x[13]^2 - (2*x[19])/7)*sin(x[8])*cos(x[7])^2 - (5*x[12]*x[18]*cos(x[7])*sin(x[7]))/7 - 2*((x[17] - g__1)*x[12]^2 + ((4*x[17])/7 - (4*g__1)/7)*x[13]^2 - (2*x[19])/7)*sin(x[8]))*cos(x[8]) + 10*(x[18]*cos(x[7])^2/5 + x[12]*sin(x[7])*sin(x[8])*(x[17] - g__1)*cos(x[7]) - (2*x[18])/5)*sin(x[4])*x[13]/7)*cos(x[6])^2 + (2*((x[17] - g__1)*x[12]^2 + ((4*x[17])/7 - (4*g__1)/7)*x[13]^2 - (2*x[19])/7)*sin(x[7])*sin(x[6])*cos(x[8])^2 + (-(10*x[12]*x[13]*sin(x[4])*sin(x[6])*(x[17] - g__1)*cos(x[7]))/7 + (8*x[13]*x[18]*sin(x[4])*sin(x[6])*sin(x[7])*sin(x[8]))/7 + x[12]*x[15]*(x[17] - g__1)/21)*cos(x[8]) - ((5*x[12]*x[18]*cos(x[7])*sin(x[8]))/7 + ((x[17] - g__1)*x[12]^2 + ((4*x[17])/7 - (4*g__1)/7)*x[13]^2 - (2*x[19])/7)*sin(x[7]))*sin(x[6]))*cos(x[6]) - (4*x[13]*x[18]*cos(x[8])^2*sin(x[4]))/7 + ((x[17] - g__1)*x[12]^2 + ((4*x[17])/7 - (4*g__1)/7)*x[13]^2 - (2*x[19])/7)*sin(x[8])*cos(x[8]) + x[12]*x[14]*sin(x[8])*(x[17] - g__1)*cos(x[7])/21 + (2*x[13]*x[18]*sin(x[4]))/7 + x[12]*x[15]*sin(x[6])*sin(x[7])*sin(x[8])*(x[17] - g__1)/21)*cos(x[4])^2)/2 + 3*(((4*x[13]*(cos(x[7])^2 - 2)*(x[17] - g__1)*cos(x[8])^2)/3 + sin(x[4])*((2*x[18]*cos(x[7])^2*sin(x[8]))/3 + x[12]*sin(x[7])*(x[17] - g__1)*cos(x[7]) - (4*x[18]*sin(x[8]))/3)*cos(x[8]) - (2*x[13]*(cos(x[7])^2 - 2)*(x[17] - g__1))/3)*cos(x[6])^2 + ((4*x[18]*cos(x[8])^2*sin(x[4])*sin(x[7]))/3 - (8*x[13]*sin(x[7])*sin(x[8])*(x[17] - g__1)*cos(x[8]))/3 + (x[12]*sin(x[8])*(x[17] - g__1)*cos(x[7]) - (2*x[18]*sin(x[7]))/3)*sin(x[4]))*sin(x[6])*cos(x[6]) + (4*x[13]*(x[17] - g__1)*cos(x[8])^2)/3 + (2*x[18]*cos(x[8])*sin(x[4])*sin(x[8]))/3 - (2*x[13]*(x[17] - g__1))/3)*x[12]^2*cos(x[4]) + 2*(x[17] - g__1)*(cos(x[8])*sin(x[8])*(cos(x[7])^2 - 2)*cos(x[6])^2 + 2*(cos(x[8])^2 - 1/2)*sin(x[7])*sin(x[6])*cos(x[6]) + cos(x[8])*sin(x[8]))*x[12]^3)*L*cos(x[5])^6 + (12*m__1*sin(x[5])*((-((x[12]^2*x[18] - x[20]/6)*(cos(x[7])^2 - 2)*cos(x[8])^2)/2 + (x[12]^2*x[18] - x[20]/6)*cos(x[7])^2 + sin(x[7])*((x[17] - g__1)*x[12]^2 + (x[17] - g__1)*x[13]^2 - x[19]/2)*x[12]*sin(x[8])*cos(x[7]) - x[12]^2*x[18]/2 + x[20]/12)*cos(x[6])^2 - (((x[17] - g__1)*x[12]^2 + (x[17] - g__1)*x[13]^2 - x[19]/2)*x[12]*cos(x[7]) - (x[12]^2*x[18] - x[20]/6)*sin(x[7])*sin(x[8]))*cos(x[8])*sin(x[6])*cos(x[6]) - cos(x[8])^2*(x[12]^2*x[18] - x[20]/6)/2)*L*cos(x[4])^5 - 6*m__1*sin(x[5])*((sin(x[4])*(cos(x[7])^2 - 2)*((x[17] - g__1)*x[12]^2 + (x[17] - g__1)*x[13]^2 - x[19]/2)*x[12]*cos(x[8])^2 + 3*x[13]*((2*x[18]*cos(x[7])^2*sin(x[8]))/3 + x[12]*sin(x[7])*(x[17] - g__1)*cos(x[7]) - (4*x[18]*sin(x[8]))/3)*x[12]*cos(x[8]) - 2*sin(x[4])*(((x[17] - g__1)*x[12]^2 + (x[17] - g__1)*x[13]^2 - x[19]/2)*x[12]*cos(x[7])^2 - (x[12]^2*x[18] - x[20]/6)*sin(x[7])*sin(x[8])*cos(x[7]) - (((x[17] - g__1)*x[12]^2 + (x[17] - g__1)*x[13]^2 - x[19]/2)*x[12])/2))*cos(x[6])^2 - 2*(-2*x[12]*x[13]*x[18]*cos(x[8])^2*sin(x[7]) + sin(x[4])*((x[12]^2*x[18] - x[20]/6)*cos(x[7]) + sin(x[7])*((x[17] - g__1)*x[12]^2 + (x[17] - g__1)*x[13]^2 - x[19]/2)*x[12]*sin(x[8]))*cos(x[8]) - 3*(x[12]*sin(x[8])*(x[17] - g__1)*cos(x[7]) - (2*x[18]*sin(x[7]))/3)*x[13]*x[12]/2)*sin(x[6])*cos(x[6]) + cos(x[8])*(sin(x[4])*((x[17] - g__1)*x[12]^2 + (x[17] - g__1)*x[13]^2 - x[19]/2)*cos(x[8]) + 2*x[13]*x[18]*sin(x[8]))*x[12])*L*cos(x[4])^4 + ((15*m__1*sin(x[5])*(cos(x[7])^2 - 2)*(x[12]^2*x[18] - (2*x[20])/15)*L*cos(x[8])^2 - 18*x[12]*((x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*sin(x[8])*cos(x[7])^2 - (2*L*x[13]*x[18]*cos(x[7])*sin(x[4])*sin(x[5])*sin(x[7])*m__1)/3 - 2*(x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*sin(x[8]))*cos(x[8]) - 33*m__1*sin(x[5])*(((7*x[12]^2*x[18])/11 - x[20]/33)*cos(x[7])^2 + ((x[17] - g__1)*x[12]^2 + ((4*x[17])/11 - (4*g__1)/11)*x[13]^2 - (2*x[19])/11)*sin(x[7])*x[12]*sin(x[8])*cos(x[7]) - (5*x[12]^2*x[18])/11 + (2*x[20])/33)*L)*cos(x[6])^2 + 33*(-12*(x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*sin(x[7])*x[12]*cos(x[8])^2/11 + m__1*sin(x[5])*(((x[17] - g__1)*x[12]^2 + ((4*x[17])/11 - (4*g__1)/11)*x[13]^2 - (2*x[19])/11)*x[12]*cos(x[7]) - 10*(x[12]^2*x[18] - (2*x[20])/15)*sin(x[7])*sin(x[8])/11)*L*cos(x[8]) + (6*x[12]*((2*L*x[13]*x[18]*cos(x[7])*sin(x[4])*sin(x[5])*sin(x[8])*m__1)/3 + (x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*sin(x[7])))/11)*sin(x[6])*cos(x[6]) + 15*m__1*sin(x[5])*(x[12]^2*x[18] - (2*x[20])/15)*L*cos(x[8])^2 - 18*(x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*x[12]*sin(x[8])*cos(x[8]) - 3*(x[12]^2*x[18] - x[20]/3)*m__1*sin(x[5])*L)*cos(x[4])^3 + 15*x[12]*((m__1*sin(x[4])*sin(x[5])*(cos(x[7])^2 - 2)*L*((x[17] - g__1)*x[12]^2 + ((4*x[17])/5 - (4*g__1)/5)*x[13]^2 - (2*x[19])/5)*cos(x[8])^2 + ((4*L*x[13]*x[18]*cos(x[7])^2*sin(x[5])*sin(x[8])*m__1)/5 + 2*(x[17] - g__1)*sin(x[7])*(L*x[12]*x[13]*sin(x[5])*m__1 - (2*sin(x[4])*(m__1 + m__p)*(x[17] - g__1))/15)*cos(x[7]) - (8*L*x[13]*x[18]*sin(x[5])*sin(x[8])*m__1)/5)*cos(x[8]) - (9*m__1*sin(x[4])*(((x[17] - g__1)*x[12]^2 + ((2*x[17])/9 - (2*g__1)/9)*x[13]^2 - x[19]/9)*cos(x[7])^2 - (5*x[12]*x[18]*cos(x[7])*sin(x[7])*sin(x[8]))/9 + (-(5*x[17])/9 + (5*g__1)/9)*x[12]^2 + (-(4*x[17])/9 + (4*g__1)/9)*x[13]^2 + (2*x[19])/9)*sin(x[5])*L)/5)*cos(x[6])^2 + ((8*L*x[13]*x[18]*cos(x[8])^2*sin(x[5])*sin(x[6])*sin(x[7])*m__1)/5 - 2*(x[12]*x[18]*cos(x[7])/2 + sin(x[7])*((x[17] - g__1)*x[12]^2 + ((4*x[17])/5 - (4*g__1)/5)*x[13]^2 - (2*x[19])/5)*sin(x[8]))*m__1*sin(x[4])*sin(x[5])*L*sin(x[6])*cos(x[8]) + 2*(x[17] - g__1)*(L*x[12]*x[13]*sin(x[5])*m__1 - (2*sin(x[4])*(m__1 + m__p)*(x[17] - g__1))/15)*sin(x[8])*sin(x[6])*cos(x[7]) - m__1*(x[12]*x[15]*sin(x[8])*(x[17] - g__1)*sin(x[4]) + 12*x[13]*x[18]*sin(x[6])*sin(x[7]))*sin(x[5])*L/15)*cos(x[6]) + m__1*sin(x[5])*(sin(x[4])*((x[17] - g__1)*x[12]^2 + ((4*x[17])/5 - (4*g__1)/5)*x[13]^2 - (2*x[19])/5)*cos(x[8])^2 + (x[12]*x[14]*sin(x[4])*(x[17] - g__1)*cos(x[7])/15 + x[12]*x[15]*sin(x[6])*sin(x[7])*(x[17] - g__1)*sin(x[4])/15 + (4*x[13]*x[18]*sin(x[8]))/5)*cos(x[8]) - sin(x[4])*((x[17] - g__1)*x[12]^2 + (2*x[17] - 2*g__1)*x[13]^2 - x[19])/5)*L)*cos(x[4])^2 + 18*x[12]*((-(2*L*x[12]*x[18]*sin(x[5])*m__1*(cos(x[7])^2 - 2)*cos(x[8])^2)/3 + 4*(x[17] - g__1)*(cos(x[7])^2 - 2)*sin(x[8])*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/6)*cos(x[8])/3 + m__1*sin(x[5])*x[12]*L*(x[18]*cos(x[7])^2/3 + x[12]*sin(x[7])*sin(x[8])*(x[17] - g__1)*cos(x[7]) - (2*x[18])/3))*cos(x[6])^2 - (-8*(x[17] - g__1)*sin(x[7])*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/6)*cos(x[8])^2/3 + m__1*sin(x[5])*(x[12]*cos(x[7])*(x[17] - g__1) - (4*x[18]*sin(x[7])*sin(x[8]))/3)*x[12]*L*cos(x[8]) + 4*(x[17] - g__1)*sin(x[7])*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/6)/3)*sin(x[6])*cos(x[6]) - (2*L*x[12]*x[18]*cos(x[8])^2*sin(x[5])*m__1)/3 + 4*(x[17] - g__1)*sin(x[8])*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/6)*cos(x[8])/3 + L*x[12]*x[18]*sin(x[5])*m__1/3)*cos(x[4]) - 12*(x[17] - g__1)*m__1*sin(x[4])*sin(x[5])*x[12]^3*L*((cos(x[8])^2 - 1/2)*(cos(x[7])^2 - 2)*cos(x[6])^2 - 2*cos(x[6])*sin(x[7])*cos(x[8])*sin(x[6])*sin(x[8]) + cos(x[8])^2 - 1/2))*cos(x[5])^5 + (-18*m__1*x[13]*L*(((cos(x[7])^2 - 2)*((x[17] - g__1)*x[12]^2 + (x[17]/3 - g__1/3)*x[13]^2 - x[19]/6)*cos(x[8])^2 + ((-2*x[17] + 2*g__1)*x[12]^2 + (-(2*x[17])/3 + (2*g__1)/3)*x[13]^2 + x[19]/3)*cos(x[7])^2 + (4*x[12]*x[18]*cos(x[7])*sin(x[7])*sin(x[8]))/3 + (x[17] - g__1)*x[12]^2 + (x[17]/3 - g__1/3)*x[13]^2 - x[19]/6)*cos(x[6])^2 - 2*((2*x[12]*x[18]*cos(x[7]))/3 + sin(x[7])*sin(x[8])*((x[17] - g__1)*x[12]^2 + (x[17]/3 - g__1/3)*x[13]^2 - x[19]/6))*cos(x[8])*sin(x[6])*cos(x[6]) + cos(x[8])^2*((x[17] - g__1)*x[12]^2 + (x[17]/3 - g__1/3)*x[13]^2 - x[19]/6))*cos(x[4])^5 + ((12*L*sin(x[4])*m__1*x[12]*x[13]*x[18]*(cos(x[7])^2 - 2)*cos(x[8])^2 - 12*m__1*L*(((x[17] - g__1)*x[12]^2 + ((9*x[17])/2 - (9*g__1)/2)*x[13]^2 - x[19]/2)*x[12]*sin(x[8])*cos(x[7])^2 - sin(x[7])*(x[12]^2*x[18] + 5/4*x[13]^2*x[18] - 1/6*x[20])*cos(x[7]) - 2*((x[17] - g__1)*x[12]^2 + ((9*x[17])/2 - (9*g__1)/2)*x[13]^2 - x[19]/2)*x[12]*sin(x[8]))*cos(x[8]) - 24*L*x[12]*x[13]*x[18]*cos(x[7])^2*sin(x[4])*m__1 - 36*sin(x[7])*(-x[12]*(x[17] - g__1)^2*(m__1 + m__p)*sin(x[5])/9 + m__1*sin(x[4])*x[13]*L*((x[17] - g__1)*x[12]^2 + (x[17]/3 - g__1/3)*x[13]^2 - x[19]/6))*sin(x[8])*cos(x[7]) + 12*L*sin(x[4])*m__1*x[12]*x[13]*x[18])*cos(x[6])^2 + (-24*m__1*((x[17] - g__1)*x[12]^2 + ((9*x[17])/2 - (9*g__1)/2)*x[13]^2 - x[19]/2)*sin(x[7])*x[12]*L*sin(x[6])*cos(x[8])^2 + (36*(-x[12]*(x[17] - g__1)^2*(m__1 + m__p)*sin(x[5])/9 + m__1*sin(x[4])*x[13]*L*((x[17] - g__1)*x[12]^2 + (x[17]/3 - g__1/3)*x[13]^2 - x[19]/6))*sin(x[6])*cos(x[7]) - 24*m__1*(x[12]*x[18]*sin(x[4])*sin(x[6])*sin(x[7])*sin(x[8]) - x[13]*x[15]*(x[17] - g__1)/24)*x[13]*L)*cos(x[8]) + 12*m__1*(sin(x[8])*(x[12]^2*x[18] + 5/4*x[13]^2*x[18] - 1/6*x[20])*cos(x[7]) + ((x[17] - g__1)*x[12]^2 + ((9*x[17])/2 - (9*g__1)/2)*x[13]^2 - x[19]/2)*sin(x[7])*x[12])*L*sin(x[6]))*cos(x[6]) - 12*m__1*(-x[12]*x[13]*x[18]*cos(x[8])^2*sin(x[4]) + ((x[17] - g__1)*x[12]^2 + ((9*x[17])/2 - (9*g__1)/2)*x[13]^2 - x[19]/2)*x[12]*sin(x[8])*cos(x[8]) - x[13]^2*sin(x[8])*(x[17] - g__1)*(sin(x[6])*sin(x[7])*x[15] + x[14]*cos(x[7]))/12)*L)*cos(x[4])^4 + ((63*(cos(x[7])^2 - 2)*(-(2*x[12]*sin(x[4])*(x[17] - g__1)^2*(m__1 + m__p)*sin(x[5]))/63 + m__1*x[13]*L*((x[17] - g__1)*x[12]^2 + ((2*x[17])/7 - (2*g__1)/7)*x[13]^2 - (2*x[19])/21))*cos(x[8])^2 + 12*m__1*sin(x[4])*(sin(x[8])*(x[12]^2*x[18] + 5/4*x[13]^2*x[18] - 1/6*x[20])*cos(x[7])^2 + ((x[17] - g__1)*x[12]^2 + ((9*x[17])/2 - (9*g__1)/2)*x[13]^2 - x[19]/2)*sin(x[7])*x[12]*cos(x[7]) - 2*sin(x[8])*(x[12]^2*x[18] + 5/4*x[13]^2*x[18] - 1/6*x[20]))*L*cos(x[8]) + (4*x[12]*sin(x[4])*(x[17] - g__1)^2*(m__1 + m__p)*sin(x[5]) - 63*m__1*((x[17] - g__1)*x[12]^2 - x[19]/21)*x[13]*L)*cos(x[7])^2 + 24*L*x[12]*x[13]*x[18]*cos(x[7])*sin(x[7])*sin(x[8])*m__1 - 2*x[12]*sin(x[4])*(x[17] - g__1)^2*(m__1 + m__p)*sin(x[5]) + 63*m__1*x[13]*L*((x[17] - g__1)*x[12]^2 + ((2*x[17])/7 - (2*g__1)/7)*x[13]^2 - (2*x[19])/21))*cos(x[6])^2 + 12*(2*m__1*sin(x[4])*sin(x[7])*L*(x[12]^2*x[18] + 5/4*x[13]^2*x[18] - 1/6*x[20])*cos(x[8])^2 + (-2*L*x[12]*x[13]*x[18]*cos(x[7])*m__1 - (21*sin(x[7])*(-(2*x[12]*sin(x[4])*(x[17] - g__1)^2*(m__1 + m__p)*sin(x[5]))/63 + m__1*x[13]*L*((x[17] - g__1)*x[12]^2 + ((2*x[17])/7 - (2*g__1)/7)*x[13]^2 - (2*x[19])/21))*sin(x[8]))/2)*cos(x[8]) + m__1*sin(x[4])*(((x[17] - g__1)*x[12]^2 + ((9*x[17])/2 - (9*g__1)/2)*x[13]^2 - x[19]/2)*x[12]*sin(x[8])*cos(x[7]) - sin(x[7])*(x[12]^2*x[18] + 5/4*x[13]^2*x[18] - 1/6*x[20]))*L)*sin(x[6])*cos(x[6]) + (-2*x[12]*sin(x[4])*(x[17] - g__1)^2*(m__1 + m__p)*sin(x[5]) + 63*m__1*x[13]*L*((x[17] - g__1)*x[12]^2 + ((2*x[17])/7 - (2*g__1)/7)*x[13]^2 - (2*x[19])/21))*cos(x[8])^2 + 12*m__1*sin(x[4])*L*(x[12]^2*x[18] + 5/4*x[13]^2*x[18] - 1/6*x[20])*sin(x[8])*cos(x[8]) - 27*m__1*x[13]*(-x[13]*x[15]*sin(x[4])*sin(x[6])*(x[17] - g__1)*cos(x[7])/27 + x[13]*x[14]*sin(x[7])*(x[17] - g__1)*sin(x[4])/27 + (x[17] - g__1)*x[12]^2 + ((4*x[17])/9 - (4*g__1)/9)*x[13]^2 - x[19]/9)*L)*cos(x[4])^3 + ((-30*L*sin(x[4])*m__1*x[12]*x[13]*x[18]*(cos(x[7])^2 - 2)*cos(x[8])^2 + 24*m__1*(((x[17] - g__1)*x[12]^2 + ((17*x[17])/8 - (17*g__1)/8)*x[13]^2 - x[19]/4)*x[12]*sin(x[8])*cos(x[7])^2 - (5*sin(x[7])*x[18]*(x[12]^2 - x[13]^2/5)*cos(x[7]))/8 - 2*((x[17] - g__1)*x[12]^2 + ((17*x[17])/8 - (17*g__1)/8)*x[13]^2 - x[19]/4)*x[12]*sin(x[8]))*L*cos(x[8]) + 12*L*x[12]*x[13]*x[18]*cos(x[7])^2*sin(x[4])*m__1 + 45*(x[17] - g__1)*sin(x[7])*(-(4*x[12]*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/45 + L*x[13]*sin(x[4])*m__1*(x[12]^2 - (2*x[13]^2)/15))*sin(x[8])*cos(x[7]) - 30*L*sin(x[4])*m__1*x[12]*x[13]*x[18])*cos(x[6])^2 + (48*m__1*sin(x[7])*((x[17] - g__1)*x[12]^2 + ((17*x[17])/8 - (17*g__1)/8)*x[13]^2 - x[19]/4)*x[12]*L*sin(x[6])*cos(x[8])^2 + (-45*(x[17] - g__1)*(-(4*x[12]*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/45 + L*x[13]*sin(x[4])*m__1*(x[12]^2 - (2*x[13]^2)/15))*sin(x[6])*cos(x[7]) + m__1*(60*x[12]*x[13]*x[18]*sin(x[4])*sin(x[6])*sin(x[7])*sin(x[8]) + x[15]*(x[12] - x[13])*(x[12] + x[13])*(x[17] - g__1))*L)*cos(x[8]) - 24*m__1*((5*x[18]*sin(x[8])*(x[12]^2 - x[13]^2/5)*cos(x[7]))/8 + sin(x[7])*((x[17] - g__1)*x[12]^2 + ((17*x[17])/8 - (17*g__1)/8)*x[13]^2 - x[19]/4)*x[12])*L*sin(x[6]))*cos(x[6]) + 24*m__1*(-(5*x[12]*x[13]*x[18]*cos(x[8])^2*sin(x[4]))/4 + ((x[17] - g__1)*x[12]^2 + ((17*x[17])/8 - (17*g__1)/8)*x[13]^2 - x[19]/4)*x[12]*sin(x[8])*cos(x[8]) + x[14]*sin(x[8])*(x[12] - x[13])*(x[12] + x[13])*(x[17] - g__1)*cos(x[7])/24 + (3*x[12]*x[13]*x[18]*sin(x[4]))/4 + x[15]*sin(x[6])*sin(x[7])*sin(x[8])*(x[12] - x[13])*(x[12] + x[13])*(x[17] - g__1)/24)*L)*cos(x[4])^2 - 18*x[12]*((8*(x[17] - g__1)*(cos(x[7])^2 - 2)*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/12 + L*x[12]*x[13]*m__1)*cos(x[8])^2/3 + m__1*sin(x[4])*((2*x[12]*x[18]*cos(x[7])^2*sin(x[8]))/3 + (x[17] - g__1)*(x[12]^2 - x[13]^2/3)*sin(x[7])*cos(x[7]) - (4*x[12]*x[18]*sin(x[8]))/3)*L*cos(x[8]) - (x[17] - g__1)*((-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/9 + L*x[12]*x[13]*m__1)*cos(x[7])^2 + (2*sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/9 - (8*L*x[12]*x[13]*m__1)/3))*cos(x[6])^2 + ((4*L*x[12]*x[18]*cos(x[8])^2*sin(x[4])*sin(x[7])*m__1)/3 - 16*(x[17] - g__1)*sin(x[7])*sin(x[8])*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/12 + L*x[12]*x[13]*m__1)*cos(x[8])/3 + m__1*sin(x[4])*((x[17] - g__1)*(x[12]^2 - x[13]^2/3)*sin(x[8])*cos(x[7]) - (2*x[12]*x[18]*sin(x[7]))/3)*L)*sin(x[6])*cos(x[6]) + 8*(x[17] - g__1)*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/12 + L*x[12]*x[13]*m__1)*cos(x[8])^2/3 + (2*L*x[12]*x[18]*cos(x[8])*sin(x[4])*sin(x[8])*m__1)/3 - 5*(x[17] - g__1)*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/15 + L*x[12]*x[13]*m__1)/3)*cos(x[4]) - 12*(x[17] - g__1)*m__1*(cos(x[8])*sin(x[8])*(cos(x[7])^2 - 2)*cos(x[6])^2 + 2*(cos(x[8])^2 - 1/2)*sin(x[7])*sin(x[6])*cos(x[6]) + cos(x[8])*sin(x[8]))*x[12]^3*L)*cos(x[5])^4 + (-36*m__1*sin(x[5])*x[13]^2*((-x[18]*(cos(x[7])^2 - 2)*cos(x[8])^2/6 + x[18]*cos(x[7])^2/3 + x[12]*sin(x[7])*sin(x[8])*(x[17] - g__1)*cos(x[7]) - x[18]/6)*cos(x[6])^2 - cos(x[8])*(x[12]*cos(x[7])*(x[17] - g__1) - x[18]*sin(x[7])*sin(x[8])/3)*sin(x[6])*cos(x[6]) - x[18]*cos(x[8])^2/6)*L*cos(x[4])^5 + 36*((((x[17] - g__1)*(cos(x[7])^2 - 2)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/9)*cos(x[8])^2)/2 + m__1*sin(x[5])*((2*x[12]*x[18]*cos(x[7])^2*sin(x[8]))/3 + sin(x[7])*((x[17] - g__1)*x[12]^2 + (x[17]/2 - g__1/2)*x[13]^2 - x[19]/6)*cos(x[7]) - (4*x[12]*x[18]*sin(x[8]))/3)*L*cos(x[8]) - (x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/9)*cos(x[7])^2 + L*x[13]*x[18]*cos(x[7])*sin(x[4])*sin(x[5])*sin(x[7])*sin(x[8])*m__1/3 + ((x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/9))/2)*cos(x[6])^2 + ((4*L*x[12]*x[18]*cos(x[8])^2*sin(x[5])*sin(x[7])*m__1)/3 + (-L*x[13]*x[18]*cos(x[7])*sin(x[4])*sin(x[5])*m__1/3 - (x[17] - g__1)*sin(x[7])*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/9)*sin(x[8]))*cos(x[8]) + m__1*sin(x[5])*L*(sin(x[8])*((x[17] - g__1)*x[12]^2 + (x[17]/2 - g__1/2)*x[13]^2 - x[19]/6)*cos(x[7]) - (2*x[12]*x[18]*sin(x[7]))/3))*sin(x[6])*cos(x[6]) + cos(x[8])*((x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/9)*cos(x[8]) + (4*L*x[12]*x[18]*sin(x[5])*sin(x[8])*m__1)/3)/2)*x[13]*cos(x[4])^4 + ((-6*m__1*sin(x[5])*(cos(x[7])^2 - 2)*L*(x[12]^2*x[18] + 5/2*x[13]^2*x[18] - 1/6*x[20])*cos(x[8])^2 + (36*(m__1*sin(x[4])*x[13]*L*((x[17] - g__1)*x[12]^2 + (x[17]/2 - g__1/2)*x[13]^2 - x[19]/6)*sin(x[5]) - (11*x[12]*(x[17] - g__1)^2*(m__1 + m__p))/36)*sin(x[8])*cos(x[7])^2 - 24*sin(x[7])*x[18]*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/6)*cos(x[7]) - 72*(m__1*sin(x[4])*x[13]*L*((x[17] - g__1)*x[12]^2 + (x[17]/2 - g__1/2)*x[13]^2 - x[19]/6)*sin(x[5]) - (11*x[12]*(x[17] - g__1)^2*(m__1 + m__p))/36)*sin(x[8]))*cos(x[8]) + 3*L*x[13]^2*x[18]*cos(x[7])^2*sin(x[5])*m__1 + 27*(x[17] - g__1)*x[13]*sin(x[7])*(L*x[12]*x[13]*sin(x[5])*m__1 - (4*sin(x[4])*(m__1 + m__p)*(x[17] - g__1))/27)*sin(x[8])*cos(x[7]) - 6*m__1*sin(x[5])*L*(x[12]^2*x[18] + 5/2*x[13]^2*x[18] - 1/6*x[20]))*cos(x[6])^2 + (72*(m__1*sin(x[4])*x[13]*L*((x[17] - g__1)*x[12]^2 + (x[17]/2 - g__1/2)*x[13]^2 - x[19]/6)*sin(x[5]) - (11*x[12]*(x[17] - g__1)^2*(m__1 + m__p))/36)*sin(x[7])*sin(x[6])*cos(x[8])^2 + (-27*(x[17] - g__1)*x[13]*(L*x[12]*x[13]*sin(x[5])*m__1 - (4*sin(x[4])*(m__1 + m__p)*(x[17] - g__1))/27)*sin(x[6])*cos(x[7]) + 12*m__1*sin(x[7])*L*(x[12]^2*x[18] + 5/2*x[13]^2*x[18] - 1/6*x[20])*sin(x[8])*sin(x[6])*sin(x[5]) + x[15]*(x[17] - g__1)^2*(m__1 + m__p))*cos(x[8]) - 36*((2*x[18]*sin(x[8])*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/6)*cos(x[7]))/3 + (m__1*sin(x[4])*x[13]*L*((x[17] - g__1)*x[12]^2 + (x[17]/2 - g__1/2)*x[13]^2 - x[19]/6)*sin(x[5]) - (11*x[12]*(x[17] - g__1)^2*(m__1 + m__p))/36)*sin(x[7]))*sin(x[6]))*cos(x[6]) - 6*m__1*sin(x[5])*L*(x[12]^2*x[18] + 5/2*x[13]^2*x[18] - 1/6*x[20])*cos(x[8])^2 + 36*(m__1*sin(x[4])*x[13]*L*((x[17] - g__1)*x[12]^2 + (x[17]/2 - g__1/2)*x[13]^2 - x[19]/6)*sin(x[5]) - (11*x[12]*(x[17] - g__1)^2*(m__1 + m__p))/36)*sin(x[8])*cos(x[8]) + x[14]*sin(x[8])*(x[17] - g__1)^2*(m__1 + m__p)*cos(x[7]) + 6*m__1*(x[12]^2*x[18] + 3/2*x[13]^2*x[18] - 1/6*x[20])*L*sin(x[5]) + x[15]*sin(x[6])*sin(x[7])*sin(x[8])*(x[17] - g__1)^2*(m__1 + m__p))*cos(x[4])^3 + ((-6*(cos(x[7])^2 - 2)*(m__1*sin(x[4])*x[12]*((x[17] - g__1)*x[12]^2 + ((15*x[17])/2 - (15*g__1)/2)*x[13]^2 - x[19]/2)*L*sin(x[5]) - (11*x[13]*(x[17] - g__1)^2*(m__1 + m__p))/6)*cos(x[8])^2 + (-24*(L*x[12]*x[13]*sin(x[5])*m__1 - sin(x[4])*(m__1 + m__p)*(x[17] - g__1)/6)*x[18]*sin(x[8])*cos(x[7])^2 - 42*(x[17] - g__1)*(L*x[13]*m__1*(x[12]^2 - x[13]^2/7)*sin(x[5]) - (11*x[12]*sin(x[4])*(m__1 + m__p)*(x[17] - g__1))/42)*sin(x[7])*cos(x[7]) + 48*(L*x[12]*x[13]*sin(x[5])*m__1 - sin(x[4])*(m__1 + m__p)*(x[17] - g__1)/6)*x[18]*sin(x[8]))*cos(x[8]) + 9*(x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 + 5*(m__1 + m__p)*(x[17] - g__1)/9)*x[13]*cos(x[7])^2 + 3*L*x[13]^2*x[18]*cos(x[7])*sin(x[4])*sin(x[5])*sin(x[7])*sin(x[8])*m__1 - 6*m__1*sin(x[4])*x[12]*((x[17] - g__1)*x[12]^2 + ((15*x[17])/2 - (15*g__1)/2)*x[13]^2 - x[19]/2)*L*sin(x[5]) + 11*x[13]*(x[17] - g__1)^2*(m__1 + m__p))*cos(x[6])^2 + (-48*(L*x[12]*x[13]*sin(x[5])*m__1 - sin(x[4])*(m__1 + m__p)*(x[17] - g__1)/6)*sin(x[7])*x[18]*sin(x[6])*cos(x[8])^2 + 12*(-L*x[13]^2*x[18]*cos(x[7])*sin(x[4])*sin(x[5])*m__1/4 + sin(x[7])*(m__1*sin(x[4])*x[12]*((x[17] - g__1)*x[12]^2 + ((15*x[17])/2 - (15*g__1)/2)*x[13]^2 - x[19]/2)*L*sin(x[5]) - (11*x[13]*(x[17] - g__1)^2*(m__1 + m__p))/6)*sin(x[8]))*sin(x[6])*cos(x[8]) - 42*(x[17] - g__1)*(L*x[13]*m__1*(x[12]^2 - x[13]^2/7)*sin(x[5]) - (11*x[12]*sin(x[4])*(m__1 + m__p)*(x[17] - g__1))/42)*sin(x[8])*sin(x[6])*cos(x[7]) + 24*m__1*(-x[13]*x[15]*sin(x[8])*(x[17] - g__1)*sin(x[4])/24 + x[12]*x[18]*sin(x[6])*sin(x[7]))*x[13]*L*sin(x[5]) - 4*x[18]*sin(x[4])*sin(x[6])*sin(x[7])*(m__1 + m__p)*(x[17] - g__1))*cos(x[6]) + (-6*m__1*sin(x[4])*x[12]*((x[17] - g__1)*x[12]^2 + ((15*x[17])/2 - (15*g__1)/2)*x[13]^2 - x[19]/2)*L*sin(x[5]) + 11*x[13]*(x[17] - g__1)^2*(m__1 + m__p))*cos(x[8])^2 + (L*x[13]^2*x[14]*sin(x[4])*sin(x[5])*m__1*(x[17] - g__1)*cos(x[7]) - 24*m__1*(-x[13]*x[15]*sin(x[6])*sin(x[7])*(x[17] - g__1)*sin(x[4])/24 + x[12]*x[18]*sin(x[8]))*x[13]*L*sin(x[5]) + 4*x[18]*sin(x[4])*sin(x[8])*(m__1 + m__p)*(x[17] - g__1))*cos(x[8]) + x[15]*sin(x[4])*sin(x[6])*(x[17] - g__1)^2*(m__1 + m__p)*cos(x[7]) + 6*m__1*sin(x[4])*((x[17] - g__1)*x[12]^2 + ((9*x[17])/2 - (9*g__1)/2)*x[13]^2 - x[19]/2)*x[12]*L*sin(x[5]) - 9*(x[17] - g__1)^2*(x[14]*sin(x[4])*sin(x[7])/9 + x[13])*(m__1 + m__p))*cos(x[4])^2 + ((6*L*sin(x[5])*m__1*x[12]^2*x[18]*(cos(x[7])^2 - 2)*cos(x[8])^2 - 36*(x[17] - g__1)*((L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*x[12]*sin(x[8])*cos(x[7])^2 - x[18]*sin(x[7])*(m__1 + m__p)*cos(x[7])/9 - 2*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*x[12]*sin(x[8]))*cos(x[8]) + 6*(x[17] - g__1)*x[13]*sin(x[7])*(L*x[12]*x[13]*sin(x[5])*m__1 - (7*sin(x[4])*(m__1 + m__p)*(x[17] - g__1))/6)*sin(x[8])*cos(x[7]) + 6*L*sin(x[5])*m__1*x[12]^2*x[18])*cos(x[6])^2 + (-72*(x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*sin(x[7])*x[12]*sin(x[6])*cos(x[8])^2 + (-6*(x[17] - g__1)*x[13]*(L*x[12]*x[13]*sin(x[5])*m__1 - (7*sin(x[4])*(m__1 + m__p)*(x[17] - g__1))/6)*sin(x[6])*cos(x[7]) - 12*L*x[12]^2*x[18]*sin(x[5])*sin(x[6])*sin(x[7])*sin(x[8])*m__1 - x[15]*(x[17] - g__1)^2*(m__1 + m__p))*cos(x[8]) + 36*(x[17] - g__1)*(x[18]*sin(x[8])*(m__1 + m__p)*cos(x[7])/9 + (L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*sin(x[7])*x[12])*sin(x[6]))*cos(x[6]) + 6*L*sin(x[5])*cos(x[8])^2*m__1*x[12]^2*x[18] - 36*(x[17] - g__1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - 2*(m__1 + m__p)*(x[17] - g__1)/9)*x[12]*sin(x[8])*cos(x[8]) - x[14]*sin(x[8])*(x[17] - g__1)^2*(m__1 + m__p)*cos(x[7]) - 6*L*sin(x[5])*m__1*x[12]^2*x[18] - x[15]*sin(x[6])*sin(x[7])*sin(x[8])*(x[17] - g__1)^2*(m__1 + m__p))*cos(x[4]) + 6*(x[17] - g__1)*sin(x[4])*x[12]*((L*x[12]^2*sin(x[5])*m__1*(cos(x[7])^2 - 2)*cos(x[8])^2 + (7*cos(x[7])*sin(x[7])*(m__1 + m__p)*(x[17] - g__1)*cos(x[8]))/6 + L*x[12]^2*sin(x[5])*m__1)*cos(x[6])^2 - 2*(L*x[12]^2*cos(x[8])*sin(x[5])*sin(x[7])*m__1 - (7*cos(x[7])*(m__1 + m__p)*(x[17] - g__1))/12)*sin(x[8])*sin(x[6])*cos(x[6]) + L*x[12]^2*sin(x[5])*m__1*(cos(x[8]) - 1)*(cos(x[8]) + 1)))*cos(x[5])^3 + (6*(((cos(x[7])^2 - 2)*cos(x[8])^2 - 2*cos(x[7])^2 + 1)*cos(x[6])^2 - 2*cos(x[6])*sin(x[7])*cos(x[8])*sin(x[6])*sin(x[8]) + cos(x[8])^2)*(x[17] - g__1)*m__1*x[13]^3*L*cos(x[4])^5 + 36*m__1*x[13]^2*(((x[12]*sin(x[8])*(x[17] - g__1)*cos(x[7])^2 - x[18]*cos(x[7])*sin(x[7])/3 - 2*x[12]*sin(x[8])*(x[17] - g__1))*cos(x[8]) + x[13]*cos(x[7])*sin(x[4])*sin(x[7])*sin(x[8])*(x[17] - g__1)/3)*cos(x[6])^2 + 2*(x[12]*sin(x[7])*(x[17] - g__1)*cos(x[8])^2 - x[13]*sin(x[4])*cos(x[7])*(x[17] - g__1)*cos(x[8])/6 - x[18]*cos(x[7])*sin(x[8])/6 - x[12]*sin(x[7])*(x[17] - g__1)/2)*sin(x[6])*cos(x[6]) + x[12]*cos(x[8])*sin(x[8])*(x[17] - g__1))*L*cos(x[4])^4 - 18*x[13]*((m__1*((x[17] - g__1)*x[12]^2 + ((7*x[17])/6 - (7*g__1)/6)*x[13]^2 - x[19]/6)*(cos(x[7])^2 - 2)*L*cos(x[8])^2 + ((2*L*x[13]*x[18]*cos(x[7])^2*sin(x[4])*sin(x[8])*m__1)/3 + 2*(x[17] - g__1)*(-11*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/36 + L*x[12]*x[13]*sin(x[4])*m__1)*sin(x[7])*cos(x[7]) - (4*L*x[13]*x[18]*sin(x[4])*sin(x[8])*m__1)/3)*cos(x[8]) + m__1*(((x[17] - g__1)*x[13]^2*cos(x[7])^2)/6 + (x[17] - g__1)*x[12]^2 + ((7*x[17])/6 - (7*g__1)/6)*x[13]^2 - x[19]/6)*L)*cos(x[6])^2 - 2*(-(2*L*x[13]*x[18]*cos(x[8])^2*sin(x[4])*sin(x[7])*m__1)/3 + m__1*((x[17] - g__1)*x[12]^2 + ((7*x[17])/6 - (7*g__1)/6)*x[13]^2 - x[19]/6)*sin(x[7])*L*sin(x[8])*cos(x[8]) - (x[17] - g__1)*(-11*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/36 + L*x[12]*x[13]*sin(x[4])*m__1)*sin(x[8])*cos(x[7]) + L*x[13]*x[18]*sin(x[4])*sin(x[7])*m__1/3)*sin(x[6])*cos(x[6]) + (((x[17] - g__1)*x[12]^2 + ((7*x[17])/6 - (7*g__1)/6)*x[13]^2 - x[19]/6)*cos(x[8])^2 + (2*x[13]*x[18]*cos(x[8])*sin(x[4])*sin(x[8]))/3 + (g__1 - x[17])*x[12]^2 + (-(5*x[17])/6 + (5*g__1)/6)*x[13]^2 + x[19]/6)*m__1*L)*cos(x[4])^3 + ((12*(-((m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/3 + L*x[12]*x[13]*sin(x[4])*m__1)*(cos(x[7])^2 - 2)*x[18]*cos(x[8])^2 - 36*x[13]*((x[17] - g__1)*sin(x[8])*(-(11*sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/36 + L*x[12]*x[13]*m__1)*cos(x[7])^2 + L*x[13]*x[18]*cos(x[7])*sin(x[7])*m__1/12 - 2*(x[17] - g__1)*sin(x[8])*(-(11*sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/36 + L*x[12]*x[13]*m__1))*cos(x[8]) - 4*x[18]*sin(x[5])*(m__1 + m__p)*(x[17] - g__1)*cos(x[7])^2 + 9*(x[17] - g__1)*(-(10*x[12]*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/9 + L*x[13]^3*sin(x[4])*m__1)*sin(x[7])*sin(x[8])*cos(x[7]) + 12*(-((m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/3 + L*x[12]*x[13]*sin(x[4])*m__1)*x[18])*cos(x[6])^2 + (-72*(x[17] - g__1)*x[13]*sin(x[7])*(-(11*sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/36 + L*x[12]*x[13]*m__1)*sin(x[6])*cos(x[8])^2 + (-9*(x[17] - g__1)*(-(10*x[12]*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/9 + L*x[13]^3*sin(x[4])*m__1)*sin(x[6])*cos(x[7]) + 8*x[18]*sin(x[6])*sin(x[7])*sin(x[8])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]) - 24*m__1*(x[12]*x[18]*sin(x[4])*sin(x[6])*sin(x[7])*sin(x[8]) - x[13]*x[15]*(x[17] - g__1)/24)*x[13]*L)*cos(x[8]) + 36*(-L*x[13]*x[18]*cos(x[7])*sin(x[8])*m__1/12 + (x[17] - g__1)*sin(x[7])*(-(11*sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/36 + L*x[12]*x[13]*m__1))*x[13]*sin(x[6]))*cos(x[6]) + 12*(-((m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/3 + L*x[12]*x[13]*sin(x[4])*m__1)*x[18]*cos(x[8])^2 - 36*(x[17] - g__1)*x[13]*sin(x[8])*(-(11*sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5]))/36 + L*x[12]*x[13]*m__1)*cos(x[8]) + L*x[13]^2*x[14]*sin(x[8])*m__1*(x[17] - g__1)*cos(x[7]) + 4*x[18]*sin(x[5])*(m__1 + m__p)*(x[17] - g__1) - 12*m__1*x[13]*L*(x[12]*x[18]*sin(x[4]) - x[13]*x[15]*sin(x[6])*sin(x[7])*sin(x[8])*(x[17] - g__1)/12))*cos(x[4])^2 + 18*(x[17] - g__1)*(((cos(x[7])^2 - 2)*x[12]*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/3 + L*x[12]*x[13]*m__1)*cos(x[8])^2 - ((-7*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/6 + L*x[12]*x[13]*sin(x[4])*m__1)*x[13]*sin(x[7])*cos(x[7])*cos(x[8]))/3 - (5*x[12]*sin(x[4])*sin(x[5])*(m__1 + m__p)*(x[17] - g__1)*cos(x[7])^2)/9 + (2*x[18]*sin(x[4])*sin(x[5])*sin(x[7])*sin(x[8])*(m__1 + m__p)*cos(x[7]))/9 + x[12]*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/3 + L*x[12]*x[13]*m__1))*cos(x[6])^2 + (-2*(x[18]*sin(x[4])*sin(x[5])*(m__1 + m__p)*cos(x[7])/9 + sin(x[7])*x[12]*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/3 + L*x[12]*x[13]*m__1)*sin(x[8]))*sin(x[6])*cos(x[8]) - (((-7*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/6 + L*x[12]*x[13]*sin(x[4])*m__1)*x[13]*sin(x[6])*cos(x[7]) + x[15]*sin(x[4])*sin(x[5])*(m__1 + m__p)*(x[17] - g__1)/6)*sin(x[8]))/3)*cos(x[6]) + x[12]*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/3 + L*x[12]*x[13]*m__1)*cos(x[8])^2 + sin(x[4])*sin(x[5])*(m__1 + m__p)*(x[17] - g__1)*(sin(x[6])*sin(x[7])*x[15] + x[14]*cos(x[7]))*cos(x[8])/18 - x[12]*(-sin(x[4])*(m__1 + m__p)*(x[17] - g__1)*sin(x[5])/3 + L*x[12]*x[13]*m__1))*cos(x[4]) + 7*x[12]*cos(x[6])*cos(x[7])*sin(x[5])*(x[17] - g__1)^2*(m__1 + m__p)*(cos(x[6])*sin(x[7])*sin(x[8]) - sin(x[6])*cos(x[8])))*cos(x[5])^2 + (-12*L*x[13]^3*cos(x[6])*cos(x[7])*sin(x[5])*m__1*(cos(x[6])*sin(x[7])*cos(x[8]) + sin(x[6])*sin(x[8]))*(x[17] - g__1)*cos(x[4])^4 - 12*m__1*sin(x[5])*x[13]^2*(((-x[18]*cos(x[7])^2/2 + x[18])*cos(x[8])^2 + x[13]*sin(x[4])*sin(x[8])*(cos(x[7])^2 - 2)*(x[17] - g__1)*cos(x[8]) - x[18]/2)*cos(x[6])^2 + 2*(x[13]*sin(x[4])*(x[17] - g__1)*cos(x[8])^2 + x[18]*cos(x[8])*sin(x[8])/2 - x[13]*sin(x[4])*(x[17] - g__1)/2)*sin(x[7])*sin(x[6])*cos(x[6]) - x[18]*cos(x[8])^2/2 + x[13]*sin(x[4])*sin(x[8])*(x[17] - g__1)*cos(x[8]) + x[18]/2)*L*cos(x[4])^3 + 18*(x[17] - g__1)*x[13]*(((L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/3)*(cos(x[7])^2 - 2)*cos(x[8])^2 - L*x[13]^2*cos(x[7])*cos(x[8])*sin(x[5])*sin(x[7])*m__1/3 - 5*(m__1 + m__p)*(x[17] - g__1)*cos(x[7])^2/9 + L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/3)*cos(x[6])^2 - 2*sin(x[8])*((L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/3)*sin(x[7])*cos(x[8]) + L*x[13]^2*cos(x[7])*sin(x[5])*m__1/6)*sin(x[6])*cos(x[6]) + (cos(x[8]) + 1)*(L*x[12]*x[13]*sin(x[4])*sin(x[5])*m__1 - ((m__1 + m__p)*(x[17] - g__1))/3)*(cos(x[8]) - 1))*cos(x[4])^2 + 10*(x[17] - g__1)*(sin(x[7])*cos(x[7])*(-(2*x[18]*cos(x[8]))/5 + x[13]*sin(x[4])*sin(x[8])*(x[17] - g__1))*cos(x[6])^2 + (-(x[17] - g__1)*(x[13]*cos(x[7])*sin(x[4])*sin(x[6]) - x[15]/10)*cos(x[8]) - (2*x[18]*cos(x[7])*sin(x[6])*sin(x[8]))/5)*cos(x[6]) + sin(x[8])*(x[17] - g__1)*(sin(x[6])*sin(x[7])*x[15] + x[14]*cos(x[7]))/10)*(m__1 + m__p)*cos(x[4]) - 7*x[12]*cos(x[6])*cos(x[7])*sin(x[4])*(x[17] - g__1)^2*(m__1 + m__p)*(cos(x[6])*sin(x[7])*cos(x[8]) + sin(x[6])*sin(x[8])))*cos(x[5]) + 6*(x[17] - g__1)*cos(x[4])*x[13]*(((1 + (cos(x[7])^2 - 2)*cos(x[8])^2)*cos(x[6])^2 - 2*cos(x[6])*sin(x[7])*cos(x[8])*sin(x[6])*sin(x[8]) + cos(x[8])^2 - 1)*m__1*x[13]^2*L*cos(x[4])^2 - (7*cos(x[6])*cos(x[7])*sin(x[5])*(m__1 + m__p)*(cos(x[6])*sin(x[7])*cos(x[8]) + sin(x[6])*sin(x[8]))*(x[17] - g__1))/6))/(cos(x[4])^4*m__1*(((((cos(x[7])^2 - 2)*cos(x[8])^2 - 2*cos(x[7])^2 + 1)*cos(x[6])^2 - 2*cos(x[6])*sin(x[7])*cos(x[8])*sin(x[6])*sin(x[8]) + cos(x[8])^2)*cos(x[4])^2 + 2*cos(x[6])*cos(x[7])*sin(x[4])*(cos(x[6])*sin(x[7])*sin(x[8]) - sin(x[6])*cos(x[8]))*cos(x[4]) - 2*(cos(x[8])^2 - 1/2)*(cos(x[7])^2 - 2)*cos(x[6])^2 + 4*cos(x[6])*sin(x[7])*cos(x[8])*sin(x[6])*sin(x[8]) - 2*cos(x[8])^2 + 1)*cos(x[5])^2 - 2*sin(x[5])*(cos(x[6])*cos(x[7])*(cos(x[6])*sin(x[7])*cos(x[8]) + sin(x[6])*sin(x[8]))*cos(x[4]) + sin(x[4])*(cos(x[8])*sin(x[8])*(cos(x[7])^2 - 2)*cos(x[6])^2 + 2*(cos(x[8])^2 - 1/2)*sin(x[7])*sin(x[6])*cos(x[6]) + cos(x[8])*sin(x[8])))*cos(x[5]) + (1 + (cos(x[7])^2 - 2)*cos(x[8])^2)*cos(x[6])^2 - 2*cos(x[6])*sin(x[7])*cos(x[8])*sin(x[6])*sin(x[8]) + cos(x[8])^2 - 1)*L*cos(x[5])^4)

Here is an example where (f@g)(..) cannot be written f(g(..)): When is @ necessary?

restart:
with(Statistics):
interface(displayprecision=4):
S := Sample(Uniform(-1, 1), 10):
((max-min)/Mean)(S);  # correctly evaluated

abs(Mean(S)); # correctly evaluated

((max-min)/abs(Mean))(S);  # unevaluated value: abs(Mean) appears as  |Statistics:-Mean| 

((max-min)/(abs@Mean))(S);  # correctly evaluated

 

Hello,

I have defined a piecewise function, and then i derive that function and take the arctan of it. However for x=5, which is the maximum x value for the piecewise function, it shows "Float(undefined)".I have attached images at the bottom. I havent been able to figure out why this happens and i would appreciate any help. Also, does somebody know why the following error appears when i try to upload the .mw file? 

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/crimp_versuch_tagentenstetig.mw .

Download crimp_versuch_tagentenstetig.mw

 

Why does  1e-(Digits) return 1. and 1e-Digits generate an error?
 

1e-Digits;
Error, missing operator or `;`

1e(-Digits); 
                               1. 
type(Digits, posint)
                              true

 

Hi

A function ta(x) is defined

Testing it indicates  that everything seems ok.

ta(2010);                 0.2212273448

ta(2050);               4.440420849

But printing goes totally wrong :

plot(ta(x), x = 2000 .. 2030);

The code consists of 13 constants and 4 equations.

Am I overlooking something?  Any idea?

 

na := 8.069439677916595*10^5;
nb := -1.777065899098942*10^3;
nc := 1.467451715287991;
nd := -5.383733471268420*10^(-4);
ne := 7.404613067985871*10^(-8);
am := 0.77317633747818500000;
bm := -0.00626025741156560000;
cm := 0.00002185947833342660;
ap := 471.909671218139000000000000;
bp := -7.368938071612570000000000;
cp := 0.041111235018593800000000;
dp := -0.000098963929768727000000;
ep := 0.88147417256725300*10^(-7);

c_y := y -> na + nb*y + nc*y^2 + nd*y^3 + ne*y^4;
to_c := ppm -> ap + bp*ppm + cp*ppm^2 + dp*ppm^3 + ep*ppm^4;
to_y := y -> tpn(c_y(y));
ta := x -> 0.0014*int(to_y(y), y = 2000 .. x);

 

 

Ok, I think I am starting to get the hang of this. So in Maple, structured types is like a pattern in Mathematica. To find some subexpression one needs to first define a structured type which match that subexpression, and then use  select(type,.....).  

This works well so far (but it is not as easy as setting up a pattern).

But one small problem is that select() starts looking at the operands of the expression to look for a match.

So if the whole expression itself matches the structured type, it will not detect the whole expression, since select goes over each operand, missing that the whole thing actually matches the type.

May be an example helps shows what I mean. I want to find if an expression has cos(anything)*sin(anything) so I made a structured type for this 

mytype_3 :=  ''`*`'( {'specfunc'(cos),'specfunc'(sin)})';

btw, I do not know if I should use `&*` or '`*`' but that is a side point, I'll try to find this out.   

Now I want to use the above to check if expression has the same "structured type", or "pattern". The expression is expr:=cos(x)*sin(x); clearly it matches it. But since select looks at the operands, it will only see cos(x) by itself, and then sin(x) by itself and hence not find the structured type. 

restart;
mytype_3 :=  ''`*`'( {'specfunc'(cos),'specfunc'(sin)})';
expr:=cos(x)*sin(x);
type(expr,mytype_3);  # true
select(type, expr, mytype_3); # does not work, does not find it.

Since I am doing this in code, and I do not know what the expression is, I think I have to now do the following 

restart;
mytype_3 :=  ''`*`'( {'specfunc'(cos),'specfunc'(sin)})';
expr:=cos(x)*sin(x);
if type(expr,mytype_3) then
   print("The whole expression is a match! nothing to do. no need to use select");
else
   select(type, expr, mytype_3);
fi;

Which is OK. I can do this, But it will be nice if there was a way to have select (or another function like it) starts at the top level before looking at the operands?  

How do others handle such cases? does the above sound like an OK solution to this?


 

Hi 

I am a research scholar in mathematics

I am currently working on fluid mechanics

I wish to obtain the solution given in the research article

I am uploading the pdf containing problem.

In the paper they mentioned that " Shooting method" is used.

Please anyone help me regarding this topic

File : 1.pdf

Thank you

First 268 269 270 271 272 273 274 Last Page 270 of 2097