Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi everiboty


This is a notional example derived from my real application.
I have different quantities named Object1, Object2, ... ObjectN (N being a nonnegative integer) and a boolean sequence A of length N.
By construction A contains only one "true" values (and thus N=-1 "false").
I wrote a procedure Choice that takes as input such a sequence and returns the single object among Object1, ... ObjectN for which [A][n]=true.

I know that it would have been clever to name the quantities Object1, ... ObjectN differently (for instance by indexing them), but I'm constrained by what already exists.
Here is my procedure

restart:
Choice := proc(a)
  local l, n, object:
  l := [seq(args(k), k=1..nargs)]:
  n := ListTools:-Search(true, l):
  object := Object||n:
  print(object):
end proc:

# a few examples of Object(s)
Object1 := {x1, y1, z1}: 
Object2 := {x2, y2}:
Object3 := {x3}:

# application:
A := false, true, false:
Choice(A);

    {x2, y2}


Now I want to insert this procedure within a another one named “f”:
restart:

f := proc():
local Object1, Object2, Object3:
local Choice, A:
Choice := proc(a)

  local l, n, object:
  l := [seq(args(k), k=1..nargs)]:
  n := ListTools:-Search(true, l):
  object := Object||n:
  print(object):
end proc:

Object1 := {x1, y1, z1}: 
Object2 := {x2, y2}:
Object3 := {x3}:

# here I give A some values, in the true application A is the sequence
# returned by a Maplet through a Shutdown command
# More precisely A correspond to “N” buttons of the same group … then
# only one is “true”.

A := false, true, false:
Choice(A);
end proc;

f();

    Object2

 


Replacing print(object): by print(eval(object)): within procedure  Choice produces  the same ‘uneval’ answer.

I cannot figure out why procedure f doesn’t return the expected {x2, y2} answer
The only workaround I have found is to replace
  object := Object||n:
  print(object):


by this awfull sequence
    if n=1 then print(Object1)
  elif n=2 then print(Object1)
  …
  end if


Could you please help me to understand where is my error and how could I fix it?

Thanks in advance

hi guys,

i having trouble solving 3 equations with 3 unknowns. in fact i have 3 independent unknowns p,v,w and 1 dependent unknown t, i want to plot p(t)! actually in a simple system of equations one can solve p(t) analytically and then plots it but in a complicated system of equations it is impossible to solve p(t) analytically. i consider a simple system of equations in attachment to understand the procedure of ploting the solutions of a system of equations numerically.

 

numerically.mw

 

Could someone pleease clarify this error message below.

sol1 := dsolve({syst, theta1(0) = (1/2)*Pi, theta2(0) = (1/4)*Pi, (D(theta1))(0) = 0, (D(theta2)(0) = 0}, theta1(t), theta2(t), type = numeric, output = listprocedure);
Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations
 

 

singular(ln(y^2+1),y);

        {y = -I}, {y = I}, {y = infinity}, {y = -infinity}.

But if "y" was real, then there are no finite singularities, since y^2 is always positive and hence y^2+1>0 always. Adding assumptions did not help

singular(ln(y^2+1),y) assuming y::real;

gives same result. RealDomain does not support singular.  But I am no longer using RealDomain as it seems bugy.

I know I could filter out these complex results using remove(), but it would be nice if there was a way to singular supports assumptions. Is there a way to do it?

Why are the following 2 commands produce different result?

restart;
RealDomain:-solve({y=y,y<>0},y);
solve({y=y,y<>0},y);

                            [y = 0]
                            {y <> 0}
 

Should not the result be the same?

solve({y=y,y<>0},y) assuming y::real;
                           {y <> 0}


Maple 2018.1. 

Dear friends,

I noticed that the function numbcomb from the package combinat fails to calculate a value properly.

Let's try to calculate the example from the function's help page:

combinat[numbcomb](7, 3);
combinat[numbcomb](5, 4);

returns 35, 5 correspondingly, whereas should be 15 and 4.

Please, check this in your systems. Maybe, this is a bag in my installation?

 

Suppose I have a subset of R^2, say (x,y) € [0,1] x [0,1]

Now I map

x=r*exp(t)

y=r*exp(-t)

Is it possible to do a 2d contourplot to just see where [0,1]x[0,1] is mapped onto ?

Hi everyone,

I'm having some difficulty replicating a vector diagram. 

So I have learnt how to plot the vector diagram and I have been getting the correct results however the graph I am trying to replicate has some sort of limit within the range they are using which changes the direction of the vector. I was hoping to get this result, but I don't know how to achieve it. Could anyone point me to the right direction please.

Graph I want to replicate (i've highlighted the section that I want to achieve), what I get.

I look forward to your replies.

Thank you in advance

Are these errors to be expected? Why do they happen?

restart;
solve({x<>10, -infinity<x , x<infinity, -infinity<y , y<infinity},{x,y});

Error, (in solver) invalid input: SolveTools:-Inequality:-LinearUnivariateSystem expects its 1st argument, eqns, to be of type ({list, set})({`<`, `<=`, `=`}), but received {x <> -infinity, x < 10}

But it works when replacing x<>10 by y<>10

restart;
solve({y<>10,-infinity<x , x<infinity, -infinity<y , y<infinity},{x,y});

            {10 < y, x < infinity, y < infinity, -infinity < x}, {y <> -infinity, x < infinity, y < 10, -infinity < x}

What is the difference in the above two?

It also work when replacing x<>10 by x=10

solve({x=10, -infinity<x, x<infinity, -infinity<y , y<infinity},{x,y});
               {x = 10, y < infinity, -infinity < y}

It also works when removing the y parts by keeping x<>10

solve({x<>10, -infinity<x , x<infinity},{x,y});
           {y = y, 10 < x, x < infinity}, {y = y, x < 10, -infinity < x}

it also works when removing x<>10 and putting back the y stuff

solve({-infinity<x , x<infinity, -infinity<y , y<infinity},{x,y});
              {x < infinity, y < infinity, -infinity < x, -infinity < y}

Why Maple gives an error for some cases and not the others?

Maple 2018.1

Hi

I need to find a relation between delta [m,k] in terms of m and k

delta[m,k]=f(m,k), where k=0,1,2,...,m

A code is written (delta.mw) to find delta[m,k] for a certain amoun of m.

Is there a way or a code to find a general form of f(m,k)?

Thanks

 

 

Hello

 

I've written a completely symbolic expression involving sum function. When I hit enter, Maple 2016.2 evaluates the expression although it's completely symbolic and not evaluable.

 

How to stop Maple from falsely evaluating a symbolic expression? I dis use the restart command to make sure all variables are empty. When evaluating Maple generate a very large open form expression that makes no mathematical sense.

 

Maple file in the following link

https://www.dropbox.com/s/13ciwothh1pqijk/sumBug.mw?dl=0

Please advice

Thanks

I am fairly new to Maple and I'm currently researching twisted multiloop algebras. I'm trying to use Maple to automate many of the calculations. For example, suppose xy = yx + 2z and I have the expression wxy (the variables are non-commutative. I already have this functionality working properly with the physics package). I want Maple to make the substitution for xy and simplfiy. For example: wxy = w(yx + 2z) = wyx + 2wz. Is this possible?

Thank you for your help.

I have two matrices, one of the dimension of solution space that i have been using solve to navigate
this matrix will look something like:

M := matrix([[3, 2, 1], [2, 1, 1],[2, 1, 1]])

and I have another matix of the times that it takes solve to find these regions:

N := matrix([[.2, .4, .8], [.3, .6, .5], [.8, 2.3, 2.6]])

I'd like to find the sets {N[ij]:M[ij]=m for some integer m}; that is I'd like to get all the elements of N on entries of M with the same number so i can start thinking about them statistiaclly.

i.e. for 3 i'd like the list [.2]

      for 2                      [.4 .3 .8]

and so on.
 

I wish to extract a minimum route in a network given both start and end positions.

Also, I wish to avoid a spur in the circuit and obtain one continuous orthogonal  path. 

As an example, take the 7-node case having 14 arcs (see worksheet) using Dijkstra's algorithm (I assume this is fit for purpose in this particular case).

Starting with node 1, the algorithm suggests the paths:

1>2>3>4>5>6>7.>8>9 and 1>2>3>4>5>10>11>12>13>14 (here, there is a spur at node 5 where the paths separate)

Is it possible obtain one minimum path?

The source node is prescribed in the routine - can anyone explain how to prescribe the end node?

Thanks for reading!

Shortest_Circuit.mw

 

I tried to integrate

int((1-x^floor(u))/((1-x)*u^2), u = 1 .. infinity, numeric)

where x=-1. The result should be log 2 = 0.6931471806. However it gives me 0.6687714032.

When using a numeric cut off, the result improves, so what is the issue here?

6687714032

First 779 780 781 782 783 784 785 Last Page 781 of 2217