MaplePrimes Questions

NULL

Programm zur Brechnung der Kreisteilungspolynome_2022-04-05 Ki

 

NULL

restart; with(Algebraic); with(NumberTheory)

n := 6

6

(1)

 

cyclo_poly := Vector[row](1 .. n, 0)

Vector[row](%id = 36893489967244295332)

(2)

i := 1; cyclo_poly[1] := X-1

1

 

X-1

(3)

NULL
c_poly := proc (i, kt_poly) local j, hz1, hz2, X; j := i+1; hz1 := X^j-1; hz2 := kt_poly; kt_poly := Quotient(hz1, hz2, X) end proc

cyclo_poly[2] := c_poly(i, cyclo_poly[i])

Error, (in c_poly) illegal use of a formal parameter

 

i := 1; kt_poly := X-1

1

 

X-1

(4)

j := i+1; hz1 := X^j-1; hz2 := kt_poly; kt_poly := Quotient(hz1, hz2, X)

2

 

X^2-1

 

X-1

 

X+1

(5)

NULL

Download Programm_zur_Brechnung_der_Kreisteilungspolynome_2022-04-05_Ki.mw

Good morning

Why doesn't Quotient(x,y,z) not work within a procedure whereas it works well standing alone? See example.

Greetings  Heinz

Dear all,

I'm using Maple to calculate the geodesics of the Poincare' Half Plane:

restart:
with(LinearAlgebra): with(DifferentialGeometry): with(Tensor): with(Tools): with(plots): 
DGsetup([x,y],M1)
g1 := evalDG(1/y^2*(dx &t dx+dy &t dy))
R1 := CurvatureTensor(g1)
K := SectionalCurvature(g1,R1,D_x,D_y)
Gamma := Christoffel(g1)
C := [x(t), y(t)]
V := GeodesicEquations(C, Gamma, t)
DE := Tools:-DGinfo(V, "CoefficientSet")

simplify(dsolve(DE, explicit))

I receive this error message

Error, (in simplify/siderels:-simplify/siderels) specified variables must be names or functions

How can I fix this error?

Thanks, Nicola

Please, how do I find the minimum of the real part of a complex function? I tried min ( ) function it didn't work. 

Find attached the fileFinding_min_zero.mw
 

Import packages

 

restart: with(ArrayTools): with(Student:-Calculus1): with(LinearAlgebra): with(ListTools):with(RootFinding):with(ListTools):

Parameters

 

gamma1 := .1093:
alpha3 := -0.1104e-2:
k[1] := 6*10^(-12):
d:= 0.2e-3:
xi:= -0.01:
theta0:= 0.1e-3:
eta[1]:= 0.240e-1:
alpha:= 1-alpha3^2/(gamma1*eta[1]):
c:= alpha3*xi*alpha/(eta[1]*(4*k[1]*q^2/d^2-alpha3*xi/eta[1])):
theta_init:= theta0*sin(Pi*z/d):
n:= 10:

``

``

Assign g for q and plot g

 

g := q-(1-alpha)*tan(q)-c*tan(q):
plot(g, q = 0 .. 3*Pi, view = [DEFAULT, -30.. 10]);

 

Set q as a complex

 

Assume q = x+I*y and subsitute the result into g and equate the real and complex part to zero, and solve for x and y.

f := subs(q = x+I*y, g):
b1 := evalc(Re(f)) = 0:
b2 := evalc(Im(f)) = 0:

Compute the Special Asymptotes

 

This asymptote is coming from the c from the definition of "q."

``

qstar := (fsolve(1/c = 0, q = 0 .. infinity)):NULLNULL``

``

``

Compute Odd asymptote

 

First, Since tan*q = sin*q*(1/(cos*q)), then an asymptote occurs at cos*q = 0. In general, we have
"q= ((2 k+1)Pi)/(2). "
Next, we compute the entry of the Oddasymptotes that is close to qstar (special asymptote) as assign it to
ModifiedOaddAsym, and then find the minimum of the ModifiedOaddAsym. Searchall Function returns

the index of an entry in a list.

OddAsymptotes := Vector[row]([seq(evalf((1/2*(2*j+1))*Pi), j = 0 .. n)]);
ModifiedOddAsym := abs(`~`[`-`](OddAsymptotes, qstar));
qstarTemporary := min(ModifiedOddAsym);
indexOfqstar2 := SearchAll(qstarTemporary, ModifiedOddAsym);
qstar2 := OddAsymptotes(indexOfqstar2);

OddAsymptotes := Vector(4, {(1) = ` 1 .. 11 `*Vector[row], (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

 

ModifiedOddAsym := Vector(4, {(1) = ` 1 .. 11 `*Vector[row], (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

 

.6952012913

 

1

 

1.570796327

(4.2.1)

Compute x and y

 

Here, we solve for xand y within the min. and max. of qstar2 and qstar, and substitute the results into q.

AreThereComplexRoots := type(true, 'truefalse');
try
   soln1:= fsolve({b1, b2}, {x = min(qstar2, qstar) .. max(qstar2, qstar), y = 0 .. infinity});
   soln2:= fsolve({b1, b2}, {x = min(qstar2, qstar) .. max(qstar2, qstar), y = -infinity .. 0});
   qcomplex1 := subs(soln1, x+I*y);
   qcomplex2 := subs(soln2, x+I*y);
catch:
   AreThereComplexRoots := type(FAIL, 'truefalse');
end try;

 

true

 

{x = 1.348928550, y = .3589396337}

 

{x = 1.348928550, y = -.3589396337}

 

1.348928550+.3589396337*I

 

1.348928550-.3589396337*I

(4.3.1)

Compute the rest of the Roots

 

In this section we compute the roots between each asymptotes.

OddAsymptotes := Vector[row]([seq(evalf((1/2)*(2*j+1)*Pi), j = 0 .. n)]);
AllAsymptotes := sort(Vector[row]([OddAsymptotes, qstar]));
if AreThereComplexRoots then
gg := [qcomplex1, qcomplex2, op(Roots(g, q = 0.1e-3 .. AllAsymptotes[1])), seq(op(Roots(g, q = AllAsymptotes[i] .. AllAsymptotes[i+1])), i = 1 .. n)];
elif not AreThereComplexRoots then
gg := [op(Roots(g, q = 0.1e-3 .. AllAsymptotes[1])), seq(op(Roots(g, q = AllAsymptotes[i] .. AllAsymptotes[i+1])), i = 1 .. n)];
end if:

OddAsymptotes := Vector(4, {(1) = ` 1 .. 11 `*Vector[row], (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

 

AllAsymptotes := Vector(4, {(1) = ` 1 .. 12 `*Vector[row], (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(4.4.1)

``

Remove the repeated roots if any

 

qq := MakeUnique(gg):

``

Redefine n

 

m := numelems(qq):

``

Compute the `τ_n`time constants

 

for i to m do
p[i] := gamma1*alpha/(4*k[1]*qq[i]^2/d^2-alpha3*xi/eta[1]);
end do;

93.91209918-98.41042341*I

 

93.91209918+98.41042341*I

 

8.521555786

 

2.990232721

 

1.515805379

 

.9145981009

 

.6114591994

 

.4374663448

 

.3284338129

 

.2556221851

 

.2045951722

(4.7.1)

``

Minimum of the Re(`τ_n`)

 

for i to m do
p[i] := min(Re(gamma1*alpha/(4*k[1]*qq[i]^2/d^2-alpha3*xi/eta[1])));
end do;

93.91209918

 

93.91209918

 

8.521555786

 

2.990232721

 

1.515805379

 

.9145981009

 

.6114591994

 

.4374663448

 

.3284338129

 

.2556221851

 

.2045951722

(4.7.1.1)

## I expected 0.20459 but return all the entries in the list.

``

Download Finding_min_zero.mw

I always found it odd that the end of a series was truncated with O(x^9) or whatever.

convert ( a, polynom) gets rid of it, but it just stops.  Could the O(x^9) be replaced with a +... or even a -... ?

series(tan^(-1)(x),x,9)
                              

convert(%,polynom)
                               

 

What's the best way to add a + ... to the end of that.

The random connected graphs used to be connected in Maple 2020. But then ...

restart;
with(GraphTheory):
with(RandomGraphs):
N:=100: n:=20: m:=30:
add(`if`(IsConnected(RandomGraph(n,m,connected)), 1, 0), 1..N) <> N;

        54 <> 100

Hello,

I would like to print the current values of both displayed functions for x=1 in each frame of the animation. My example code is below:

plot1 := animate(plot, [a*x^2, x = -1 .. 1, color = "Green", thickness = 3], a = 0.2 .. 1.2);
plot2 := animate(plot, [a*x^2 + 0.3, x = -1 .. 1, color = "Red", thickness = 3], a = 0.2 .. 1.2);
display([plot1, plot2]);

I would be grateful for any tips.

Thank you,

Iza

Hello all, 

Would you allow me to ask this one question?
[moderator: See also this previous question]

Is there any possible way to treat the differentiation operator (e.g., 'D') as an ordinary coefficient of a polynomial?

For example, as described in the attached worksheet, I was wondering if there is a way to re-write the LHS of the expression 'eq_e5_9b' as the expression 'desired'. 

In Kwon Park 

restart;

with(DEtools):

eq_e5_9b := psi__d0*Delta__delta(t) + psi__q0 * D(Delta__delta(t))/omega__0 = p_(Delta__psi__d(t))/omega__0 - Delta__psi__q(t);

psi__d0*Delta__delta(t)+psi__q0*D(Delta__delta(t))/omega__0 = p_(Delta__psi__d(t))/omega__0-Delta__psi__q(t)

(1)

collect(lhs(eq_e5_9b), Delta__delta(t));

psi__d0*Delta__delta(t)+psi__q0*D(Delta__delta(t))/omega__0

(2)

desired := Delta__delta(t) * (psi__d0 + psi__q0 * D/omega__0);

Delta__delta(t)*(psi__d0+psi__q0*D/omega__0)

(3)

 

Download Q20220404.mw

How do I create a pointplot with different values of a parameter?

I tried

pointplot([seq([k, a(k, a0)], k = 0 .. 10, a0 = [0, 50, 100, 150, 200])]);
Error, invalid input: seq expects its 3rd argument, step, to be of type numeric, but received a0 = [0, 50, 100, 150, 200]
NULL;

ImportGraph reads one or more graphs from a file. For a file containing multiple graphs, the supported formats are digraph6, graph6, and sparse6. I notice that one option is "output = graph or list, or iterator". However, in my programming with Maple, I was reminded several times that list is only good for a small amount of data.  

Although I can convert the list to an array using the convert function, the time spent in the conversion process needs to be considered.

restart: 
with(GraphTheory):
L:=ImportGraph("C:/Users/eul10c.g6", graph6, output=list):#31026 connected eulerian graphs on 10 vertices graphs and Change to your path here.
convert(L,Array) 

So does it make more sense to provide an "output=Array" as an output option?

eul10c.txt

I am trying to decide O of times fo a computer process. I thought it was n^2*log(N) or something like that.

With 12  points, it may be hard to determine if O(N^4), etc.

See big-o.mw

When resizing a textplot the text is not scaled. 

I am trying to use "solve" to solve a set of 2 equations defined by using summation function "sum". But I got an error saying "Error, (in sum) summation variable previously assigned, second argument evaluates to 3 = 1 .. 2". 

The Maple code is listed here

restart;
N := 2:
var:= seq(alpha[n], n = 1 .. N):
v(x):=sum(alpha[n]*phi[n](x), n = 1 .. N):
R(x):=diff(v(x), x $ 4) - p/EI:
eqs := seq('int'('R(x)'*phi[n](x), x = 0 .. L) = 0, n = 1 .. N):
for n to N do
    phi[n](x):= sin((2*n - 1)*Pi*x/L):
end do:       
solve({eqs}, {var});
Error, (in sum) summation variable previously assigned, second argument evaluates to 3 = 1 .. 2

current_mirror.msim

I try to simulate a current mirror model, but it doesn't work and say "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up". Maybe some incorrect parameters are set there, could you fix it? 

Hi,

While playing with this, I got:

> sum(Beta(k,1/2)/(2*k+1)^2,k=1..infinity)
Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation

I don't see how this can be singular, as Beta(k,1/2) is trivially bounded for k>=1, and sum(1/(2*k+1)^2) is absolutely convergent.

Maple is still able to evaluate numerically the inert sum (I get 0.3361376233). If I replace Beta with the expression with GAMMA, I get a result with MeijerG, that doesn't seem to help much for numerical evaluation, as it takes a long time and gives the wrong result -1.966769953*10^10 - (6.886827095*10^8)*I.

I have no reason to expect a closed form for this sum, but the error is surprising. And I don't know MeijerG well enough to explain the numerical error either. It fails with Maple 2020, 2021 and 2022.

Hi,

I try to animate the tangent in a moving point on the curve

ideas ?

Thanks

QuestionAnim.mw

First 48 49 50 51 52 53 54 Last Page 50 of 2155