Maple 2015 Questions and Posts

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

Hello;

I need some help to compute the limits of integral:

 

and

 

Thank you for your help.

 

I_Mariusz

limity.mw

Hello everyone,

I'm new at maple.Sorry if this question asked before me, but i couldnt find it.

As i said i am new

so when I open new document (mode) at maple2015 i can do basic calculations for instance additon substraction multipicitaions. But when i want the  calculate x^2+5-3 and enter it supposed to be say to me blue line as a answer. But maple says nothing.

is there any point that i missing? 

Thank you very much all you in advance.

I want to solve the following equation for E[k]:

fr = 1.64*10^6*E[k]^2*exp(-8.5/E[k]);

Maple 17 gives

solve(fr = 1640000.00*E[k]^2*exp(-8.5/E[k]), E[k]);


          4.25000000000000             4.25000000000000     
    ----------------------------, --------------------------
            /  5442.65560181792\          /5442.65560181792\
    LambertW|- ----------------|  LambertW|----------------|
            |        (1/2)     |          |      (1/2)     |
            \      fr          /          \    fr          /

Maple 2015 gives:

solve(fr = 1.64*10^6*E[k]^2*exp(-8.5/E[k]),E[k]);
Error, (in solve) invalid input: `evalf/LambertW` uses a 2nd argument, zz, which is missing

This is Maple 2015.2 on OS X 10.10 Yosemite.

I can copy-paste Maple 17's solution into Maple2015 and it evaluates correctly (for a given value of fr).

Is this a bug or am I missing something? Help on LambertW looks identical for both versions of Maple.

M.D.

Hello All.

Why Maple can’t do this Simple indefinite integral?

I'm have a integral :

 

Please compare to Mathematica:

Thanks in advance for your help.

 

I_Mariusz

test.mw

Hello people in mapleprime

 

maxi:=proc(obj,expre,x,y)
local eq1,eq2,eq3,lagrangean;
lagrangean:=obj+lambda*expre;
eq1:=diff(lagrangean,x)=0:
eq2:=diff(lagrangean,y)=0:
eq3:=diff(lagrangean,lambda)=0:
solve({eq1,eq2,eq3},{x,y});
end proc;

Using the above procedure, next code will not return the values of a and b, or a[2] and b[2].

Can you teach me the reason why?

maxi(a*b,z-a-b,a,b);

maxi(a[2]*b[2],z-a[2]-b[2],a[2],b[2])

Thanks in advance.

 

taro

This one really has me baffled.

What the proc does is not important. This is just about as simple an example as I could write. Maple 2015 is complaining anytime I try to declare a local variable. The second example shows that the local declaration is needed - Maple even introduces it into the procedure that it defines.

restart;
test := proc(  )
local a;
a := 3
end proc;
Error, unexpected `local` declaration in procedure body
test := proc(  )
# local a;
a := 3
end proc;
Warning, `a` is implicitly declared local to procedure `test`
test := proc(x) local a; a := x end proc

Here's the version information for my current Maple.

interface( version );
Standard Worksheet Interface, Maple 2015.0, Windows 7, February 17 2015 Build ID 1022128

Can someone explain what is happening, and why I'm just now seeing this?

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

A lot of my life is at the moment spent using solve to solve systems of equations, and then trying to weed through the solutions maple gives to find the ones I am interested in. Specifically i'd like to have a program that can weed through the solutions and eliminate those that include equalities of the  form p[i]=-p[j] or p[i]=0  where i and j are integers (or equalities of that form with the letter q replacing p). Specifically i don't want to exclude equalities of the form p[i]=-p[j]*something+something else-another thing.... as they can be useful (or equalities of that form with the letter q replacing p).

Here is a (simple) example of the kind of equations I am likely to be solving and their output from solve:
A := solve([p[1]*p[2]*p[3] = q[1]*q[2]*q[3], p[1]+p[3] = q[1]+q[3], p[2]^2+p[3]^2 = q[2]^2+q[3]^2])

I have some code which gets rid of solutions where one variable is set to 0 

with(ArrayTools);
GetRidOfDumbSolutions := proc (sols)
local Nsols, Npars, GoodSol, GoodSols, GoodSolsCounter, i, j;
Nsols := numelems(sols); Npars := numelems(sols[1]);
GoodSols := []; GoodSolsCounter := 0;
for i to Nsols do
GoodSol := 1;
for j to Npars do
if IsZero(rhs(sols[i, j]))
then GoodSol := 0
end if
end do;
if GoodSol = 1 then
GoodSols := Concatenate(1, GoodSols, sols[i])
end if
end do;
GoodSols
end proc

but i can't see how (in maple) to detect an expression of the form p[i]=-p[j] especiall if that is being written in 2-d math. (i don't quite understand the different maths environments or how to convert from one to another or to string)

Good Morning,

This is the script that I have used to to an integration, as the command ''int'' didn't work because the coputation was really heavy.


p_old := 0;

g := 0; #index

E_tot_net_Point := 0;

for g to 2 do

 h := g+1;

 loopstart := SP_time[g];

 loopend := SP_time[h];

  for tt from loopstart by 0.01 to loopend do

   t := tt;

   P_tot_net_Fkt := t -> C_motore[g]*omega_motore[g]

if t≠SP_time[g] and t ≠ SP_time[h] then

 P_tot_net_Point := P_tot_net_Fkt(t);

 P_tot_net_Point_next := P_tot_net_Fkt(t+0.001);

 plt_P_tot_net_plt[t] := pointplot([t, P_tot_net_Point]);

 E_tot_net_Point := E_tot_net_Point+(P_tot_net_Point*0.01);

 plt_E_tot_net_plt[t] := pointplot([t, E_tot_net_Point]);

 p_old := P_tot_net_Point;

end if;      

  end do:

end do:

plots:-display(entries(plt_E_tot_net_plt, 'nolist'), title = "Energy", color = "Red", symbol = point, symbolsize = 20, gridlines = true, size = [1000, 500], labels = ['[s]', '[Watt*s]'], font = [axes, 12])


I have plotted the function as a series of points over the orizontal axis (t).

 

Now I would like to calculate the last value of the curve (which is itself a point) as a function of the orizontal axes t. How can I do it?

Something like E_tot_net_Point = f(t)

 

Thank you for the help

                                                                                                                                         

This post is my attempt to answer the question from   here : how to find all integer points (all points with integer coordinates) in the intersection of two cubes. The following procedure  IntegerPoints  solves a more general problem: it finds all the integer points of a bounded polyhedral region of arbitrary dimension, defined by a system of linear inequalities and / or equations.

Required parameters of the procedure: SN is a set or a list of linear inequalities and/or equations with any number of variables, the Var is the list of variables. The procedure returns the set of all integer points, satisfying the conditions  SN .

Code of the procedure:

restart;

IntegerPoints := proc (SN::{list, set}, Var::list)

local SN1, sn, n, Sol, k, i, s, S, R;

uses PolyhedralSets, SolveTools[Inequality];

SN1 := convert(evalf(SN), fraction);

for sn in SN1 do

if type(sn, `<`) then SN1 := subs(sn = (`<=`(op(sn))), SN1)

end if; end do;

if IsBounded(PolyhedralSet(SN1)) = false then error "The region should be bounded" end if;

n := nops(Var);

Sol := LinearMultivariateSystem(SN, Var);

if Sol = {} then return {} else

k := 0;

for s in Sol do if nops(indets(s[1])) = 1 then

S[0] := [[]];

for i to n do

S[i] := [seq(seq([op(j1), op(j2)], j2 = [isolve(eval(s[i], j1))]), j1 = S[i-1])] end do;

k := k+1; R[k] := op(S[n]);

end if; end do;

convert(R, set);

map(t->rhs~(t), %);

end if;

end proc:

 

Examples of use:

IntegerPoints({x > 0, y > 0, z > 0, 2*x+3*y+z < 12}, [x, y, z]);

       

  {[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 1, 4], [1, 1, 5], [1, 1, 6], [1, 2, 1], [1, 2, 2], [1, 2, 3], [2, 1, 1], [2, 1, 2],

                                   [2, 1, 3], [2, 1, 4], [2, 2, 1], [3, 1, 1], [3, 1, 2]}

 

IntegerPoints({x > 0, y > 0, z > 0, 2*x+3*y+z = 12}, [x, y, z]);

                                    {[1, 1, 7], [1, 2, 4], [1, 3, 1], [2, 1, 5], [2, 2, 2], [3, 1, 3], [4, 1, 1]}

 

IntegerPoints([x > 0, y > 0, z > 0, 2*x+3*y+z = 12, x+y+z <= 6], [x, y, z]);

                                                           {[1, 3, 1], [2, 2, 2], [4, 1, 1]}

isolve({x > 0, y > 0, z > 0, 2*x+3*y+z < 12});  #  isolve fails with these examples

              Warning, solutions may have been lost

isolve({x > 0, y > 0, z > 0, 2*x+3*y+z = 12});

              Warning, solutions may have been lost

 

In the following example (with a visualization) we find all integer point in the intersection of a square and a triangle:

S1 := {x > 0, y > 0, x < 13/2, y < 13/2}:

S2 := {y > (1/4)*x+1, y < 2*x, y+x < 12}:

S := IntegerPoints(`union`(S1, S2), [x, y]):

Region := plots[inequal](`union`(S1, S2), x = 0 .. 7, y = 0 .. 7, color = "LightGreen", nolines):

Points := plot([op(S)], style = point, color = red, symbol = solidcircle):

Square := plottools[curve]([[0, 0], [13/2, 0], [13/2, 13/2], [0, 13/2], [0, 0]], color = blue, thickness = 3):

Triangle := plottools[curve]([[4/7, 8/7], [4, 8], [44/5, 16/5], [4/7, 8/7]], color = blue, thickness = 3):

plots[display](Square, Triangle, Points, Region, scaling = constrained);

                                           

 

 

In the following example (with a visualization) we find all integer point in the intersection of two cubes. The second cube is obtained from the first cube by rotation with orthogonal matrix  A  and by a translation:

A := <1/3, 2/3, 2/3; -2/3, 2/3, -1/3; -2/3, -1/3, 2/3>:

f := unapply(A^(-1).<x+5, y-4, z-7>, x, y, z):

S1 := {x > 0, y > 0, z > 0, x < 6, y < 6, z < 6}:

S2 := eval(S1, {x = f(x, y, z)[1], y = f(x, y, z)[2], z = f(x, y, z)[3]}):

S := IntegerPoints(`union`(S1, S2), [x, y, z]);

Points := plots[pointplot3d](S, color = red, symbol = box):

Cube := plottools[cuboid]([0, 0, 0], [6, 6, 6], color = blue, linestyle = solid):

F := plottools[transform]((x, y, z)->convert(A.<x, y, z>+<-5, 4, 7>, list)):

plots[display](Cube,  F(Cube), Points, scaling = constrained, linestyle = solid, transparency = 0.7, orientation = [25, 75], axes = normal);

 

 

 

In the example below, all the ways to exchange $ 1 coins of 1, 5, 10, 25 and 50 cents, if the number of coins no more than 8, there is no pennies and there is at least one 50-cent coin:

IntegerPoints({x1 = 0, x2 >= 0, x3 >= 0, x4 >= 0, x5 >= 1,  x1+5*x2+10*x3+25*x4+50*x5 = 100, x1+x2+x3+x4+x5 <= 8}, [x1, x2, x3, x4, x5]);

nops(%);

                              {[0, 0, 0, 0, 2], [0, 0, 0, 2, 1], [0, 0, 5, 0, 1], [0, 1, 2, 1, 1], [0, 2, 4, 0, 1],

                                                 [0, 3, 1, 1, 1], [0, 4, 3, 0, 1], [0, 5, 0, 1, 1]}

                                                                                    8

 

Integer_points.mw

 

Addition: Below in my comments another procedure  IntegerPoints1  is presented that solves the same problem.

I assume that I'm not providing the correct input to the simplify command to get the simplification that I want.  In particular, for the following code:

assume(n, positive);
simplify(3^(-(1/2)*n)*2^((1/6)*n)-2^((2/3)*n)*6^(-(1/2)*n));
simplify(log(3^(-(1/2)*n)*2^((1/6)*n))-log(2^((2/3)*n)*6^(-(1/2)*n))); 

The expression should evaluate to 0.  However, the first expression does not simplify to 0 (it does not simplify at all in Maple) while the second expression simplifies to 0.

The simplification is fairly easy for the first expression by factoring 6 and combining terms; it seems like I'm not entering the command to simplify in this way.

After manually working out answer for problem 4-4 in Mathews & Walker's Mathematical Methods of Physics , I tried to check my solution with maple2015. Briefly the problem involves inputs periodic with period T, being transformed into outputs, through a kernal G.  The net result is that all input frequencies omega periodic in T are multiplied by (omega_0/omega)^2, except for constant frequency which transforms to zero.  The problem asks to evaluate the kernal G.

Maple2015 correctly evaluated the integral for a constant input, a cosine input, and a sine input, but gave undefined when I tried an exponential(i*x) input which is just a linear combination of the two previous inputs.  I found this interesting because the integral is finite, well defined, and only has an absolute function (in the kernal), which may cause Maple problems, as it correctly evaluated integral when I split it into two regions.  Interestingly if instead of working with a period of T, I used 2*pi, and redfined my G function accordingly, Maple evaluated the exp input integral without any problems.  So the problem appears to be with the T variable, but I correctly used assumptions of T>0, and 0<t<T, so I am not sure why it would work correctly when I use T=2*pi, but failed when using a general period T.  Any help would be welcome.

 

 

restart

assume(T > 0)

assume(0 < t and t < T)

about(T)

Originally T, renamed T~:

  Involved in the following expressions with properties
    T-t assumed RealRange(Open(0),infinity)
  is assumed to be: real
  also used in the following assumed objects
  [T-t] assumed RealRange(Open(0),infinity)

 

about(t)

Originally t, renamed t~:

  Involved in the following expressions with properties
    T-t assumed RealRange(Open(0),infinity)
  is assumed to be: RealRange(Open(0),infinity)
  also used in the following assumed objects
  [T-t] assumed RealRange(Open(0),infinity)

 

assume(n::integer, n > 0)

about(n)

Originally n, renamed n~:

  is assumed to be: AndProp(integer,RealRange(1,infinity))

 

G := proc (x) options operator, arrow; (1/2)*omega0^2*T^2*((1/6)*Pi^2-(1/2)*Pi*abs(2*Pi*x/T)+Pi^2*x^2/T^2)/Pi^2 end proc

proc (x) options operator, arrow; (1/2)*omega0^2*T^2*((1/6)*Pi^2-(1/2)*Pi*abs(2*Pi*x/T)+Pi^2*x^2/T^2)/Pi^2 end proc

(1)

(int(G(t-tp), tp = 0 .. T))/T

0

(2)

(int(G(t-tp)*sin(2*Pi*n*tp/T), tp = 0 .. T))/T

(1/2)*T^2*omega0^2*cos(t*Pi*n/T)*sin(t*Pi*n/T)/(Pi^2*n^2)

(3)

(int(G(t-tp)*cos(2*Pi*n*tp/T), tp = 0 .. T))/T

(1/4)*T^2*omega0^2*(2*cos(t*Pi*n/T)^2-1)/(Pi^2*n^2)

(4)

(int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = 0 .. T))/T

undefined/T

(5)

(int(G(t-tp)*(cos(2*Pi*n*tp/T)+I*sin(2*Pi*n*tp/T)), tp = 0 .. T))/T

undefined/T

(6)

simplify((int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = 0 .. t))/T+(int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = t .. T))/T)

(1/4)*omega0^2*exp((2*I)*t*Pi*n/T)*T^2/(Pi^2*n^2)

(7)

assume(0 < t and t < 2*Pi)

G2 := proc (x) options operator, arrow; 2*omega0^2*((1/6)*Pi^2-(1/2)*Pi*abs(x)+(1/4)*x^2) end proc

proc (x) options operator, arrow; 2*omega0^2*((1/6)*Pi^2-(1/2)*Pi*abs(x)+(1/4)*x^2) end proc

(8)

(int(G2(t-tp)*exp(I*n*tp), tp = 0 .. 2*Pi))/(2*Pi)

omega0^2*exp(I*n*t)/n^2

(9)

 

Download MathewsWalkerProblem4-4.mwMathewsWalkerProblem4-4.mw

 

 

I hoped that Maple would return the value of 1 in all commands (see below). However, introducing a scaling parameter, sigma, yields the unevaluated expression. Why? I still think it should evaluate to the value of 1.

 

kind regards,

Harry (not a mathematician, but a psychologist)

 

 

 

integral.mw

How to increase the size of toolbar icons in Maple 2015 32-bit Classic on Windows?

Hello everyone! I got some trouble in process a list. Hope you can help:

Assume i got a list like this:

 

{{k = k, l = RootOf(_Z^2+_Z*k+k^2-1), o = -k-RootOf(_Z^2+_Z*k+k^2-1)}, {k = k, l = RootOf(_Z^2+_Z*k+k^2+1), o = -k-RootOf(_Z^2+_Z*k+k^2+1)}, {k = 0, l = 1, o = -1}, {k = 0, l = -1, o = 1}, {k = 1, l = 0, o = -1}, {k = 1, l = -1, o = 0}, {k = -1, l = 0, o = 1}, {k = -1, l = 1, o = 0}, {k = RootOf(_Z^2+1), l = 0, o = -RootOf(_Z^2+1)}, {k = RootOf(_Z^2+1), l = -RootOf(_Z^2+1), o = 0}}

 

Now all i want is remove Complex and RootOf from this list, how can i do that?

Thank for your reading adn your help!

First 53 54 55 56 57 58 59 Last Page 55 of 71