asfn

Mr. alireza seraj

272 Reputation

6 Badges

15 years, 143 days

MS in physics.

MaplePrimes Activity


These are replies submitted by asfn

i want to convert "f=0" to a polynomial in terms of "zin", like:

 a*zin^2+b*zin+c=0

so then how can i get it's coefficients?

for example if u have:

f := -x^2+6*x+4;

what "x" maximize "f"?

and if we have just plot of f, can we get such "x" that maximize "f"?

for example if u have:

f := -x^2+6*x+4;

what "x" maximize "f"?

and if we have just plot of f, can we get such "x" that maximize "f"?

thanks alot, but ...
my code is here. paste and run it.  

with(LinearAlgebra); with(Student[Calculus1]);
d1 := [seq(0.1e-5*i, i = .1 .. 2, .1)]; w := Array(1 .. 20); h := Array(1 .. 20);
N := 10; theta1 := 0; n1 := 1.5; n2 := 3.5; d2 := 0.5e-6; c := 0.3e9;
theta2 := arcsin(n1*sin(theta1)/n2);
`#mover(mi("n1"),mi("~"))` := n1*cos(theta1);
`#mover(mi("n2"),mi("~"))` := n2*cos(theta2);
phi2 := 2*Pi*`#mover(mi("n2"),mi("~"))`*d2*nu/c;
for j to 20 do
Lambda := d1[j]+d2;
`#mover(mi("n"),mo("&uminus0;"))` := (n1*d1[j]+n2*d2)/Lambda;
`νb` := c/(`#mover(mi("n"),mo("&uminus0;"))`*(2*Lambda));
phi1 := 2*Pi*`#mover(mi("n1"),mi("~"))`*d1[j]*nu/c;
M1 := `<|>`(`<,>`((`#mover(mi("n2"),mi("~"))`+`#mover(mi("n1"),mi("~"))`)*exp(-I*phi1), (`#mover(mi("n2"),mi("~"))`-`#mover(mi("n1"),mi("~"))`)*exp(-I*phi1)), `<,>`((`#mover(mi("n2"),mi("~"))`-`#mover(mi("n1"),mi("~"))`)*exp(I*phi1), (`#mover(mi("n2"),mi("~"))`+`#mover(mi("n1"),mi("~"))`)*exp(I*phi1)))/(2*`#mover(mi("n2"),mi("~"))`);
M2 := `<|>`(`<,>`((`#mover(mi("n2"),mi("~"))`+`#mover(mi("n1"),mi("~"))`)*exp(-I*phi2), (`#mover(mi("n1"),mi("~"))`-`#mover(mi("n2"),mi("~"))`)*exp(-I*phi2)), `<,>`((`#mover(mi("n1"),mi("~"))`-`#mover(mi("n2"),mi("~"))`)*exp(I*phi2), (`#mover(mi("n2"),mi("~"))`+`#mover(mi("n1"),mi("~"))`)*exp(I*phi2)))/(2*`#mover(mi("n1"),mi("~"))`);
Mcell := `.`(M2, M1);
h[j] := abs(Re(Mcell[2, 2]));
L := Roots(h[j]-1, nu = 1 .. 2*`&nu;b`, numeric);
w[j] := L[2]-L[1]
end do:
---------------------------------------------

and after that, run this:

---------------------------------------------

d1 := [1.*10^(-7), 2.*10^(-7), 3.*10^(-7), 4.*10^(-7), 5.*10^(-7), 6.*10^(-7), 7.*10^(-7), 8.*10^(-7), 9.*10^(-7), 0.10e-5, 0.11e-5, 0.12e-5, 0.13e-5, 0.14e-5, 0.15e-5, 0.16e-5, 0.17e-5, 0.18e-5, 0.19e-5, 0.20e-5];
d2 := 0.5e-6;
d := d1/d2;
f := CurveFitting:-PolynomialInterpolation(d,w, x);

---------------------------------------------
the error still exists.

 

thanks alot, but ...
my code is here. paste and run it.  

with(LinearAlgebra); with(Student[Calculus1]);
d1 := [seq(0.1e-5*i, i = .1 .. 2, .1)]; w := Array(1 .. 20); h := Array(1 .. 20);
N := 10; theta1 := 0; n1 := 1.5; n2 := 3.5; d2 := 0.5e-6; c := 0.3e9;
theta2 := arcsin(n1*sin(theta1)/n2);
`#mover(mi("n1"),mi("~"))` := n1*cos(theta1);
`#mover(mi("n2"),mi("~"))` := n2*cos(theta2);
phi2 := 2*Pi*`#mover(mi("n2"),mi("~"))`*d2*nu/c;
for j to 20 do
Lambda := d1[j]+d2;
`#mover(mi("n"),mo("&uminus0;"))` := (n1*d1[j]+n2*d2)/Lambda;
`&nu;b` := c/(`#mover(mi("n"),mo("&uminus0;"))`*(2*Lambda));
phi1 := 2*Pi*`#mover(mi("n1"),mi("~"))`*d1[j]*nu/c;
M1 := `<|>`(`<,>`((`#mover(mi("n2"),mi("~"))`+`#mover(mi("n1"),mi("~"))`)*exp(-I*phi1), (`#mover(mi("n2"),mi("~"))`-`#mover(mi("n1"),mi("~"))`)*exp(-I*phi1)), `<,>`((`#mover(mi("n2"),mi("~"))`-`#mover(mi("n1"),mi("~"))`)*exp(I*phi1), (`#mover(mi("n2"),mi("~"))`+`#mover(mi("n1"),mi("~"))`)*exp(I*phi1)))/(2*`#mover(mi("n2"),mi("~"))`);
M2 := `<|>`(`<,>`((`#mover(mi("n2"),mi("~"))`+`#mover(mi("n1"),mi("~"))`)*exp(-I*phi2), (`#mover(mi("n1"),mi("~"))`-`#mover(mi("n2"),mi("~"))`)*exp(-I*phi2)), `<,>`((`#mover(mi("n1"),mi("~"))`-`#mover(mi("n2"),mi("~"))`)*exp(I*phi2), (`#mover(mi("n2"),mi("~"))`+`#mover(mi("n1"),mi("~"))`)*exp(I*phi2)))/(2*`#mover(mi("n1"),mi("~"))`);
Mcell := `.`(M2, M1);
h[j] := abs(Re(Mcell[2, 2]));
L := Roots(h[j]-1, nu = 1 .. 2*`&nu;b`, numeric);
w[j] := L[2]-L[1]
end do:
---------------------------------------------

and after that, run this:

---------------------------------------------

d1 := [1.*10^(-7), 2.*10^(-7), 3.*10^(-7), 4.*10^(-7), 5.*10^(-7), 6.*10^(-7), 7.*10^(-7), 8.*10^(-7), 9.*10^(-7), 0.10e-5, 0.11e-5, 0.12e-5, 0.13e-5, 0.14e-5, 0.15e-5, 0.16e-5, 0.17e-5, 0.18e-5, 0.19e-5, 0.20e-5];
d2 := 0.5e-6;
d := d1/d2;
f := CurveFitting:-PolynomialInterpolation(d,w, x);

---------------------------------------------
the error still exists.

 

thank u veru much!

thank u veru much!

thanks for your guide.

i wanted to if possible color the surface for example in blue and the other in red to show good contrast to understand even tiny slope from z=1.

thanks for your guide.

i wanted to if possible color the surface for example in blue and the other in red to show good contrast to understand even tiny slope from z=1.

thanks very much!
thanks very much!

thank you, Robert.

 

thank you, Robert.

 

1 2 Page 2 of 2