MaplePrimes Questions

. Let 𝑔(π‘₯) = cos2 (π‘₯ 2+1) (sinπ‘₯+1) 2 and 𝑓(π‘₯) = (2π‘₯ 2 − 1) 3√π‘₯ + 2.

Write a procedure to return the tangent line of the function 𝑓(π‘₯) at the given point π‘₯ ∈ 𝐷𝑓.

 

I started by writing a regular Proc template 

such as 

tangent line:=proc(y);

however i am unsure if I shpuld go forwrad with using an if loop or not?

 

 

What is the correct way to specify region where solution of a PDE is needed? For example, I am trying to verify my hand solution to this HW problem: Solve Poisson PDE in 2D 

The above is the only information given in the textbook. So it is only in the upper half plane. If I type this

interface(showassumed=0);
pde := VectorCalculus:-Laplacian(u(x,y),[x,y])=-1/(1+y);
bc:=u(x,0)=0;
pdsolve([pde,bc],u(x,y)) assuming y>0

Maple gives 

But I get by hand using method of images is

So not exactly the same. I think I made mistake in my solution. But I am also not sure that just saying "assuming y>0" is doing what I think it is supposed to do. For example, suppose we want to solve the same PDE say in the first quadrant. Typing

pdsolve([pde,bc],u(x,y)) assuming y>0,x>0

Gives same solution. But the solution should be different. And typing

pdsolve([pde,bc],u(x,y)) 

Gives same answer as well.

So I think I need another way to tell Maple the region of the solution. i.e. I need to tell Maple to use the Laplacian for the upper half plane only and not the Laplacian in the whole 2D space.

Any suggestions what to do and how to handle such problems?

Thank you

TangentLine(l, point(A, 0, 1), circle(c, [point(C, 0, 1), 1]))

Under geometry package if I use the command Tangentline, and if I want to change either the point of the circle, then 

Error, (in geometry:-line) the first argument is expected of type name

How I make it overwrite l each time? So I don't have to rename the tangents each time? 

 

 

When composing multiple plots, plots:-display's normal behavior is to set the overall plotting region to what is necessary to accommodate the union of the individual plots.  That works correctly most of the time but not in the case shown below.  This may indicate a bug in one of plots:-shadebetween,  plots:-display,  plottools:-extrude.  I have not been able to pinpoint the problem.  Any ideas?

restart;

Make a 3D plot:

plots:-shadebetween(x^2, 2-x^2, x=-1..1, color=red, transparency=0):
p1 := plottools:-extrude(%, 0..0.3);

 

Make another 3D plot:

plottools:-sphere([1.5,0,0], 1, color="Green"):
p2 := plots:-display(%);

 

Combine the plots:

plots:-display([p1,p2], scaling=constrained, style=surface);

 

We see that most of the green sphere has been cut off.  One way to fix things is
to add a view option (see below), but that wouldn't have been necessary if things
were working properly.

plots:-display([p1,p2], scaling=constrained, style=surface,
  view=[-1..3, DEFAULT, DEFAULT]);

 

This was done in Maple 2019.

Maple 2017 behaves the same way.  I don't know whether this ever worked properly in earlier Maples.
 

Download bug-in-3D-view.mw

 

Dear, I would like to kindly request your help with the following problem I have: 

L:= [0, 3,0,7];

for i from 1 to 4 do
if L[i] > 0 then 
x[i]:= [L[i]/2]
end if;
end do;

I need to write the elements x[i] as a list, however if I type x[i];  Maple just returns the last value of L[i]/2, namely 7/2. I do not know how to obtain the full list [3/2, 7/2]. What am I doing wrongly?

Many thanks in advance for your kind help. 

Dear Friends,
Please help to generate the following matrix.

I get this warning when ever I create a function that uses a sum or sequence:

 

g := x->sum(...,j=1..5);

 

I'm pretty sure I used to not get it at all in previous versions, I just upgraded recently and started seeing it. Is there any way to disable it? It is polluting the worksheet. Sometimes I might have several local's and I want them to be implicitly local but I do not want 10 warning messages.

Hello;

What trick if any is needed to obtain zero for this sum in Maple?

sum(sin(Pi*n/2)*sin(n*Pi*(x + 1)/2)*cos(n*Pi*t/2),n=1..infinity)

The above sum, according to Mathematica is zero. I am trying to see if same result can be obtained by Maple in order to verify this result. It is possible ofcourse that Mathematica result is not correct. I am also trying to verify the sum is zero by hand, but no success so far.

mySum:=sum(sin(Pi*n/2)*sin(n*Pi*(x + 1)/2)*cos(n*Pi*t/2),n=1..infinity)

sum(sin((1/2)*Pi*n)*sin((1/2)*n*Pi*(x+1))*cos((1/2)*n*Pi*t), n = 1 .. infinity)

value(mySum)

sum(sin((1/2)*Pi*n)*sin((1/2)*n*Pi*(x+1))*cos((1/2)*n*Pi*t), n = 1 .. infinity)

simplify(mySum)

sum(sin((1/2)*Pi*n)*sin((1/2)*n*Pi*(x+1))*cos((1/2)*n*Pi*t), n = 1 .. infinity)

 


Here is Mathematica result

Using Maple 2019.2 on windows 10. 

Thanks

Download q2.mw

It is easy to draw all the types of arcs in plots. Hence a multiple plot may help under such situations. I attempted to draw for a few problems, but found it difficult. Can any one help in drawing the same to get neat and clean output drawings for me to explain the answer to students.

Thanks
 

Find the area of the shaded portion (b) . (portion b not shaded)

 

 

 

 

Find the area of the shaded portion.

 

 

 

 

 

 Area b = Area (a+b) - Area a =    -     =

 

 

Find the radius of the circle.

 

 

 

 Mistake : It shd be 0.25 and not 4 times (x+...)

 

 

Find the height of the cone.

 

``

``

A circle with radius 1 is tangent to 2 points of the parabola y = x2   What is the area between the circle ana parabola?

 

 

 

 

 

 

 

NULL


Maple drawing shows all outer portions of circles.I used snipping tool to get cropped picture for first problem.

I already got a similar problem and got a response that i should use being forward and backward, but that seems to be not worth it many a times since figures become bigger in maple drawing with outer rectangles used for eliminating portions. (Ex: problem 1, not shown here)

Thanks.

Download GeometryProblems_Sketches_Problems.mw

Hello,

a follow up question.

I am solving some overdetermined system of ODEs in cylindrical coordinates r,phi,Z. I obtain some equations of the following type:

(diff(_F1(phi, Z), phi)*r + diff(diff(s_r(phi, Z), phi), phi))/r = -s_r(phi, Z)/r

As can be seen, the differentiated functions do not depend on r, which is an independent variable. Thus, the correct solution is to separate the equation and have 

_F1(phi,Z)=_F1(Z), s_r(phi,Z)=s_r(Z).

By using dsolve, I always obtain a solution containing r.

A similar problem that does no contain derivatives is solved by solve/identity.

Is there something similar for dsolve?

EDIT: I again put here more info and file. I solve some overdetermined system of differential equations.

[diff(s_r(r, phi, Z), r) = 0, diff(s_r(r, phi, Z), phi) = -diff(s_phi(r, phi, Z), r)*r^2,
diff(s_Z(r, phi, Z), r) = -diff(s_r(r, phi, Z), Z), diff(s_phi(r, phi, Z), phi) = -s_r(r, phi, Z)/r, 
diff(s_Z(r, phi, Z), phi) = -diff(s_phi(r, phi, Z), Z)*r^2, diff(s_Z(r, phi, Z), Z) = 0, 
diff(m(r, phi, Z), r) = s_Z(r, phi, Z)*B_phi(r, phi, Z) - s_phi(r, phi, Z)*B_Z(r, phi, Z),
 diff(m(r, phi, Z), phi) = s_r(r, phi, Z)*B_Z(r, phi, Z) - s_Z(r, phi, Z)*B_r(r, phi, Z),
 diff(m(r, phi, Z), Z) = s_phi(r, phi, Z)*B_r(r, phi, Z) - s_r(r, phi, Z)*B_phi(r, phi, Z), 
s_r(r, phi, Z)*diff(W(r, phi, Z), r) + s_phi(r, phi, Z)*diff(W(r, phi, Z), phi) + 
s_Z(r, phi, Z)*diff(W(r, phi, Z), Z) = 0]

After some time, I arrive at the equation in the original question. So the independance of the other functions on r is the consequence of the other equations.

Here is the file (shortened): mwquestion2.mw

Why is constants not an envvar or differently, why is there no envvar to declare constants?

We can see the context of  Matlab code in the Windows preview pane as follows, but we can' t see the context of Maple codes.

I wonder whether it is possible for Maple, too or not. Is there any method to achieve this? Because it really offers a great advantage for the fast browsing context of code in a folder that includes a lot of maple files.

 

(I use Maple 2019 and Windows 10)

 

 
 
 
 
 

Sorry if it's a dumb question, i'm new with Sage.

I'm doing the multiplication of two matrix and I obtain the expression 

 

[142√(2x−2√)+122√y] 

I want to represent this on 3d, but I realized that the expression has to be written with operators '*'

How can I add the operators to my expression?

 

Let A=[V1, V2 ,..., Vn ] be a list of binary vectors such that the length of Vi for i=1...n is the positive integer number m. For instance, in the following example we have n=6 and m=5.

A := [[1, 1, 1, 0, 0], [0, 1, 0, 1, 1], [1, 0, 1, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 0], [0, 1, 1, 1, 1]]

Suppose that ej with j=1...m are vectors of size m such that all entries of ej 's are zero except the jth entry where is equal to 1. Now set S=[e1,e2,...,em]. For example by m=5 we get 

S:=[[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]]

First, we choose i,j in [1...m] such that i<>j and then we update S as follows S=[e1,e2,...,em,ei+ej mod 2]. For example, it follows from i=1 and j=2 that 

S:=[[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1], [1, 1, 0, 0, 0]]

Now consider the kth entry of A which is called Ak. Then we check that what is the minimum number of entries of S so that the summation of these entries mod 2 is equal to Ak. For example, for  S=[e1,e2,...,em,e1+e2 mod 2] we get [2, 3, 4, 3, 2, 4] which means the minimum number of entries of the S that are required to be added in order to obtain A1 is 2 and so on. Therefore, for the given example we get 

E:=[[1, 2, [2, 3, 4, 3, 2, 4], 18, 7.615773106],
[1, 3, [2, 3, 3, 3, 3, 4], 18, 7.483314774],
[1, 4, [3, 3, 3, 3, 2, 4], 18, 7.483314774],
[1, 5, [3, 3, 3, 3, 3, 4], 19, 7.810249676],
[2, 3, [2, 3, 4, 2, 3, 3], 17, 7.141428429],
[2, 4, [3, 2, 4, 2, 2, 3], 16, 6.782329983],
[2, 5, [3, 2, 4, 3, 3, 3], 18, 7.483314774], 
[3, 4, [3, 3, 3, 2, 3, 3], 17, 7.], 
[3, 5, [3, 3, 3, 3, 3, 3], 18, 7.348469229],
[4, 5, [3, 2, 3, 3, 3, 3], 17, 7.]];

For instance, the interpretation of [3, 5, [3, 3, 3, 3, 3, 3], 18, 7.348469229] is that if S be [e1,e2,e3,e4,e5,e3+e5 mod 2] then we get [3, 3, 3, 3, 3, 3] where 18 is the summation of [3, 3, 3, 3, 3, 3] and also the number 7.348469229 is obtained from the following command: 

MatrixNorm(convert([3, 3, 3, 3, 3, 3], Matrix), Frobenius);

Now we choose Ek for k in [1..nops(E)] such that Ek[4] be minimum over all Ek[4]'s. For example we choose [2, 4, [3, 2, 4, 2, 2, 3], 16, 6.782329983] since 16 is minimum between Ek[4]'s.

There are two points: First one is that if we have Ei and Ej such that Ei[4]=Ej[4] then we choose Ei if  Ei[5]>Ej[5] . The second point is that if Ei[4]=Ej[4] and also Ei[5]=Ej[5] then we choose one of them such as the first one. Finally we update the set S from the first two entries of Ek that we have obtained. For instance, the updated S in our example is:

S=[e[1],e[2],e[3],e[4],e[5],S[E[6][1]]+S[E[6][2]] mod 2]=[e[1],e[2],e[3],e[4],e[5],e[2]+e[4] mod 2]

Now we repeat this procedure for the updated S until that in one of the entries of E such as Ek we get Ek[3]=[1,1,..,1].

I have written a procedure in Maple for the mentioned question. But my procedure takes long time to compute when I run it over a list such as A with parameters n=m=64.

I want to kindly request you please modify the following code or suggest another fast procedure for this question.

 
 restart;

 with(LinearAlgebra):
 with(ListTools): 
 with(combinat):
 
 BP := proc (A::list)
    local n, m, r, S, U, tt, P, E, t, Q, Z, R, k, T, j, PP, i, QQ; 
    n := nops(A); 
    m := nops(A[1]);
    r := [seq(0, i = 1 .. m)]; 
    r[1] := 1; 
    S := [seq(Rotate(r, m-i+1), i = 1 .. m)]; 
    unassign('r'); 
    U := []; 
    tt := 1;
 while 0 < tt do
     P := choose(nops(S), 2);
     E := [];
     for t to nops(P) do
          Q := P[t];
          Z := []; 
          R := [S[], `mod`(S[Q[1]]+S[Q[2]], 2)];
          for k to n do
               T := A[k];
               for j to nops(R) do 
                    PP := choose(nops(R), j);
                    for i to nops(PP) do 
                         QQ := PP[i]; r := `mod`(add(R[QQ[i]], i = 1 .. nops(QQ)), 2);
                         if Occurrences(0, r-T) = m then
                            Z := [op(Z), j];
                            i := nops(PP)+1; 
                            j := nops(R)+1 
                         end if; 
                      end do; 
                      unassign('i, QQ, r, PP'): 
                  end do;
              end do;
              E := [op(E), [Q[], Z, add(Z[i], i = 1 .. nops(Z)), evalf(MatrixNorm(convert(Z, Matrix), Frobenius))]]; 
              unassign('k, Z, Q, R'): 
          end do;
          r := FindMinimalElement([seq(E[i][4], i = 1 .. nops(E))]);
          R := []; 
         for i to nops(E) do 
             if E[i][4] = r then R := [op(R), E[i]] end if 
         end do;
         T := [FindMaximalElement([seq(R[i][5], i = 1 .. nops(R))], position)];
         S := [S[], `mod`(S[R[T[2]][1]]+S[R[T[2]][2]], 2)]; 
         U := [op(U), [R[T[2]][1], R[T[2]][2]]];
         if Occurrences(1, R[T[2]][3]) = n then tt := 0 end if;
         unassign('r, i, R, T, E')
     end do;
     return U;
 end proc:
 
 A := [[1, 1, 1, 0, 0], [0, 1, 0, 1, 1], [1, 0, 1, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 0], [0, 1, 1, 1, 1]];

 BP(A);
      [[2, 4], [3, 6], [5, 7], [1, 2], [1, 6], [3, 8], [3, 9], [8, 9]]
 

For more information please see Section 2.1 of the following paper: https://eprint.iacr.org/2019/856.pdf

Thanks in advance for your consideration of this request.

Dear friends, 

Lets say I have this procedure here. 
graph := proc(fn::anything, t::{integer, name}) if type(t, integer) then return fn; else return plot(fn, gridlines); end if; end proc

Currently it returns a function from input if I provide an addtional argument in integer form. And it provides the graph for the function if I include an extra argument of type name. 

However I would like to do (if possible) is to using the same proc to make the parameter t optional instead. Meaning if type 

graph(x^2)  then it only returns the input and if I type graph(x^2,g) then instead it returns the graph of the input function. 

Is this possible to do? I have this paragraph in the help files https://www.maplesoft.com/support/help/Maple/view.aspx?path=parameter_classes#optional But I am not sure if thats the way to go? 

Hope somebody has a hint/idea? Best regards 

First 320 321 322 323 324 325 326 Last Page 322 of 2132
ο»Ώ