Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Converting a VectorCalculus vector to a PhysicsVectors vector and reconverting it back
to VectorCalculus vector do not return the same result !
is this a bug ? Any clue ?

with(plots):
with(VectorCalculus):
with(Physics[Vectors]):
with(inttrans):
Setup(mathematicalnotation = true):

SetCoordinates('spherical'[r, phi, theta]);
E_[1]:=Vector(<r,phi,theta>);
'VectorCalculus(E_[1])'=type(E_,Vector);
'PhysicsVectors(E_[1])'=type(E_,PhysicsVectors);

Ev_[1]:=convert(E_[1],PhysicsVectors);
'VectorCalculus(Ev_[1])'=type(Ev_,Vector);
'PhysicsVectors(Ev_[1])'=type(Ev_,PhysicsVectors);

E_[2]:=convert(Ev_[1],VectorCalculus);
'E_[2]'<>'E_[1] !';

spherical[r, phi, theta]

 

`#mover(mi("E"),mo("&rarr;"))`[1] := Vector(3, {(1) = r, (2) = phi, (3) = theta}, attributes = [coords = spherical[r, phi, theta]])

 

VectorCalculus(E_[1]) = true

 

PhysicsVectors(E_[1]) = false

 

_phi*phi+_r*r+_theta*theta

 

VectorCalculus(Ev_[1]) = false

 

PhysicsVectors(Ev_[1]) = true

 

`#mover(mi("E"),mo("&rarr;"))`[2] := Vector[row](3, {(1) = r, (2) = theta, (3) = phi}, attributes = [vectorfield, coords = spherical[r, phi, theta]])

 

E_[2] <> factorial(E_[1])

(1)

 


 

Download BugConversion.mw

I have two .stl solid (and their equations).I need equation of intersection solid. How do you do?I don't want work with 3integral but mayby by system,thanks!

So I needed a CAS, and I spent a couple of months trying to get a basic understanding of SymPy and various applications starting with "M". We have Maple version 2016.

My "prototype problem" can be solved by hand, and is a system of quadratic Bellman equations, for i=1,2.  I'll return to it below, as I am obviously too clumsy to get even the second-to-simplest max/min working.  Oh, and I can't even insert Maple Math here in the forum, it does not like maximize or minimize.

Let's start easy. I enter
maximize((b-x)x,x) 
which works as I expect. Then already at
maximize((abs(b)-x)x,x>=0) 
I am stuck. Please, sweet Maple, you know that the answer is the same as before, don't you? (In the meantime I have tried to feed it maximize((b-x)x,x=0..1)... )

I was hoping my "proper" problem should be doable. What I really need is a sequence of quadratic optimization problems, where I have a vector x maximizing b'x-x'Ax subject to linear constraints, so it should not be too hard.  The "prototype problem" I needed for starters, is a system where for i=1,2 I have 

v_i(0,y)=0 and inductively v_i(t+1,y)=max{x_i*(b_i-x_1-x_2)+ r_i v_i(t,y-x)}

where b_i and r_i are constants, x=(x_1,x_2), y=(y_1,y_2), and everything is nonnegative - including, the choice variables x_i must be between 0 and min{y_i, b_i-x_1-x_2}. And I want to plot both functions and the x with time as a slider, but ... I don't think I'll ever get that far? 

Sorry for whining. (I know why I dropped out of computer science.)

Good book to start studying maple for engineering.

 


 

restart; with(plots)

Australopithecus := [[75, 25], [97, 30], [93, 40], [93, 45], [83, 50], [80, 55], [79, 60], [81, 73], [74, 76], [68, 81], [60, 82], [50, 83], [40, 80], [30, 71], [25, 60], [24, 50], [25, 37], [15, 33], [10, 30], [45, 10], [55, 16], [65, 10], [80, 8], [93, 14], [96, 24]]:

man := [[95, 39], [113, 40], [111, 47], [118, 53], [113, 62], [109, 72], [112, 88], [112, 95], [107, 112], [99, 117], [85, 122], [72, 122], [49, 117], [36, 104], [31, 78], [39, 52], [43, 43], [44, 34], [39, 16], [73, 3], [81, 17], [98, 14], [105, 17], [104, 26], [111, 33]]:

morph := proc (poly1, poly2, t) if nops(poly1) <> nops(poly2) then ERROR("mensaje.") end if; [seq([(1-t)*op(1, op(k, poly1))+t*op(1, op(k, poly2)), (1-t)*op(2, op(k, poly1))+t*op(2, op(k, poly2))], k = 1 .. nops(poly1))] end proc:

display([seq(polygonplot(morph(Australopithecus, man, (1/20)*k), scaling = constrained), k = 0 .. 19)], insequence = true, axes = none);

 

NULL


 

Download Australopithecus_updated.mw

http://www.gatewaycoalition.org/includes/display_project.aspx?ID=279&maincatid=105&subcatid=1019&thirdcatid=0

Lenin Araujo Castillo

Ambassador of Maple

Hi!,

Assume that we hace a set points in the plane, put X:=[a1,a2,...,aN] where each ai is given by its coordinates [x,y]. The commnad "convexhull(X)" give us the points of the convex hull of X, but how I can find to "lower-right" of these points? Please, see the attached image. I need to findo the points A,C,E and F, marked with a solid circle.

Many thanks in advances for your comments.

 

 

Hello,

I am so happy that this is my first time to ask a quension here.

Like the graph pasted down, i can get a graph of a ode with the odeplot in time domain.

Furthermore, i just want to get a envelope plot based on the time domain graph, just like showed in

the example graph here,

i have no way to plot it in maple,

Does anyone know a method to plot it in maple? 

Daer maple useres,

I am solving around 170 linear algebraic equations (symbolic) using linearalgebra " solve" command. I see the cpu usage is only 15%; as I the cpu is  i-7, octacore ,15% means around 1 core is in use. With time (12 hours)  cpu usage goes down to 0% showing free memory approx 0.

Why  is it happening? Is it due to high memory usage in storing large symobic expressions? Is there a way to engage all the cores( 100% Cpu)?

Thanks and regards.

Hello People in mapleprimes,

a^k*k/(a*a__0^k)

would not be simplifyed to k*a^(k-1)/a__0^k

with

symplify(a^k*k/(a*a__0^k)) assuming(k>1);

or other commands including expand.

Is there any way other than simplify(numer(..)/a)/simplify(denom(..)/a); ?

Thanks in advance.

 

Hi!

I am trying to solve a large system using solve(). Fortunately, my system is linear and it does have solutions. Actually, the system has free variables that gives multiple solutions.

However, I have hundreds of variables with different names and subscripts, and I only need one solution of the system. I noticed that solve() actually output the solution with the free variables on the right. So, is there a way that I can find all the free variables and give them 0, to get only one set of solution?

Thanks!

William

Using Insert->Table... and inserting information in the cells. 

So I've created Table1 but I can't seem to call any row/column cell information using that name.  How do we do that?  Also, what is the best way to search for information in those cells and return information in adjacent cells? 

In this application you can visualize the impulse generated by a constant and variable force for the interaction of a particle with an object in a state of rest or movement. It is also the calculation of the momentum-momentum equation by entering the mass of the particle to solve initial and final velocities respectively according to the case study. Engineering students can quickly display the calculations and then their interpretation. In spanish.

Plot_of_equation_impulse-momentum.mw

Lenin Araujo Castillo

Ambassador of Maple

Lets say I want to find the intersection point between the line l in parametric form and plane p, both mentioned in the Maple code below. Is there smarter way than using the solve method that I use the two final lines? 

 

with(geom3d);
plane(p, 2*x+y-3*z-3 = 0, [x, y, z]);
                               p
line(l, [-1+3*t, 1+t, 2-t], t);
                               l
intersection(I, p, l);
                               I
solve({x = -1+3*t, y = 1+t, z = 2-t, 2*x+y-3*z-3 = 0}, {t, x, y, z});
                  {t = 1, x = 2, y = 2, z = 1}
 

Hello.

I'd like to plot two coupled functions x=x(t) and y=y(t) given by expression R0 and R1 (see below) for the interval t=0.001..0.999 and then after that extract tha data from the graphs for functions x(t) and y(t).

How can I do that in easiest way?

I will appreciate you.

The procedure "ContractIndices" seems to produce wrong results. This is proved by the following source code, comparing the result of this procedure and a simple direct calculation:

with(DifferentialGeometry):with(Tensor):with(Tools):

DGsetup([x,y],P);
m:=nops(DGinfo("FrameBaseVectors"));
g:=evalDG(1/y^2*dx &t dx+1/y^2*dy &t dy);
CS:=Christoffel(g,"SecondKind");
R0:=CurvatureTensor(CS);
RFc:=ContractIndices(R0,g,[[1,1]]); # Maple Version 2015

# Out of the Help Page: ?Tensor[ContractIndices]
# Form the tensor product T &otimes; S and contract 
# the 1st index of T against the 1st index of S. 
# ContractIndices(T, S, [[1, 1]]);

# Only for comparison: g:= 
# _DG([["tensor", P, [["cov_bas", "cov_bas"], []]], [[
# [1, 1], 1/y^2], 
# [[2, 2], 1/y^2]]]);

# g in table form with all indices, including the zeros: 
g1t:=
table([(1, 1) = 1/y^2, (2, 1) = 0, (1, 2) = 0, (2, 2) = 1/y^2]);

# Only fpr comparison:
# R0:=
# _DG([["tensor", P, [["con_bas", "cov_bas", "cov_bas", "cov_bas"], 
# []]], 
# [
# [[1, 2, 1, 2], -1/y^2], 
# [[1, 2, 2, 1], 1/y^2], 
# [[2, 1, 1, 2], 1/y^2], 
# [[2, 1, 2, 1], -1/y^2]]
# ]);

# R0 in table form with all indices, including the zeros:
R01t:=
table([
(2, 1, 1, 2) = 1/y^2, 
(2, 1, 1, 1) = 0, 
(2, 2, 2, 1) = 0, 
(2, 1, 2, 1) = -1/y^2, 
(1, 1, 1, 2) = 0, 
(1, 2, 2, 2) = 0, 
(1, 2, 2, 1) = 1/y^2, 
(2, 1, 2, 2) = 0, 
(2, 2, 1, 2) = 0, 
(2, 2, 2, 2) = 0, 
(1, 1, 2, 1) = 0, 
(1, 2, 1, 2) = -1/y^2, 
(2, 2, 1, 1) = 0, 
(1, 1, 2, 2) = 0, 
(1, 1, 1, 1) = 0, 
(1, 2, 1, 1) = 0
]);

# Only fpr comparison:
# RFc := 
# _DG([["tensor", P, [["cov_bas", "cov_bas", "cov_bas", "cov_bas"], 
# []]], 
# [
# [[1, 1, 2, 2], 1/y^4], 
# [[1, 2, 1, 2], -1/y^4], 
# [[2, 1, 2, 1], -1/y^4], 
# [[2, 2, 1, 1], 1/y^4]]
# ]);

# RFc in table form with all indices, including the zeros:
RFc1t:=
table(
[(2, 1, 1, 2) = 0, 
(2, 1, 1, 1) = 0, 
(2, 2, 2, 1) = 0, 
(2, 1, 2, 1) = -1/y^4, 
(1, 1, 1, 2) = 0, 
(1, 2, 2, 2) = 0, 
(1, 2, 2, 1) = 0, 
(2, 1, 2, 2) = 0, 
(2, 2, 1, 2) = 0, 
(2, 2, 2, 2) = 0, 
(1, 1, 2, 1) = 0, 
(1, 2, 1, 2) = -1/y^4, 
(2, 2, 1, 1) = 1/y^4, 
(1, 1, 2, 2) = 1/y^4, 
(1, 1, 1, 1) = 0, 
(1, 2, 1, 1) = 0
]);

TestContr:=proc()
    description "Simple contraction";
    local i,j,k,l;
    global RR;
    for i from 1 to m do
        for j from 1 to m do
            for k from 1 to m do
                for l from 1 to m do
                    RR[i,j,k,l]:=add(R01t[r,j,k,l]*g1t[i,r],r=1..m)
                od;
            od;
        od;
    od;
    print(`OK`)
end;

TestContr();

# Result of this:
# RR:=
# table(
# [(2, 1, 1, 2) = 1/y^4, 
# (2, 1, 1, 1) = 0, 
# (2, 2, 2, 1) = 0, 
# (2, 1, 2, 1) = -1/y^4, 
# (1, 1, 1, 2) = 0, 
# (1, 2, 2, 2) = 0, 
# (1, 2, 2, 1) = 1/y^4, 
# (2, 1, 2, 2) = 0, 
# (2, 2, 1, 2) = 0, 
# (2, 2, 2, 2) = 0, 
# (1, 1, 2, 1) = 0, 
# (1, 2, 1, 2) = -1/y^4, 
# (2, 2, 1, 1) = 0, 
# (1, 1, 2, 2) = 0, 
# (1, 1, 1, 1) = 0, 
# (1, 2, 1, 1) = 0
# ]);

Testeq:=proc()
    local i,j,k,l;
    # global
    for i from 1 to m do
        for j from 1 to m do
            for k from 1 to m do
                for l from 1 to m do
    if not (RFc1t[i,j,k,l] = RR[i,j,k,l]) then 
     print([i,j,k,l]) fi;
                od;
            od;
        od;
    od;
end;

Testeq();
# Result of this:
#                          [1, 1, 2, 2]
#                          [1, 2, 2, 1]
#                          [2, 1, 1, 2]
#                          [2, 2, 1, 1]

# No equality for these indices!

Hello,

I have tryed, to run the file ImprovementsInPdsolve.mw with the Mapleversion 2017.3 but in the first example pde[1] I got this error:

Error, (in assuming) when calling 'dsolve'. Received: 'cannot determine if this expression is true or false: not 0 <= -(1/2)*Pi'


 pde[2],  pde[3] and others are o.k. but pde[4] to pde[6] not. Can You give me a hint what's wrong?

With kindly regards

Wolfgang Gellien

 

1 2 3 4 5 6 7 Last Page 1 of 1318