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

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]

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.

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

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;

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.

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 READ FIRST: How to post and use Wolfram Community for notes on formatting code examples.

Moderation Team

Mr. Ledesma,

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

Moderation Team