Maple 2023 Questions and Posts

These are Posts and Questions associated with the product, Maple 2023

DrawGraph(Graph({[{1, 2}, 0.7462761011], [{2, 3}, 0.8190708767], [{2, 4}, 0.6810933318], [{4, 5}, 0.7451261104], [{4, 23}, 0.6746390886], [{5, 6}, 0.7231256359], [{6, 7}, 0.6775594149], [{6, 10}, 0.7019893588], [{7, 8}, 0.6618796622], [{7, 9}, 0.6623496808], [{8, 9}, 0.6688297164], [{10, 11}, 0.7092623872], [{10, 22}, 0.7112560850], [{11, 12}, 0.7098970677], [{12, 13}, 0.7108845941], [{12, 19}, 0.7092202631], [{13, 14}, 0.6734297238], [{13, 18}, 0.6767541419], [{14, 15}, 0.6466191140], [{15, 16}, 0.6773709292], [{16, 17}, 0.6780410682], [{17, 18}, 0.6468993314], [{19, 20}, 0.7444847640], [{19, 21}, 0.7192676187], [{21, 22}, 0.7167453581], [{22, 23}, 0.6726943362], [{23, 24}, 0.8156746068]}), layout = spring)

DrawGraph and save that as 300 dpi png increase edge length so that the edge weight show up How do the edge are small sized and weights overlap and and are not neatly seen in the middle of edge without overlap kind help with a code to correct this

I am interested in determining the density function which results from multiplying two random variables.  I have read about the Mellin Transformation, but I just end up confused.  I have two random variables:  f[1], which is nonzero on the 0 < t < 2 interval, and f[2], which is nonzero on the 0 < t < 1 interval.  Of course, both of these random variables sum to one when evaluated.

Any thoughts on how I can obtain the density function for this?  My work is below.

restart

with(Statistics)

f[1] := piecewise(t <= 0, 0, 0 < t and t < 2, 1/(Pi*sqrt(1-(1-t)^2)), t >= 2, 0)

piecewise(t <= 0, 0, 0 < t and t < 2, 1/(Pi*(1-(1-t)^2)^(1/2)), 2 <= t, 0)

f[2] := piecewise(t <= 0, 0, 0 < t and t < 1, 2*t, t >= 1, 0)

piecewise(t <= 0, 0, 0 < t and t < 1, 2*t, 1 <= t, 0)


Download Inquiry.mw

Hello everyone,
Could someone tell me how to insert an entry (empty cell) between two already filled entries or above an already filled entry in Document Mode?

Oliveira

I am learning how to use Maple for solving single and systems of linear PDE's using the Laplace transform (LT)method so the resulting solution in s space can be used to generate the moments of the resulting probability distribution.

When I take the LT of a term such as Uxx(t,x), I expect a second order ordinary derivative. Instead, it shows the Laplace transform operator.

Here is a simple test code  

with(inttrans):

with(DEtools):

rhs_pde := diff(u(x, t), x, x);

laplace_rhs_pde := laplace(rhs_pde, t, s);

I constructed a density function, and I am certain it shows me what I want.  The problem I am having is parsing the Elliptic functions. Is there a way to "get rid" of the ones I don't want or need.

I generated a plot of the function -- the plot tells me what I expected based on simulation. I need to know if there is a way to express the density function (y) as a function of t and without the elliptic functions..  Even a numerical solution would be fine.

I assume the denomenator term is correct. I also assume that I don't need complex values. My input file is below.

Basics.mw

I have a piecewise density function (f).  I am trying to find the median value.

I have tried the Median function and the Percentile function, but neither work for me.  I am not sure why.

I have also tried to integrate the density function on the (0,x) interval such that the area under the curve is 1/2 and then solve for x.  This works for simple problems, but not the one attached.

There is something very simple that I'm not doing, but I am not sure what.

restart

kernelopts(version)

`Maple 2023.2, X86 64 WINDOWS, Nov 24 2023, Build ID 1762575`

(1)

with(Statistics)

 

(2)

f := 2*t*piecewise(t <= 0, 0, t <= 1, t^2+Pi-4*t, t <= sqrt(2), -(sqrt(t^2-1)*t^2+2*sqrt(t^2-1)*arcsin((t^2-2)/t^2)-4*t^2+2*sqrt(t^2-1)+4)/sqrt(t^2-1), sqrt(2) < t, 0)

2*t*piecewise(t <= 0, 0, t <= 1, t^2+Pi-4*t, t <= 2^(1/2), -((t^2-1)^(1/2)*t^2+2*(t^2-1)^(1/2)*arcsin((t^2-2)/t^2)-4*t^2+2*(t^2-1)^(1/2)+4)/(t^2-1)^(1/2), 2^(1/2) < t, 0)

(3)

plot(f, t = 0 .. sqrt(2))

 

Median(f)

2*t*piecewise(t <= 0, 0, t <= 1, t^2+Pi-4*t, t <= 2^(1/2), -((t^2-1)^(1/2)*t^2+2*(t^2-1)^(1/2)*arcsin((t^2-2)/t^2)-4*t^2+2*(t^2-1)^(1/2)+4)/(t^2-1)^(1/2), 2^(1/2) < t, 0)

(4)

Percentile(f, 50)

2*t*piecewise(t <= 0, 0, t <= 1, t^2+Pi-4*t, t <= 2^(1/2), -((t^2-1)^(1/2)*t^2+2*(t^2-1)^(1/2)*arcsin((t^2-2)/t^2)-4*t^2+2*(t^2-1)^(1/2)+4)/(t^2-1)^(1/2), 2^(1/2) < t, 0)

(5)

myMedian := solve(int(f, t = 0 .. x) = 1/2, x)

Warning, solutions may have been lost

 

(6)

NULL

Download Median.mw

I am trying to find the standard deviation for a piecewise density function (f).  The interval is (0, sqrt(3))  I am convinced the density function is what I want.  I calculate the expected value of the density function (evE) and the answer is correct -- about 0.66145

When I try to calculate the standard deviation (stdE), I get an answer that is "off" by a large degree.  Via simulating values, I should get a value of about 0.24936.  Each time I "re-run" the calculation, I get varying results, all of which are "off" by a large degree.

I am only guessing, but my integration function might be missing some sort of assumption and/or option.

My work is attached.  Does anyone know what I am doing wrong?

restart

with(Statistics)

f := -t*piecewise(t <= 0, 0, t <= 1, t*(t^3+6*Pi*t-8*t^2-4*Pi), t <= sqrt(2), -(2*(4*t^2*sqrt(t^2-1)*arcsin((t^2-2)/t^2)+4*t^2*arctan(sqrt(t^2-1))*sqrt(t^2-1)+(t^4+(2*Pi+3)*t^2-4*t*Pi+3*Pi-1/2)*sqrt(t^2-1)-8*t^4+4*t^2+4))/sqrt(t^2-1), t <= sqrt(3), (8*arctan((t^3+t^2-3*t-1)/(sqrt(t^2-2)*(t^3-t^2-t-1)))*t*sqrt(t^2-2)-4*arccot((t^2-t-1)/sqrt(t^2-2))*t^2*sqrt(t^2-2)+4*t*sqrt(t^2-2)*(t+2)*arctan((t^2+t-1)/sqrt(t^2-2))+(8*t^2-4)*sqrt(t^2-2)*arcsin((t^2-3)/(t^2-1))+16*arcsin(sqrt(t^2-2)/sqrt(t^2-1))*sqrt(t^2-2)-16*arcsin(1/sqrt(t^2-1))*sqrt(t^2-2)+((t^2+5)*sqrt(t^2-2)-8*t^2+16)*(t^2+1))/sqrt(t^2-2), sqrt(3) < t, 0)

-t*piecewise(t <= 0, 0, t <= 1, t*(t^3+6*Pi*t-8*t^2-4*Pi), t <= 2^(1/2), -2*(4*t^2*(t^2-1)^(1/2)*arcsin((t^2-2)/t^2)+4*t^2*arctan((t^2-1)^(1/2))*(t^2-1)^(1/2)+(t^4+(2*Pi+3)*t^2-4*t*Pi+3*Pi-1/2)*(t^2-1)^(1/2)-8*t^4+4*t^2+4)/(t^2-1)^(1/2), t <= 3^(1/2), (8*arctan((t^3+t^2-3*t-1)/((t^2-2)^(1/2)*(t^3-t^2-t-1)))*t*(t^2-2)^(1/2)-4*arccot((t^2-t-1)/(t^2-2)^(1/2))*t^2*(t^2-2)^(1/2)+4*t*(t^2-2)^(1/2)*(t+2)*arctan((t^2+t-1)/(t^2-2)^(1/2))+(8*t^2-4)*(t^2-2)^(1/2)*arcsin((t^2-3)/(t^2-1))+16*arcsin((t^2-2)^(1/2)/(t^2-1)^(1/2))*(t^2-2)^(1/2)-16*arcsin(1/(t^2-1)^(1/2))*(t^2-2)^(1/2)+((t^2+5)*(t^2-2)^(1/2)-8*t^2+16)*(t^2+1))/(t^2-2)^(1/2), 3^(1/2) < t, 0)

(1)

plot(f, t = 0 .. sqrt(3))

 

evE := simplify(int(t*f, t = 0 .. sqrt(3)))

(1/105)*(294*(2^(1/2)-3/2)*(-2+3^(1/2))*ln(1+2^(1/2))+168*(2^(1/2)-3/2)*(-2+3^(1/2))*ln(1+3^(1/2))-252*(2^(1/2)-3/2)*(-2+3^(1/2))*arccoth(2^(1/2))+((-14*Pi-84*ln(2)-19)*3^(1/2)+28*Pi+168*ln(2)+50)*2^(1/2)+(21*Pi+126*ln(2)+20)*3^(1/2)-42*Pi-252*ln(2)-58)/((2*2^(1/2)-3)*(-2+3^(1/2)))

(2)

evalf(evE)

.6617071838

(3)

stdE := simplify(sqrt(int(f*(t-evE)^2, t = 0 .. sqrt(3))))

(1/210)*(-4808607312140100*(2^(1/2)-3880899/2744210)*(3^(1/2)-70226/40545)*ln(1+2^(1/2))^2+(-5495551213874400*(2^(1/2)-3880899/2744210)*(3^(1/2)-70226/40545)*ln(1+3^(1/2))+8243326820811600*(2^(1/2)-3880899/2744210)*(3^(1/2)-70226/40545)*arccoth(2^(1/2))+((457962601156200*Pi+2747775606937200*ln(2)+631290043332900)*3^(1/2)-793214493249360*Pi-4759286959496160*ln(2)-1093426429714584)*2^(1/2)+(-647656921614780*Pi-3885941529688680*ln(2)-892778941072368)*3^(1/2)+1121774694224184*Pi+6730648165345104*ln(2)+1546338486359352)*ln(1+2^(1/2))-1570157489678400*(2^(1/2)-3880899/2744210)*(3^(1/2)-70226/40545)*ln(1+3^(1/2))^2+(4710472469035200*(2^(1/2)-3880899/2744210)*(3^(1/2)-70226/40545)*arccoth(2^(1/2))+((261692914946400*Pi+1570157489678400*ln(2)+360737167618800)*3^(1/2)-453265424713920*Pi-2719592548283520*ln(2)-624815102694048)*2^(1/2)+(-370089669494160*Pi-2220538016964960*ln(2)-510159394898496)*3^(1/2)+641014110985248*Pi+3846084665911488*ln(2)+883621992205344)*ln(1+3^(1/2))-3532854351776400*(2^(1/2)-3880899/2744210)*(3^(1/2)-70226/40545)*arccoth(2^(1/2))^2+(((-392539372419600*Pi-2355236234517600*ln(2)-541105751428200)*3^(1/2)+679898137070880*Pi+4079388822425280*ln(2)+937222654041072)*2^(1/2)+(555134504241240*Pi+3330807025447440*ln(2)+765239092347744)*3^(1/2)-961521166477872*Pi-5769126998867232*ln(2)-1325432988308016)*arccoth(2^(1/2))+((-392539372419600*ln(2)^2+(-130846457473200*Pi-180368583809400)*ln(2)-10903871456100*Pi^2-30061430634900*Pi+1205966071986042)*3^(1/2)+679898137070880*ln(2)^2+(226632712356960*Pi+312407551347024)*ln(2)+18886059363080*Pi^2+52067925224504*Pi-2088794509063308)*2^(1/2)+(555134504241240*ln(2)^2+(185044834747080*Pi+255079697449248)*ln(2)+15420402895590*Pi^2+42513282908208*Pi-1705493574764511)*3^(1/2)-961521166477872*ln(2)^2+(-320507055492624*Pi-441810996102672)*ln(2)-26708921291052*Pi^2-73635166017112*Pi+2954001523727854)^(1/2)*(5*2^(1/2)-7)*(-5+3*3^(1/2))/((70*2^(1/2)-99)*(15*3^(1/2)-26)*(-2+3^(1/2))*(4*3^(1/2)-7)*(12*2^(1/2)-17)*(2*2^(1/2)-3))

(4)

evalf(stdE)

7031348.295

(5)
 

NULL

Download StdE.mw

hello:

Problem Background
   I am using Maple to perform a symbolic derivation for analyzing a coupled stripline directional coupler (as illustrated in the figure) The objective is to start from the known 4-port admittance matrix Y4 of a single coupled-line section(figure (a)) and derive the resulting 4-port admittance matrix Y_T for the composite structure shown in figure (b).

Diagram Explanation (Refer to Attached Figure)

  • Figure (a) represents a standard 4-port coupled-line segment, with admittance matrix Y4. The port ordering is labeled in green as (1,2,3,4).

  • Figure (b) shows a composite network constructed by combining two identical Y4 structures, where:

    • The right block are renumbered as red labels (5–8), which differ from the default Y4 port ordering.

      • The middle section includes two shorted node pairs that merge the internal connections:

        • Ports 2 and 6 are connected to form internal node A. so we get equtions:I2=-I6,V2=V6

        • Ports 4 and 8 are connected to form internal node B.so we get equtions:I4=-I8,V4=V8

Using a matrix-based linear algebra approach, I aim to compute the effective 4-port admittance matrix Y_T for the final structure shown in Figure (b), with the active ports being 1, 3, 5, and 7.

The even-mode and odd-mode responses are expressed symbolically. From these, the basic admittance elements are defined:

  • Y0, Ym1, Ym2, Ym3 using Yoe, Yoo, and θ.

Construct the 4×4 admittance matrix Y4 for the left-side coupled-line segment, using port ordering (1,2,3,4) as shown in Figure (a).

The Secondary (right-side) coupled-line block uses a different port order (Ports 5–6–7–8 correspond to the original 2–1–4–3).
Therefore, a permutation matrix P is introduced to reorder the ports as:

(1,2,3,4) → (2,1,4,3)
The reordered admittance matrix Y4_R is obtained via:

Y4_R := P . Y4 . Transpose(P)

Using BlockDiagonalMatrix or equivalent logic, we assemble the composite 8×8 admittance matrix Y8, representing:

[1 2 3 4 | 5 6 7 8]
The left half corresponds to Y4, and the right half to Y4_R.

According to the physical configuration:

  • Ports 2 and 6 are shorted to form Node A

  • Ports 4 and 8 are shorted to form Node B

We define a node-merging matrix S (6×8) to map the 8-port structure into a reduced 6-port structure using:

[1, 3, 7, 5, A(=2+6), B(=4+8)]
Apply the transformation:

Y6 := S . Y8 . Transpose(S)

From the reduced matrix Y6, extract:

  • External port indices: E = [1, 2, 3, 4] → Ports 1, 3, 7, 5

  • Internal node indices: I = [5, 6] → Nodes A, B

Perform Kron reduction to eliminate internal nodes and obtain the final reduced matrix:

Y_T := Y_EE - Y_EI . Inverse(Y_II) . Y_IE

When I try to execute:

Y8 := BlockDiagonalMatrix([Y4, Y4_R])
Maple does not return a usable or well-formed 8×8 matrix

 

  1. How to correctly construct the block-diagonal matrix Y8 := BlockDiagonalMatrix([Y4, Y4_R]) so that it's recognized as an 8×8 matrix in Maple?

  2. Validate whether the full logic flow from Y4 → port mapping → block matrix → merging → Kron reduction is mathematically sound and correctly implemented, and get the final 4 port Y parameter matrix.

  3. If possible, please suggest any more stable or simplified alternative matrix operations for symbolic Kron reduction involving port reordering and node merging.

here is the maple file:

Download CoupleLine_WH2.mw

thank in advance for your help.

I have a problem calculating integral analytically.

Can anyone help me in this regard?

Thanks

problem_2_integral_&_moshtagh.mw

Dear Maple experts,

is there a possibility/command to get a vizualization of the output of the command FeedbackConnect?

I was thinking of something like this:


as it is given on the maple-help page for that command (but not generated via a maple command as far as I understood)

Thanks in advance !

Dear Maple experts,

I try to avoid the generation of new variable names (for states, inputs, outputs) introduced automatically by maple (StateSpace(), FeedbackConnect()) in the two (connected) cases:

1)

I generated a discrete StateSpace system using a difference equation:

sys2 := StateSpace([u(n)=K_virt*(q_a(n)-q_d)+D_virt*(q_a(n)-q_a(n-1))/T],inputvariable=[q_a(n)],outputvariable=[u(n)],discrete=true,sampletime=T);

The statevariable "x1(n)" is automatically generated by maple

I tried to avoid this by using the following commands that don't work:

sys2 := StateSpace([u(n)=K_virt*(q_a(n)-q_d)+D_virt*(q_a(n)-q_a(n-1))/T],inputvariable=[q_a(n)],outputvariable=[u(n)],statevariable=[q_a(n-1)],discrete=true,sampletime=T);

-> error message:

Error, (in ProcessOptions) argument 'statevariable = [q_a(n-1)]' invalid: rhs should be of type list({name, anyfunc(name)})

sys2 := StateSpace([u(n)=K_virt*(q_a(n)-q_d)+D_virt*(q_a(n)-q_a(n-1))/T],inputvariable=[q_a(n)],outputvariable=[u(n)],statevariable=[q_a_delayed],discrete=true,sampletime=T);

-> error message:

Error, (in DynamicSystems:-StateSpace) missing state(s): {q_a_delayed(n)}

sys2 := StateSpace([u(n)=K_virt*(q_a(n)-q_d)+D_virt*(q_a(n)-q_a(n-1))/T],inputvariable=[q_a(n)],outputvariable=[u(n)],statevariable=[q_a_delayed(n)],discrete=true,sampletime=T);

-> error message:

Error, (in DynamicSystems:-StateSpace) missing state(s): {q_a_delayed(n)}

Can you help me here?

2)

I have two discrete StateSpace models (sys1, sys2):

* sys2 is the one from above (1 input, 1 output, 1 state)

* sys1 (2 inputs, 4 outputs, 4 states) doesn't contain any automatically generated variables (I obtained this one by transforming a continuous statespace model to a discrete one)

* variables that represent the same signal have the same name in both systems.

   -> "q_a(n)" appears as an output in sys1 and as an input in in sys2

   -> "u(n)"     appears as an input in sys1 and as an output in in sys2

Now I combined these two models via:

FeedbackConnect([sys1, sys2],[[2,2,1,-1]])

Instead of using the variable names I introduced maple generates new variable names for inputs, outputs and states.

How can I avoid this?

(the option "merge=evaluate") seems not to work (even if I work with numeric values for the system parameters instead of symbols)

Thank you in advance!

I ran the Fourier Transform about 6 months ago.

>

>

The out put was 23 lines long, and then used the Simplify/Simplify option for the result to obtain

, a relatively easier result.

I tried to re-run it today but it just gave me

with the result

Do you have any idea as to why this happens?? I seem to recall there may be similar “memory” problem

that occurred in the past.

 

Hello,

I tried to apply Berlekamp's theory to the polynomial X^9+X^6-X+1 in F3.
The matrix of the linear application whose kernel dimension is sought is:

 The dimension should be equal to 2 according to the theory since this polynomial decomposes into 2 irreducible polynomials.
However, the nullspace instruction of maple does not give a result consistent with the theory. Please help me find what is happening.

 

Hello
Can you tell me how to use rank and nullspace instructions in linear algebra with maple 2023.
Here is a preview of my work that produces nothing?
Thanks

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