Message Boards Message Boards

0
|
7971 Views
|
6 Replies
|
1 Total Likes
View groups...
Share
Share this post:

What is wrong with my code, I get an output of an orange block.

Posted 10 years ago
JuliaData[c_, {{xmin_, xmax_}, {ymin_, ymax_}}, xdiv_, ydiv_] :=
     Table[orbitLength[x + I y, c], {y, ymax, 
       ymin, -(ymax - ymin)/ydiv}, {x, xmin, xmax, (xmax - xmin)/xdiv}]

data = JuliaData[-.1 + 8 I, {{-2, 2}, {-2, 2}}, 100, 500];
ArrayPlot[data, DataRange -> {{-2, 2}, {-2, 2}}, 
 FrameTicks -> Automatic]
POSTED BY: Steven Fields
6 Replies

Other than syntax errors from omitting the underscore on the patterns in the definition of JuliaData[], it appears that you did not define the orbitlength[] function.

POSTED BY: Gerard Kopcsay

ArrayPlot (like other data plotting functions) wants Real values, not Complex.

POSTED BY: Bruce Miller
Posted 10 years ago

What is wrong with my code

fir[z_] :=  flAds*fnts*crgm[z] ( e2[b[z]] - e2[b[z] + 2*sgmRx*rrc ])/( 2*sgmRx )
pot = 180.; alt = 635.; rrc = 472.; vol = Pi*rrc^2*alt
fnts = 7.8*10^(16)*pot /vol
sgmRx = 0.065; f1Ads = 0.145;
rgm[y_] := Sqrt[rrc /(rrc + y)]
e2[y_] := ExpIntegralE[2, y]

b[x_] := Which[x < a1, sgmB1*x, a1 <= x < a1 + a2, 
  sgmB1*a1 + (x - a1)*sgmB2, a1 + a2 <= x, 
  sgmB1*a1 + sgmB2*a2 + (x - a1 - a2)*sgmB3]
a1 = 76.; a2 = 20.3;
sgmB1 = 0.065; sgmB2 = 0.166; sgmB3 = 0.1;
POSTED BY: elena lopez
Posted 10 years ago

Hello Elena,

I don't know if you've declared all your variables, but what I share below you worked for me, I hope that you will serve to your doubts.

a1 = 76.; a2 = 20.3;
sgmB1 = 0.065; sgmB2 = 0.166; sgmB3 = 0.1;
pot = 180.;
alt = 635.;
rrc = 472.;
vol = Pi*rrc^2*alt;
fnts = 7.8*10^(16)*pot/vol;
sgmRx = 0.065;
f1Ads = 0.145;
fir[z_] := 
  f1Ads*fnts*crgm[z]*(e2[b[z]] - e2[b[z] + 2*sgmRx*rrc])/(2*sgmRx);
crgm[y_] := Sqrt[rrc/(rrc + y)];
e2[y_] := ExpIntegralE[2, y];
b[x_] := Which[x < a1, sgmB1*x, a1 <= x < a1 + a2, 
  sgmB1*a1 + (x - a1)*sgmB2, a1 + a2 <= x, 
  sgmB1*a1 + sgmB2*a2 + (x - a1 - a2)*sgmB3]

Here are some examples with several test values that probe with the function b

In[15]:= Table[b[i], {i, 74, 164, 15}]

Out[15]= {4.81, 7.098, 9.0798, 10.5798, 12.0798, 13.5798, 15.0798}

Apparently your Which is well formed. I hope that you've helped in something,greetings, white donkey.

POSTED BY: Luis Ledesma

Elena,

When you have a new topic, please go to the Dashboard page and click the big green New Discussion button.
Also, please say what incorrect behavior is happening.

See http://community.wolfram.com/groups/-/m/t/270507 for notes on formatting code examples.

Moderation Team

POSTED BY: Moderation Team

Mr. Ledesma,

Your English is better than Google's. Please feel free to clean up the text.

Moderation Team

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract