MaplePrimes Questions

How I can change this to smooth curve

 The vertex connectivity of a graph  is the minimum number of vertices whose removal disconnects the  
  graph. With Maple, it's easy to get the connectivity of a graph, but  I can not  find a smallest vertex cut of 
the graph g by maple. 

 If a graph has some cut vertices, I see that the function ArticulationPoints seems to be able to solve.
 But for general smallest vertex cut, I don’t see a suitable function.  For example

with(GraphTheory):
G:=CompleteGraph(2,2,2,2);
DrawGraph(G);
VertexConnectivity(G)

6

This seems easy to do in Mathematica. See https://reference.wolfram.com/language/ref/FindVertexCut.html.

Plotting of a nonlinear differential equation?

I have not used Array much before. I made an array that has 3 elements, starting index is 0 and last index is 2.

I want each element in the array to be an empty list, so I can later add to it.  (since I do not know in advanced what size of list I need in each slot of the Array).

Array(0..2,[seq([],i=0..2)])

And this works in the code I am using. But the strange thing, each time I try to save the worksheet, I get Warning about saving Large calculation.

What large caclulation? The array is empty?

Even though the code is working, and I can add to each entry in the array lists OK and been using it OK, I think may be I am not doing something right.

How to correctly creat an Array from 0..N  and initialized each entry to empty list?

Maple 2021.2

Every time I open Maple it has the invitation to Login in the top right-hand corner.  I would like to sign in but have had quite a bit of trouble doing that.  I have a user name and password with Maplesoft web store and the same for MaplePrimes.  Should either of these work to log in? 

When doing

item:=x;
res:=remove(has,item,x);

Maple returns, as expected

But when item is not a single symbol, say sin(x) or diff(y(x),x), then it no longer returns ()

item:=diff(y(x),x);
res:=remove(has,item,diff(y(x),x));

It does not return () but it now returns the input itself, as if it was not removed.

Why is that, and how to make it return () also on composite expression?  I tried flatten and inplace option. Otherwise, I will have to do a special test before. 

The strange thing is that it works on 

item:=2*diff(y(x),x);
res:=remove(has,item,diff(y(x),x));

Now it returns as expected. So now it did remove diff(y(x),x). But it does not remove it when it is on its own. I assume this is by design. But it is not intuitive to the user. One would expect it to work same way on removing `x` or `sin(x)` or `diff(y(x),x)`

Hello everybody. Ive got some questions. 

As the title states: Draining a shaped container from the top, and the amount of Joule it takes to do it. That is what the questions are about. 

I did make the first one, and some attempts at the sphere questions b, and c. I left them out because i want to see what you guys come up with. I think ive got the right answers, but we will see if our answers compare. :) 

The Dutch text translated: Calculate in questions a, b, and c the amount of work (joule, J) it takes to drain a tank filled with water from the top with a pump. Each question has a discription of the shape of the tank. Take for gravity g=9.81m/s^2. For water take rho=1000kg/m^3.

a.
A coneshaped tank, the topangle is down, with a height of 2.0meters and a radius of 0.5meters. 

b.
A sphere with a radius of 1.0meters.

c.
The lower half of a sphere with a radius 2.0meters. 

Greetings,

The Function. 

"f(x):=(Pi*(x/(4))^(2)*x)/(3)*9.81"

proc (x) options operator, arrow, function_assign; (1/48)*Pi*x^2*x*9.81 end proc

(1)

1000*(int(f(x), x = 0 .. 2))

2568.251995

(2)

``

Download Question_for_maple_primes_8.mw

In the code above expression #1 contains the term D(Phi)(X): how can I replace the "abstract" function Phi by a "specific" one  phi = k*X(t) ?

restart:
alias(X = X(t)):
alias(Phi=Phi(X(t))):
kin := 1/2*M*diff(X, t)^2 + 1/2*m*diff(Phi, t)^2;  #1

# attempt to replace Phi by phi=k*X(t))
alias(phi=k*X(t)):
eval(kin, Phi=phi);                                #2 ... I expected phi would replace Phi

The attached file  How_to_eval.mw contains a more detailed explanation and a more general situation.

Thanks in advance

Dear all

I would like to compute the monomial polynomial in taylor series, I tried 
f:=cos(t);

fn:=n->subs(diff(f(x),x$n),x=0)/factorial(n);
but it is does not work 
anay help please

   Is there a way to export routines from a package. The reason I ask, I was answering a question here and I needed two routines I have, that I put together a couple of years ago in a package. I used showstat copied, pasted and edited. Worked, but not great and would utterly fail with anything complicated. e.g. In the two routines pasted  below SignedArea on line 3 c[1]  is c   [1] that caused a minor problem.  

restart

NULL

"RonanRoutines:-SignedArea := proc(a::{Vector, list}, b::{Vector, list}, c::{Vector, list, null} := null)  local M, A;     1   if c = null then     2       A := 1/2*a[1]*b[2]-1/2*a[2]*b[1]         else     3       A := 1/2*(b[2]-c[2])*a[1]+1/2*(-b[1]+c[1])*a[2]+1/2*c[2]*b[1]-1/2*c               [1]*b[2]         end if;     4   return A  end proc:"

NULLNULL

"RonanRoutines:-CrossingNumber := proc(A::list, B::list, C::list, E::list)  local s1, s2, s3, s4;     1   s1 := RonanRoutines:-SignedArea(A,B,C);     2   s2 := RonanRoutines:-SignedArea(A,B,E);     3   s3 := RonanRoutines:-SignedArea(C,E,B);     4   s4 := RonanRoutines:-SignedArea(C,E,A);     5   if s1 = 0 and s2 = 0 and s3 = 0 and s4 = 0 then     6       'undefined'         elif 0 <= signum(s1) and signum(s2) <= 0 then     7       if 0 <= signum(s3) and signum(s4) <= 0 then     8           -1             end if         elif signum(s1) <= 0 and 0 <= signum(s2) then     9       if signum(s3) <= 0 and 0 <= signum(s4) then    10           1             end if         else    11       0         end if  end proc:  "

NULL

Download Export_from_Package.mw

Hi,

Does anyone know how can I write this thing in a Maple script?
I have a problem with printing math expressions when there is an increment in the matrix power.

Please see attached.


 

with(plots); with(LinearAlgebra)

NULL

NULL

NULL

couples := [5, 0], [6, 0], [6, 3], [10, 3], [7, 5], [9, 5], [7, 7], [8, 7], [5.5, 9], [3, 7], [4, 7], [2, 5], [4, 5], [1, 3], [5, 3]

Points := Matrix([[5, 6, 6, 10, 7, 9, 7, 8, 5.5, 3, 4, 2, 4, 1, 5], [0, 0, 3, 3, 5, 5, 7, 7, 9, 7, 7, 5, 5, 3, 3]])

NULL

Homothety

 

W := Matrix(2, 2, {(1, 1) = (1/60)*k, (1, 2) = 0, (2, 1) = 0, (2, 2) = (1/60)*k})NULLNULL``NULLNULL

Rotation on x axis

 

NULL

X := Matrix(2, 2, {(1, 1) = cos((1/90)*Pi*k), (1, 2) = sin((1/90)*Pi*k), (2, 1) = sin((1/90)*Pi*k), (2, 2) = -cos((1/90)*Pi*k)})````NULLNULL

Rotation of angle k

 

Y := Matrix(2, 2, {(1, 1) = cos((1/180)*Pi*k), (1, 2) = -sin((1/180)*Pi*k), (2, 1) = sin((1/180)*Pi*k), (2, 2) = cos((1/180)*Pi*k)})NULLNULLNULL

``

n := Multiply(Y, Multiply(X, Multiply(W, Points)))

_rtable[18446746437110297774]

(3.1)

NouvCouples := seq([n[1, i], n[2, i]], i = 1 .. 15)

Sapin := animate(polygonplot, [[NouvCouples], color = "ForestGreen"], k = 0 .. 180)

 

 

NULL

Neige

 

PointsNeige := seq([-30+i, 30-(1/2)*j*sin(i+j)], i = 0 .. 60); neige := animate(pointplot, [[PointsNeige], color = black], j = 0 .. 60, view = [-30 .. 30, 0 .. 30])

 

NULL

display([Sapin, neige], scaling = constrained)

 

NULL

NULL


 

Download Homework.mw

 

Hi, i need some help for a homework.

Here is the statement

You must first animate a series of linear transformations on the polygon formed by the following couples: [5, 0], [6., 0], [6, 3], [10, 3], [7, 5], [9, 5], [7, 7], [8, 7], [5.5, 9], [3, 7], [4, 7], [2, 5], [4, 5], [1, 3], [5, 3] It will be necessary to make, at the same time, a rotation around a line making an angle k with the axis of x, a rotation of an angle k and a scaling of variable ratio (but equal to 3 at the end animation). The k animation parameter should range from 0 to 180. I suggest you use the color green for your polygon. Then you will need to create a second animation by entering these command lines: SnowPoints: = seq ([- 30 + i, 30 - j / 2 * sin (i + j)], i = 0 .. 60): snow: = animate (pointplot, [[PointsNeige], color = black], j = 0 .. 60, view = [-30 .. 30, 0 .. 30]) : Finally, you will have to roll both animations at the same time.

The GIF shows the results that I should get according to my teacher

Thanks for the help !

Dear all

I solve a first order nonlinear ode, using dsolve but there is no solution obtained.

problem_dsolve.mw
How, can I get the exact solution.

tahnk you for your help

In the obselote book programming examples it is using array's as data type

Is het easier to use A Vector or Matrix as datatype?

Can Maple solve an ode by asymptotic expansions methods? series methods (power series or Frobenius series) work only on ordinary expansion point or removable singularity point. For non removable singularity (essential), Maple's dsolve with series method can't solve these. Also, if the RHS of the ode is not analytic at the expansion point, series method do not work. 

The asympt command only applies to algebraic expressions.

Does Maple have something similar to Mathematica's AsymptoticDSolveValue  ?

Here is an example. This is an ode with RHS not analytic (has no Taylor series) at x=0

ode:=diff(y(x),x)+y(x)=1/x;
dsolve(ode,y(x),'series',x=0)

No solution.  While in Mathematica

ode = y'[x] + y[x] == 1/x
AsymptoticDSolveValue[ode, y[x], {x, 0, 6}]

 

Here is another example of ode where the coefficient of y(x) is not analytic at x=0

ode:=diff(y(x),x)+sqrt(x)*y(x)=0;
dsolve(ode,y(x),'series',x=0)

No solution. In Mathematica

ode = y'[x] + Sqrt[x] y[x] == 0
AsymptoticDSolveValue[ode, y[x], {x, 0, 6}]

Does there exist a package in Maple that can do this? Will this functionality be added in Maple in the future if currently there is no support? ( I searched and could not find anything so far).

One possible workaround I found is to solve the ODE using normal methods (non-series), then apply the asympt command on the solution. But one needs to remove the constant of integration first, Here is the above example done this way

ode:=diff(y(x),x)+sqrt(x)*y(x)=0;
sol:=dsolve(ode);
Order:=8;
sol:=eval(sol,_C1=1);
asympt(eval(rhs(sol),x=1/y),y);
eval(%,y=1/x)

Mutliplying the above back by the constant _C1 gives same answer as Mathematica's.

Is the above how one is supposed to do it in Maple? It worked on the above simple example, but need to see if it will work for other examples. it will be better if this was more directly supported. i.e. if asympt will work directly on ode's (or a new command or a new option to dsolve similar to 'series' but call 'asympt').

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