Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

For some unknown reason, the code below does not work in Maple 2018.1, but works in Maple 2015 and Maple 2017 (the idea is taken from here

restart; 
with(plottools): with(plots):
V1,V2,V3,V4,V5,V6,V7,V8:=[0,-1,0],[0,0,0],[1,0,0],[1,-1,0],[0,-1,1],[0,0,1],[1,0,1],[1,-1,1]:  # The vertices of the cube
Faces:=[[V1,V4,V8,V5],[V5,V6,V7,V8],[V2,V3,V7,V6],[V1,V2,V3,V4],[V3,V4,V8,V7],[V1,V2,V6,V5]]: # The list of the faces
Colors:=[green, red,RGB(1, 0, 4),blue,grey,gold]: # The list of the colors
Cube[0]:=display([seq(polygon(Faces[i],color=Colors[i]),i=1..6)]):

for n from 1 to 7 do
F[n]:=t->rotate(Cube[n-1],t, [[0,n-1,0],[1,n-1,0]]):
Cube[n]:=rotate(Cube[n-1],-Pi/2, [[0,n-1,0],[1,n-1,0]]):
A[n]:=animate(display,[F[n](t)], t=0..-Pi/2,paraminfo=false);
od:

for m from 6 to 0 by -1 do
G[m]:=t->rotate(Cube[m+1],t, [[0,m,0],[1,m,0]]):
B[m]:=animate(display,[G[m](t)], t=0..Pi/2,paraminfo=false);
od:

C1:=display([seq(A[k], k=1..7)], insequence):
C2:=display([seq(B[k], k=6..0, -1)], insequence):
display([C1,C2], insequence, scaling=constrained, axes=normal);

 

I currently have a procedure that runs a fairly complicated formula involving non-commutative variables. The procedure is Vu(a, b, c) where a, b, and c are any integers. I have to run this formula whenever vacub appears in my expression. I'm currently replacing each variable of this type with the procedure Vu(a, b, c). I'm wanted to automate that process if possible. One thought I had was to assign the value of Vu(a, b, c) to the variable vacub for any value of a, b, and c from 1 to 5. Then use the eval command to replace the variables with the proper values. Is there any way to automate this process? Let me give you an example:

v0u0 = u0v0 + 2w0

So u0v0u0 = u0(u0v0+2w0) = u02v0+2u0w0

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.

restart

``

NULL

NULL

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

(1)

"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

(2)

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

E1

(3)

``

E2 := E1(x, y, z)

x*y^3+5*x^2*y+3*a^2+4*x*y+z^2+3*x-y+z+2

(4)

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

3*a^2+z^2+3*x-y+z+2

(5)

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

3*a^2+3*x-y+z+2

(6)

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

`+`

(7)

whattype(E2)

`+`

(8)

``


 

Download Truncate.mw

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

I would like the outputs to be that way.

sqrt(r/(r-b))

How to prevent this changes?

Thanks in advance,

 

Denis

Hello

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

# ???

Thanks.

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.

So:

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

 

 

 

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.
 

restart

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

````

``

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

(u^m-v^m)/(u-v)

(1)

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

(2)

"(=)"

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

(3)

"(=)"

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

(4)

eval(eq1, u = v)

0

(5)

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

5*v^4

(6)

unassign('m')

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

-u^(m-1)*(v/u)^m*u/(u-v)+u^(m-1)*u/(u-v)

(7)

"(=)"

-u^m*((v/u)^m-1)/(u-v)

(8)

eval(eq2, u = v)

Error, numeric exception: division by zero

 

``

``

u := v

v

(9)

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

v^m*m/v

(10)

"(=)"

v^(m-1)*m

(11)

``


 

Download Convert_to_Sum.mw

Hello

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

#ln(abs(x))

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

#ln(abs(x+1))

REALINT(1/x+1, x);

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

 

Thanks.

I am using Scientific notations and it constatly reminds me of the units and conversion challenges of using Maple.  I am using 2018 and am an engineer where units are our life blood for calculations.

 

Ive attached the file in ref where the constants shows J/Kg-mol   but outputs in a converted base unit of m^2 kg / s^2 mol K.  This modifies the value normally used by tables or other references as verification (often without units except in a column header)

 

The real problem is without units the caculated value 34.52 (or 0.03452) is meaningless when the real value has to be 287.05 if used without units or has correction applied within the SW internally.   

Units is my singular frustration with Maple as a really useful tool.  2018 moved this forward in so many ways which is very benficial.  I am really wondering if it may be how I'm setting the session up, or it is what it is.

Units_conversion_issue.mw

 

Hello,

I have an implicit function and I have plotted the graph of the same in maple 18 worksheet. Now I would like to export the data of the same graph into an excel file so that I can use it further. Kindly provide the solution and if some kind of example is provided I'll be highly grateful to you.

 

Thanks in advance

 

Hello people in mapleprimes,

I installed maple 2018 Japanese version.
And, with solve(x^2-1,x), its solution is expressed as _EXPSEQ(1, -1)

I know this expression is an internal represantation.
How can I have maple answer as 1, -1?

Thanks in advance.

Addition: my pc is mac osx 10.13.6.
 

 

 

Hello,

I'm trying to solve  inverse trigonometric equation:

EQ := sqrt(3)*arctan(x/sqrt(3))-arctan(x) = 1;

sol := solve(EQ, {x});

#sol := {x = sqrt(3)*tan(RootOf(-tan(sqrt(3)*_Z-1)*sqrt(3)+3*tan(_Z)))}

evalf(sol);

#{x = 13.24164497} OK. one Real solution.

sol2 := evalf(allvalues(sol));

#sol2 := {x = -.1141310781-1.108044977*I}, {x = -.1141310781+1.108044977*I}, # {x = 1.142681884}, {x #= -2.379974990}, {x = 13.24164497}

Check:

seq(evalf(eval(EQ, sol2[k])), k = 1 .. nops([sol2]));

#.99999999991340592650+1.61960960*10^(-11)*I = 1., .99999999991340592650-#1.61960960*10^(-11)*I = 1., .15821278548775934290 = 1., -.4580182246463005988 = 1., #.9999999996233630663 = 1.

1.Can someone explain to me where did Maple find these Additional roots like: {x = 1.142681884}, {x = -2.379974990}?

2.It's a Bug or normal behavior ?

 

Hi , 

I want to ask if there is any maple code of how to construct wavelet to solve fractional differential eqautions? Or any reference may be help me 

thanks 

Hello to everyone!

 

I was trying to implement the following proc:
 

``

restart; with(plots); with(plottools)

"AngleSpectrum  :=  proc( theta )  local A, B, C, a1,a2,col,k,n;  n := floor(2*Pi/theta):  for k from 1 to n do      a1 := theta*(k-1);   a2 := theta*(k);      if( k mod 2 = 0) then col := COLOR(RGB,.8,.3,.5);      else col := COLOR(RGB,.4,.3,.5) ; fi;      A[k] := plottools[pieslice]([0,0], 1, a1..a2, color = col  ):      C[k] := textplot( [ evalf(1.2*cos(a2)), evalf(1.2*sin(a2)),                   convert(a2, string)]):  od:  display( seq( {A[k], C[k]}, k = 1..n), scaling=constrained);  end proc:"

Error, unterminated loop

"AngleSpectrum  := proc( theta )  local A, B, C, a1,a2,col,k,n;  n := floor(2*Pi/theta):  for k from 1 to n do   a1 := theta*(k-1); a2 := theta*(k);  if( k mod 2 = 0) then col := COLOR(RGB,.8,.3,.5);      else col := COLOR(RGB,.4,.3,.5) ; fi;  A[k] := plottools[pieslice]([0,0], 1, a1..a2, color = col  ):  C[k] := textplot( [ evalf(1.2*cos(a2)), evalf(1.2*sin(a2)),   convert(a2, string)]):  od:  display( seq( {A[k], C[k]}, k = 1..n), scaling=constrained);  end proc:"

 

``


Can anyone help me to figure out my mistake?

Download proc.mw

First 30 31 32 33 34 35 36 Last Page 32 of 45