## 3 Badges

2 years, 151 days

## How use maple to find all roots...

Maple 18

Please, how can I find all the roots  of: (H/(Hc))^2 -(4*q^2)/Pi^2*((tan(q)- q/(1-alpha))/(tan(q)-q)) with q=(i-1)*Pi+Pi/2..i*Pi+Pi/2 for n=20.

See my attempt below:

```restart:with(RootFinding):
a[1] := .1093; k[3] := 7.5*10^(-12); k[2] := 3.8*10^(-12); d := 0.2e-3; eta[1] := 0.240e-1; alpha[2] := -.1104; alpha[3] := -0.1104e-2; eta[2] := .1361; xi := 1.219*10^(-6); alpha := 1-alpha[3]^2/(a[1]*eta[1]); theta[0] := 0.5e-1;
Hc := (Pi/d)*sqrt(k[2]/xi):

H := 5.5*Hc;
lambda := a[1]/(xi*H^2);

RootFinding:-NextZero(proc (q) options operator, arrow; (H/(Hc))^2 -(4*q^2)/Pi^2*((tan(q)- q/(1-alpha))/(tan(q)-q)) end proc, 0);

for j to 9 do RootFinding:-NextZero(proc (q) options operator, arrow; H^2/Hc^2-4*q^2*(tan(q)-q/(1-alpha))/(Pi^2*(tan(q)-q)) end proc, %) end do;```

Error, invalid input: RootFinding:-NextZero expects its 2nd argument, zz, to be of type numeric, but received FAIL

## How to use seq to generate upper triangu...

Maple

restart;
with(LinearAlgebra):
a := .1093;
b[3] := -0.1104e-2;
k[1] := 3.8*10^(-12);
d := 0.2e-3;
xi := -1;
theta0 := 0.1e-3;
eta[1] := 0.240e-1;
alpha := 1-b[3]^2/(a*eta[1]);
c := b[3]*xi*alpha/(eta[1]*(4*k[1]*q^2/d^2-b[3]*xi/eta[1]));

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

n:=3:
q[1]:=fsolve(f,q=(0..Pi/2)):
for i from 2 to n do
q[i]:=fsolve(f,q=(2*i-3)*Pi/2..(2*i-1)*Pi/2): ##q[n]
od:

printlevel := 2;
for i from 2 to n+1 do for j from i+1 to n do b[i, j] := int((cos(q[i]-2*q[i]*z/d)-cos(q[i]))*(cos(q[j]-2*q[j]*z/d)-cos(q[j])), z = 0 .. d); b[j, i] := b[i, j] end do end do;

for i from 2 to n do a[i, i] := int((cos(q[i]-2*q[i]*z/d)-cos(q[i]))*(cos(q[i]-2*q[i]*z/d)-cos(q[i])), z = 0 .. d) end do;

for i from 2 to n do f[i] := theta0*(int(cos(q[i]-2*q[i]*z/d)-cos(q[i]), z = 0 .. d)) end do;

## I have generated a matrix using the a[i,i] above
A := Matrix([seq([seq(a[i, j], i = 2 .. n)], j = 2 .. n)]);

b := Vector([seq(f[i], i = 2 .. n)]);

#Please, how do I generate an upper triangular matrix using b[i,j] above?

 1 2 3 4 5 6 Page 6 of 6
﻿