Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Plotting Doesn't Plot' topicStudent Support Forum > General > "Plotting Doesn't Plot"

Next Comment >Help | Reply To Topic
Author Comment/Response
Stephen
09/25/09 10:28am

I have written the following Mathematica script:

NN = Sqrt[2 Sqrt[2]]/(Sqrt[2 (Sqrt[2] - 1)]*Pi*q);
x0 = Sqrt[Sqrt[2] (1 - I)]*q;
DD = 4 q^4*
NN*((1 - I)/
4)*(Sqrt[
1 - I]/(s + I (C - x0))^2 + (1 -
I)/(Sqrt[1 + I]*(s + I (C + Conj[x0]))^2))/(2^(3/
4) q^3 (2 I));
Poly = s + DD + s I \[CapitalLambda] DD;
q = .15;
\[CapitalLambda] = 0;
sol = Solve[Poly == 0, s];
ComplexExpand[Simplify[sol]];
sol1 = N[s /. sol[[1]]];
sol2 = N[s /. sol[[2]]];
sol3 = N[s /. sol[[3]]];
sol4 = N[s /. sol[[4]]];
Plot[Re[sol1], {C, -10, 5}, PlotStyle -> Thick]
Plot[Im[sol1], {C, -10, 5}, PlotStyle -> Thick]

I have written similar scripts for other types of polynomials similar to Poly, and for some reason I get mixed results. The result here is that the plot is empty. Sometimes the plots actually plot what they should, and other times I get nothing. Then I copy and paste from the files that do work, and it works out as I expect it to.

I have checked, and the output of Solve[*] is a function of C that shouldn't be causing such problems. Is anybody familiar with how to get around this, or why it is happening in the first place? It seems very random to me right now why some of these inputs work and others don't.

Attachment: bustedcode.nb, URL: ,

Subject (listing for 'Plotting Doesn't Plot')
Author Date Posted
Plotting Doesn't Plot Stephen 09/25/09 10:28am
Re: Plotting Doesn't Plot yehuda ben-s... 09/29/09 09:35am
Re: Plotting Doesn't Plot Lothar 09/29/09 1:19pm
Next Comment >Help | Reply To Topic