Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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

Use Maple to create the vector b that is column 2 from A and the matrix C that is made from columns 1 to 1 and 3 to 11 of A (in the same order as the columns of A.

Now solve the matrix equation

Cx=b

and enter the 4th component of the unique vector solution for x in the box below.

 

Let P(x) a polynomial with a single indeterminate.
In Maple 2015 (please, do not consider this question if Maple >=2021 doesn't present this problemcoeffs returns the coefficients P(x) in a different in some circumstances:

m := [$1..3]:

add(m[k]*(R)^(k-1), k=1..3):
c:= coeffs(%, R, 't'): [c], [t];

                              [ 2      ]
                   [3, 2, 1], [R , R, 1]
add(m[k]*(R)^(k-1), k=1..2):
c:= coeffs(%, R, 't'): [c], [t];
                        [1, 2], [1, R]

The order in the first case is R^2, R^1, R^0 while it is R^1, R^0 in the second one.

It's quite easy to check if P(x) is of the form a+b*R and to reverse the output of coeffs. But does it exist an option of coeffs which monitors the output order.

TIA

guys..i need help ...how to find the answer for this equation..for all value of in and b in (a and b)...for all combination of a and b

problem.mw

Hi,

I don't understand why my ruled surface is not displayed with this code in my animation. Maybe there is an issue with an option? All my previous animations were displayed normally. Any ideas? Thank you

G2ExamenJuin.mw

According to this help page

the transitive reduction of graph G, is the graph with the fewest edges that still shares the same reachability as G (but might contain new edges not present in G). 

However, in Maple 2023, things become strange; different branches return distinct numbers of edges: 
(33 arcs or 40 arcs?)

restart;

with(GraphTheory):

showstat(TransitiveReduction, 4)


GraphTheory:-TransitiveReduction := proc(G::GRAPHLN, $)
local D, V, T, i, j, k, A, M, n, flags, B;
       ...
   4   if _EnvDisableExt <> true then
           ...
       elif D <> (':-directed') then
           ...
       else
           ...
       end if;
       ...
end proc
 

 

G__0 := Digraph({[2, 8], [3, 1], [4, 9], [5, 10], [6, 19], [7, 12], [8, 13], [9, 3], [10, 4], [10, 14], [11, 5], [11, 15], [12, 6], [12, 16], [13, 7], [13, 17], [14, 9], [15, 10], [15, 18], [16, 19], [17, 12], [17, 20], [18, 14], [19, 11], [19, 21], [20, 22], [21, 18], [22, 16], [22, 23], [23, 19]})

G__0 := `Graph 1: a directed graph with 23 vertices and 30 arc(s)`

(1)

G__1 := TransitiveReduction(G__0)

G__1 := `Graph 2: a directed graph with 23 vertices and 33 arc(s)`

(2)

_EnvDisableExt := trueG__2 := TransitiveReduction(G__0)

G__2 := `Graph 3: a directed graph with 23 vertices and 40 arc(s)`

(3)

IsIsomorphic(G__1, G__2)

false

(4)

 


 

Download TransReduction.mw

Any bugs? 

G__0 := GraphTheory:-Digraph({[3, 1], [9, 3], [4, 9], [14, 9], [10, 4], [5, 10], [15, 10], [11, 5], [19, 11], [12, 6], [7, 12], [17, 12], [13, 7], [8, 13], [2, 8], [10, 14], [18, 14], [11, 15], [6, 19], [16, 19], [23, 19], [13, 17], [15, 18], [21, 18], [12, 16], [22, 16], [22, 23], [20, 22], [19, 21], [17, 20]}):

How to find the similarity matrix that applies A in N, B in P, C in C and B in M;
 

restart;  
with(geometry):  
with(plots):  
_EnvHorizontalName = 'x':  _EnvVerticalName = 'y':
#Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc
;

with(LinearAlgebra):
point(A, 0, 1);
point(B, 1, 1);
point(C, 1, 0);
point(E, 0, 0);
square(Sq, [A, B, C, E]);
Phi := (1 + sqrt(5))/2;
point(N, (2 - Phi)/(Phi - 1), 1);
line(BE, [B, E]);
MakeSquare(s1, [N, C, 'diagonal']);
point(M, (3 - sqrt(5))/(2*sqrt(5) - 2), (3 - sqrt(5))/(2*sqrt(5) - 2));
point(P, (1 + sqrt(5))/(2*sqrt(5) - 2), (3*sqrt(5) - 5)/(2*sqrt(5) - 2));
                               A

                               B

                               C

                               E

                               Sq

                             1   1  (1/2)
                      Phi := - + - 5     
                             2   2       

                               N

                               BE

                               s1

                               M

                               P

 display(draw([
A(color = black, symbol = solidcircle, symbolsize = 12),   
B(color = black, symbol = solidcircle, symbolsize = 12),   
C(color = black, symbol = solidcircle, symbolsize = 12),    
E(color = black, symbol = solidcircle, symbolsize = 12), 
N(color = black, symbol = solidcircle, symbolsize = 12 ),  
Sq(color=red),BE(color=green),  
s1(color = blue)]),   
textplot([[coordinates(A)[], "A"],   
[coordinates(B)[], "B"], 
[coordinates(E)[], "E"], 
[coordinates(N)[], "N"],
[coordinates(P)[], "P"],
[coordinates(M)[], "M"],   
[coordinates(C)[], "C"]], align = [above, right]), axes = none); Thank you.

For example, I'd like to do something like this (and then plot the graph): 

 # display LaTeX markup
label__1 := '"\[\cfrac{\biguplus_\LaTeX}{{\color{red}\leadsto}^\unicode{2254}}\]"':
 # display non-executable notation
label__2 := '(Product(Int(i, j), Sum(k, l)) %assuming convert(log2(1 - 'x'), confrac, subdiagonal))':
 # display graphical object
label__3 := 'plots:-display(plottools:-stellate(plottools:-icosahedron()))':
 # note that the desired one is  instead of 
GraphTheory:-RelabelVertices(`some graph with 3 nodes`, [label__1, label__2, label__3]):

But unfortunately, the second argument of GraphTheory:-RelabelVertices must be of type list({indexed, integer, string, symbol}), and the GraphTheory:-SetVertexAttribute command doesn't work here. Is it possible to do so in Maple® (rather than in other mathematical softwares)?

 

min_problem.mw

Hi everyone 

I am trying to solve the following problem. I want to evaluate the time when the function Sx(t) drops (the last vertical drop at about 0.45 sec) 

The minimize command doesnt work because the function slightly deacreases afterwards but I am interested in the drop. For a miniization (evaluate the relevant time). I do it as follows:

Does anyone have an idea how to evaluete the time of drop? Is there an other command than minimize to solve this? 

Thanks in advance!

I can derive a symbolic solution by hand for the following ODE, but cannot get Maple to do it for me.  Any tricks?

restart;

Velocity field, -infinity < x and x < infinity,  t > 0.

v := (x,t) -> piecewise(x <= -t, 0, x < t, 1 - 1/2*(1 - x/t));

v := proc (x, t) options operator, arrow; piecewise(x <= -t, 0, x < t, 1/2+(1/2)*x/t) end proc

Position x(t):

de := diff(x(t),t) = v(x(t),t);

de := diff(x(t), t) = piecewise(x(t) <= -t, 0, x(t) < t, 1/2+x(t)/(2*t))

Initial condition, assuming a > 0

ic := x(0) = -a;

x(0) = -a

Symbolic solution, calculated by hand:

x__exact := t -> piecewise(t < a, -a, t - 2*sqrt(t)*sqrt(a));

x__exact := proc (t) options operator, arrow; piecewise(t < a, -a, t-2*sqrt(t)*sqrt(a)) end proc

Verify exact solution by comparing it against the numeric solution for some a > 0:

a := 3;  # any a>0 should do
dsol := dsolve({de,ic}, numeric):
plots:-odeplot(dsol, t=0..5);   # dsolve solution
plot(x__exact(t), t=0..5);      # symbolic solution (calculated by hand)
a := 'a';

3

a

Can Maple's dsolve find the exact solution?  This one returns empty in Maple 2022:

dsolve({de, ic}) assuming a > 0, t > 0;

Download ode-piecewise.mw

 

I need your help....

Is it correct that element wise operators just work on the first element, and not in nested elements?

Do I need to manually go through the nested lists, or are there any other tricks to simplify this operation?

fasteners := [Vector(2, {(1) = -25.0*Units:-Unit(mm), (2) = 0.}), Vector(2, {(1) = 25.0*Units:-Unit(mm), (2) = 0.})]

[Vector[column](%id = 36893490765018711092), Vector[column](%id = 36893490765018711212)]

(1)

`~`[convert](fasteners, unit_free)

[Vector[column](%id = 36893490764941411500), Vector[column](%id = 36893490764941411620)]

(2)

x := Vector(2, {(1) = -25.0*Units:-Unit(mm), (2) = 0.})

Vector[column](%id = 36893490765009212828)

(3)

`~`[convert](x, unit_free)

Vector[column](%id = 36893490764944766844)

(4)

NULL

Download elementwise.mw

I want to use the maple 2023 kernel in jupyter lab. I followed, to knowledge, the maple installation in windows10 and could not get it to work
after numerous attempts. Maybe it is a path issue that I am getting wrong.
I decided to use it with EndeavourOS distro for Linux as Sagemath interest me. Here it recognizes the kernel but gives syntax errors when
running code; it does not understand ‘:-’ for example. 
Again I used maple suggested installation to no avail.
I used the alternative following comands and it recognizes Maple2023 in the kernels menu but to repeat does not run code, simply gives errors.
sudo pacman -S python-jupyterlab
python -m venv maple2023
source maple2023/bin/activate
pip install jupyter ipykernel
python -m ipykernel install --user --name=maple2023
jupyter kernelspec list
 

The result of is said to be the Catalan constant, but unfortunately, Maple® only returns a lengthy output, so I have to apply the simplify command to get a shorter (and equivalent) form of it. However, I find that these do not work here: 

restart;

expr__1 := expand(value(student[Doubleint](sec(x+y)*sec(x-y)/(sec(x)*sec(y)), x = 0 .. (1/4)*Pi, y = 0 .. (1/4)*Pi)))

MmaTranslator:-Mma:-Chop(evalf(expr__1-Catalan))

((1/2)*I)*dilog(1-(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))+((1/2)*I)*dilog(1-(1/2)*2^(1/2)-((1/2)*I)*2^(1/2))-((1/2)*I)*dilog(1+(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))-((1/2)*I)*dilog(1+(1/2)*2^(1/2)-((1/2)*I)*2^(1/2))-((1/8)*I)*Pi^2+Catalan

 

0

(1)

simplify(expr__1, size = false)-Catalan; Physics:-Simplify(expr__1)-Catalan; simplify(expr__1-Catalan, size = false); Physics:-Simplify(expr__1-Catalan); verify(expr__1, Catalan, equal); is(expr__1 = Catalan); verify(expr__1-Catalan, 0, equal); is(expr__1-Catalan, 0)

((1/2)*I)*dilog(1-(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))+((1/2)*I)*dilog(1-(1/2)*2^(1/2)-((1/2)*I)*2^(1/2))-((1/2)*I)*dilog(1+(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))-((1/2)*I)*dilog(1+(1/2)*2^(1/2)-((1/2)*I)*2^(1/2))-((1/8)*I)*Pi^2

 

((1/2)*I)*dilog(1-(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))+((1/2)*I)*dilog(1-(1/2)*2^(1/2)-((1/2)*I)*2^(1/2))-((1/2)*I)*dilog(1+(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))-((1/2)*I)*dilog(1+(1/2)*2^(1/2)-((1/2)*I)*2^(1/2))-((1/8)*I)*Pi^2

 

((1/8)*I)*(-Pi^2+4*dilog(1-(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))+4*dilog(1-(1/2)*2^(1/2)-((1/2)*I)*2^(1/2))-4*dilog(1+(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))-4*dilog(1+(1/2)*2^(1/2)-((1/2)*I)*2^(1/2)))

 

((1/8)*I)*(-Pi^2+4*dilog(1-(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))+4*dilog(1-(1/2)*2^(1/2)-((1/2)*I)*2^(1/2))-4*dilog(1+(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))-4*dilog(1+(1/2)*2^(1/2)-((1/2)*I)*2^(1/2)))

 

FAIL

 

FAIL

 

FAIL

 

FAIL

(2)

expr__2 := expand(convert(expr__1, polylog, simplifier = NONE))

((1/2)*I)*polylog(2, (1/2)*2^(1/2)-((1/2)*I)*2^(1/2))+((1/2)*I)*polylog(2, (1/2)*2^(1/2)+((1/2)*I)*2^(1/2))-((1/2)*I)*polylog(2, -((1/2)*I)*2^(1/2)-(1/2)*2^(1/2))-((1/2)*I)*polylog(2, -(1/2)*2^(1/2)+((1/2)*I)*2^(1/2))-((1/8)*I)*Pi^2+Catalan

(3)

simplify(expr__2, size = false)-Catalan; Physics:-Simplify(expr__2)-Catalan; simplify(expr__2-Catalan, size = false); Physics:-Simplify(expr__2-Catalan); verify(expr__2, Catalan, equal); is(expr__2 = Catalan); verify(expr__2-Catalan, 0, equal); is(expr__2-Catalan, 0)

0

 

((1/2)*I)*polylog(2, (1/2-(1/2)*I)*2^(1/2))+((1/2)*I)*polylog(2, (1/2+(1/2)*I)*2^(1/2))-((1/2)*I)*polylog(2, (-1/2-(1/2)*I)*2^(1/2))-((1/2)*I)*polylog(2, (-1/2+(1/2)*I)*2^(1/2))-((1/8)*I)*Pi^2

 

0

 

-((1/8)*I)*(Pi^2+4*polylog(2, (-1/2+(1/2)*I)*2^(1/2))+4*polylog(2, (-1/2-(1/2)*I)*2^(1/2))-4*polylog(2, (1/2+(1/2)*I)*2^(1/2))-4*polylog(2, (1/2-(1/2)*I)*2^(1/2)))

 

true

 

true

 

true

 

true

(4)

NULL

Download Unable_to_simplify_expressions_containing_dilog.mw

(By the way, Mathematica's Integrate cannot compute this double integral explicitly.)

Hi,

I am struggling with a task of creating a 2D contourplot of temperature values showing Iso-Lines (lines of equal temperatures in steps of 100°C).

I have a set of temperature values with corresponding x and y coordinates of a cross section. The data is given as an unsorted set of X-Y-Temperature data:

[[177.80000,0.,967.3266667],[169.80000,0.,963.5900000],[100.00000,0.,188.8933333],[176.92000,17.703000,967.3266667],[174.27000,35.230000,967.3200000],[169.90000,52.407000,967.3566667],[163.84000,69.064000,967.3366667],[156.15000,85.034000,967.3100000],[146.91000,100.16000,967.3366667],[136.20000,114.29000,967.3666667],...]

I can plot the data as a 3D pointplot and assign colors based on the temperature value:

plots:-pointplot3d(<ThermRes(2 .. (), 2) | ThermRes(2 .. (), 3) | ThermRes(2 .. (), TimeCol)>, colorscheme = ["zgradient", ["blue", "green", "yellow", "orange", "red"]], style = point, symbol = solidsphere, symbolsize = 20)

For better visualization, I would like to plot this data in a 2D contourplot showing coloured Iso-lines in 100°C steps, similar to the following scheme:

I know this is not directly possible from xyz datapoints. Therefore, I was trying to create an interpolation function using the Interpolation package. I have tried to find out if it is possible to get a working interpolation function for my data, but it seems like the x and y coordinates must be always in increasing order and there has to be a z value (temperature data point) for each pair of coordinates in matrix form, is that correct? Unfortunately, as you can see above, my x-y coordinate pairs are irregular and unsorted and I do not have a temperature value for every combination of x and y coordinate values.

Is there any way how to find an interpolation function for this kind of data that would enable a contourplot? Or any other ideas how to create a coloured 2D plot from this data with a legend showing the 100°C temperature color values?

Greetings, Oliver

First 209 210 211 212 213 214 215 Last Page 211 of 2218