0
|
7408 Views
|
6 Replies
|
1 Total Likes
View groups...
Share
GROUPS:

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

Posted 9 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] 
6 Replies
Sort By:
Posted 9 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:= Table[b[i], {i, 74, 164, 15}] Out= {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 9 years ago
 Mr. Ledesma, Your English is better than Google's. Please feel free to clean up the text. Moderation Team
Posted 9 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 9 years ago
 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 9 years ago
 ArrayPlot (like other data plotting functions) wants Real values, not Complex.
Posted 9 years ago
 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.