Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.1K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Problems in getting Real number solutions in NSolve

Posted 11 years ago

Hello, Wolfram,

Simply speaking, the purpose of this small programming is to get the Real values of An and Ak. I think that this is a very simple equation to solve, but I have no idea why NSolve does not give any Real solution (even Imaginary solution). Could you help me ? I pasted the context of the programming below.

Thank you in advance,

n = 2.48; k = 4.38; (* dn/d\[Eta], dk/d\[Eta] *) \[Epsilon] = (n + 
   I k)^2; \[Eta] = -5 10^-3; 
d\[Epsilon][An_, Ak_] := 2 (n + I k) (An + I Ak) \[Eta];
rp[\[Theta]_] := (\[Epsilon] Cos[\[Theta]] - (\[Epsilon] - 
       Sin[\[Theta]]^2)^0.5)/(\[Epsilon] Cos[\[Theta]] + (\[Epsilon] -
        Sin[\[Theta]]^2)^0.5);
drp[\[Theta]_, An_, 
   Ak_] := ((d\[Epsilon][An, Ak] Cos[\[Theta]] - 
        d\[Epsilon][An, 
          Ak]/(2 (\[Epsilon] - 
             Sin[\[Theta]]^2)^0.5)) (\[Epsilon] Cos[\[Theta]] + (\
\[Epsilon] - 
          Sin[\[Theta]]^2)^0.5) - (\[Epsilon] Cos[\[Theta]] - (\
\[Epsilon] - Sin[\[Theta]]^2)^0.5) (d\[Epsilon][An, 
          Ak] Cos[\[Theta]] + 
        d\[Epsilon][An, 
          Ak]/(2 (\[Epsilon] - 
             Sin[\[Theta]]^2)^0.5)))/(\[Epsilon] Cos[\[Theta]] + (\
\[Epsilon] - Sin[\[Theta]]^2)^0.5)^2;
NSolve[{2 Re[drp[10.0 \[Pi]/180, An, Ak]/rp[10.0 \[Pi]/180]] == 
   0.001509, 
  2 Re[drp[60.0 \[Pi]/180, An, Ak]/rp[60.0 \[Pi]/180]] == 
   0.00287}, {An, Ak}]
Attachments:
POSTED BY: hwoarang Polar
4 Replies
POSTED BY: Daniel Lichtblau
Posted 11 years ago

Thank you soooo much. It really works.

POSTED BY: hwoarang Polar
Posted 11 years ago
POSTED BY: hwoarang Polar
Posted 11 years ago

A number of small, but significant changes

In[1]:= n = 2.48; k = 4.38;(*dn/d[Eta],dk/d[Eta]*)
\[Epsilon] = (n + I k)^2; \[Eta] = -5 10^-3;
d\[Epsilon][An_, Ak_] := 2 (n + I k) (An + I Ak) \[Eta]; 
rp[\[Theta]_] := (\[Epsilon] Cos[\[Theta]] - Sqrt[\[Epsilon] - Sin[\[Theta]]^2])/(\[Epsilon] Cos[\[Theta]] +
Sqrt[\[Epsilon] - Sin[\[Theta]]^2]); 
drp[\[Theta]_, An_, Ak_] := ((d\[Epsilon][An, Ak] Cos[\[Theta]] - d\[Epsilon][An, Ak]/(2 Sqrt[\[Epsilon] -
Sin[\[Theta]]^2])) (\[Epsilon] Cos[\[Theta]] + Sqrt[\[Epsilon] - Sin[\[Theta]]^2]) - (\[Epsilon] Cos[\[Theta]] -
Sqrt[\[Epsilon] - Sin[\[Theta]]^2]) (d\[Epsilon][An, Ak] Cos[\[Theta]] + d\[Epsilon][An, Ak]/(2 Sqrt[\[Epsilon] -
Sin[\[Theta]]^2])))/(\[Epsilon] Cos[\[Theta]] + Sqrt[\[Epsilon] - Sin[\[Theta]]^2])^2;
sol = Simplify[NSolve[{
    2 Re[drp[10.0 \[Pi]/180, An, Ak]/rp[10.0 \[Pi]/180]] == 0.001509, 
    2 Re[drp[60.0 \[Pi]/180, An, Ak]/rp[60.0 \[Pi]/180]] == 0.00287}, {An, Ak}]]

During evaluation of In[1]:= NSolve::svars: Equations may not give solutions for all "solve" variables. >>

During evaluation of In[1]:= NSolve::ratnz: NSolve was unable to solve the system with inexact coefficients. The answer was
obtained by solving a corresponding exact system and numericizing the result. >>

Out[3]= {{Ak -> (-1.48616 - 1.24023 I) - (1. - 1.96183*10^-16 I) Im[An] + (0. + 1. I) Re[An]}}

(*thus it appears*)
Ak == -1.48616 - 1.24023 I + I An
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard