MaplePrimes Questions

I have a procedure to truncate algebraic equations. Found the basic answer hrere. I would like to make it handle equations and functions i.e f:=a x^2 +b y... and f(x,y):=c x y^2.... I can make it handle the first type but not the second.





Trunc := proc (eq, odr := 2, v::list := [x, y, z]) local a, b, q; description " Truncates an algebraic equation to required degree"; a := eq; b := v; map(select, proc (q) options operator, arrow; evalb(degree(q, b) <= odr) end proc, a) end proc

proc (eq, odr := 2, v::list := [x, y, z]) local a, b, q; description " Truncates an algebraic equation to required degree"; a := eq; b := v; map(select, proc (q) options operator, arrow; evalb(degree(q, b) <= odr) end proc, a) end proc


"E1(x,y,z):=2+3 x-y+5 x^(2)y+4 x y+x y^(3)+3 a^(2)+z+z^(2)"

proc (x, y, z) options operator, arrow, function_assign; 2+3*x-y+5*x^2*y+4*y*x+x*y^3+3*a^2+z+z^2 end proc


Trunc(E1, 2, [x, y, z])




E2 := E1(x, y, z)



Trunc(E2, 1, [x, y])



Trunc(E2, 1, [x, y, z])



``whattype(E1(x, y, z))









Could anyone tell me why Maple changes the sign of some expressions? For example...

I would like the outputs to be that way.


How to prevent this changes?

Thanks in advance,



I was pleased to observe that in Maple 2018 one can use dsolve to get solutions of matrix ODEs, e.g., X'(t)=A(t) X(t). The command is the obvious dsolve({diff(X(t),t)=A(t).X(t), X(0)=Xo}).

I was then surprised that Maple balked at the commands dsolve({diff(X(t),t)=A(t).X(t), X(0)=Xo},numeric) and dsolve({diff(X(t),t)=A(t).X(t), X(0)=Xo},numeric,{x(t),y(t)}).  Is there some error on my part?

How to linearize this complex dynamical system around x1(t)=0, x2(t)=0, x3(t)=0. Basically i want to keep nonlinear part up to fifth order on the right hand side and later want to drop it. How can i do it. The maplesheet is attached.

Many thanks in advance.

How can I generate a sequence of random numbers Xi and Yi in [-1,1] ?


Why I couln't receive the value of Wn[0, 0, 1] in the following loop?



> restart;

>for n from 1 to 3 do

Wn[0 .. 1, 0 .. 1, n] := n*ArrayTools:-Alias(Matrix(2, 2, [[3, 1], [1, 3]]), [0 .. 1, 0 .. 1])

end do:
>Wn[0, 0, 1];

Wn[0, 0, 1]



I want to compute integral with Maple,but returns unevaluated for me.

int((-5*ln(x)^4*Pi^4-20*ln(x)^2*Pi^4-8*Pi^4+120*MeijerG([[0, 0], [1, 1, 1]], [[0, 0, 0, 0, 0], []], x^Pi))/(120*Pi^4*(-1+x)^2), x = 4/10 .. 6/10, numeric);

# ???


Hello all

I am teaching engineering and I use Maple to make handouts with solutions to assignments.

In Maple 2017 I used interface(displayprecision=4) to make maple it display all outputs with 4 significant digits.

Just to be clear:

If the actual value is 123.456789, then interface(displayprecision=4) makes it display 123.5 in Maple 2017. This is just how I want it.

If the actual value is 1.23456789, the interface(displayprecision=4) makes it diplay 1.235 in Maple 2017. Again, this is perfect, just how I (and most engineers) like it.

Now I have installed Maple 2018 and now interface(displayprecision=4) means 4 decimal points rather than significant digits.


123.456789 => 123.4568 in Maple 2018

1.23456789 => 1.2346  in Maple 2018

This is NOT what I want.

Digits or, say, evalf[4] will not work as a fix, as I only want the DISPLAYED value to have 4 significant digits, I want the entire value used in calculations.

I am told (by Carl Love, thank you Carl) that displayprecision=4 means 4 decimal points in most versions of Maple, but I do need 4 significant digits.

Is there a fix in Maple 2018? Something that will make all output values display with 4 significant digits?

I am considering re-installing Maple 2017 and reverting to it, it turns out to be a huge work to format each output value.

I hope someone can help me, thank you in advance.

Regards, raskr




Hi guys,

I have some information about function f(x)=x^2+y(1-x)^3/4 where x domain is [0,1] and y is a parameter but i can not obtained this information with maple.

I know function f(x) for y>1.4266 is monotically decreasing and there is no turning points,(actually i can compute infection points of above function: y=1.4266 and x=4/5 )

I know function for 1.4266>y>1.0144 has two turning points a minimum for x<4/5 and a maximum for x>4/5 , but i dont know how y=1.0144 is calculated and what is the nature of this point !!! and how this relates to x><4/5 !

I know fucntion for y<1.0144 has to two turning points that the global maximum of function happens at x<0.97702, but also i can not compute 1.0144 and how this relates to x<0.97702 !!


I am trying to evaluate some functions when u=v so function goes to 0/0

Example given below of the expansion series I need to produce first. But I can't produce it.


"How do I get this expansion and sum"?""



eq := (u^m-v^m)/(u-v)



eval(eq, u = v)

Error, numeric exception: division by zero



eq1 := convert(eq, Sum, method = rational, include = powers)

(Sum((1-u)^_k1*binomial(-m+_k1-1, _k1), _k1 = 0 .. m)-(Sum((1-v)^_k1*binomial(-m+_k1-1, _k1), _k1 = 0 .. m)))*(Sum((-1)^_k1*(-1+u-v)^_k1, _k1 = 0 .. infinity))



-(Sum((-1)^_k1*(-1+u-v)^_k1, _k1 = 0 .. infinity))*m*(Sum((1-u)^_k1*binomial(-m+_k1, _k1)/(-m+_k1), _k1 = 0 .. m))+(Sum((-1)^_k1*(-1+u-v)^_k1, _k1 = 0 .. infinity))*m*(Sum((1-v)^_k1*binomial(-m+_k1, _k1)/(-m+_k1), _k1 = 0 .. m))



-(Sum((-1)^_k1*(-1+u-v)^_k1, _k1 = 0 .. infinity))*m*(Sum((1-u)^_k1*binomial(-m+_k1, _k1)/(-m+_k1), _k1 = 0 .. m))+(Sum((-1)^_k1*(-1+u-v)^_k1, _k1 = 0 .. infinity))*m*(Sum((1-v)^_k1*binomial(-m+_k1, _k1)/(-m+_k1), _k1 = 0 .. m))


eval(eq1, u = v)



for m to 5 do m, "   ", simplify(eq); eval(simplify(eq), u = v) end do




``eq2 := sum(u^(m-1-i)*v^i, i = 0 .. m-1)






eval(eq2, u = v)

Error, numeric exception: division by zero




u := v



eq3 := sum(u^(m-1-i)*v^i, i = 0 .. m-1)










I'd like Maple to return ln(abs(x)) for int(1/x,x) instead of ln(x).

I tried convert MMA code,but I failed.

realIntegrate[f_, x_Symbol] := 
 Simplify[Integrate[f, x] /. Log[expr_] :> Log[Abs[expr]], 
  x \[Element] Reals]; Unprotect[Integrate]; 
Integrate[f_, x_Symbol] /; ! TrueQ[$flag] := 
 Block[{$flag = True}, realIntegrate[f, x]]; Protect[Integrate];

My maple code works only for very simple cases.

REALINT := proc (f, x)

if typematch(int(f, x), ln(y::anything), 's') then

`assuming`([simplify(ln(abs(rhs(s[1]))))], [x in real])

else int(f, x)

end if

end proc;

REALINT(1/x, x);


REALINT(1/(x+1), x);


REALINT(1/x+1, x);

#x+ln(x) dosen't work.



I have an expression involving a sqrt, and i'd like to simplify it, but simplify(expression,sqrt) doesn't seem to fully help.

Eq1 := [(1/2)*(R[b]*kh[a2]+R[m]*kh[a2]-Rh[m]*kh[a2]+sqrt(R[b]^2*kh[a2]^2+2*R[b]*R[m]*kh[a2]^2-2*R[b]*Rh[m]*kh[a2]^2+R[m]^2*kh[a2]^2-2*R[m]*Rh[m]*kh[a2]^2+Rh[m]^2*kh[a2]^2))/kh[a2] = 0, 0 = 0, -(1/2)*(R[b]*kh[a2]+R[m]*kh[a2]-Rh[m]*kh[a2]+sqrt(R[b]^2*kh[a2]^2+2*R[b]*R[m]*kh[a2]^2-2*R[b]*Rh[m]*kh[a2]^2+R[m]^2*kh[a2]^2-2*R[m]*Rh[m]*kh[a2]^2+Rh[m]^2*kh[a2]^2))/kh[a2] = 0]

simplify(Eq1, sqrt)


[(1/2)*(R[b]*kh[a2]+R[m]*kh[a2]-Rh[m]*kh[a2]+sqrt(kh[a2]^2*(R[b]+R[m]-Rh[m])^2))/kh[a2] = 0, 0 = 0, -(1/2)*(R[b]*kh[a2]+R[m]*kh[a2]-Rh[m]*kh[a2]+sqrt(kh[a2]^2*(R[b]+R[m]-Rh[m])^2))/kh[a2] = 0]

which on paper simplifies to:


is there a way to get maple to show this?

[In part I am trying to better understand how to manipulate sqrt expressions in maple]

Please how do I display these two fields in the euclidian plane:

(X,Y)=(2e_1, e_2)=(2\partial/\partial x_1,\partial/partial x_2)


with their **elements representation** ? What is the appropriate command to display this?

I have a complicated expression which includes RootOf( a quadratic ) but holds for all x what i'd like to do is turn it into a polynomial in x[1], x[2], x[3] so i can start looking at the monomial coefficients.

k[a1]*((x[1]+x[3])*k[d1]+C[T]*k[m])*(R[b]-x[1]-2*x[2])/((R[b]+R[m]-x[1]-2*x[2]-x[3])*k[a1]+k[m])-k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) the subject and squaring both sides, and then movinbg everything onto one and multiplying out denominators. However RootOf is something I'm not used to manipulating.

Is there anyway of converting this expression to a polynomial using maple commands?

First 441 442 443 444 445 446 447 Last Page 443 of 2084