Ask Your Question
0

Plotting error for parametric plot

asked 8 years ago

I am getting the following error when trying to use parametric_plot:

verbose 0 (3757: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 200 points. verbose 0 (3757: plot.py, generate_plot_points) Last error message: ''Graphics' object is not callable'

Below is the code. Any ideas how I can avoid this?

t = var('t'); mu_E = 3.98601e5 #Mu in non-canonical km^3 s^-2 R_E = 6378.135; #Earth radius in km C_alt = 600; #Chief's altitude in km R_c = C_alt + R_E; #Orbit radius of chief

x0 = 69.78; y0 = 139.56; zo = 139.56; x0_dot = 0.; y0_dot = -151.116e-3; #in km/s z0_dot = 0.;

n = sqrt(mu_E/R_c^3); T_c = 2piisqrt((R_c^3)/mu_E); #Oribital period of chief

x(t) = (4x0 +2y0_dot/n) + (x0_dot/n)sin(nt) - (3x0 + 2y0_dot/n)cos(nt); y(t) = -(6nx0 + 3y0_dot)t + (y0 - 2x0_dot/n) + (6x0 + 4y0_dot/n)sin(nt) + (2x0_dot/n)cos(nt); px = plot(x,(0., 2T_c)); # py = plot(y,(0., 2T_c)); # pp = parametric_plot((px, py),(0, 2000),color=hue(0.6));

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 8 years ago

mforets gravatar image

updated 8 years ago

i think that you are looking for: parametric_plot([x(t), y(t)], (t, 0, 2*T_c), fill=True) (produces an ellipse).

Preview: (hide)
link

Comments

Perfect - Thank you!

_accelerator_ gravatar image_accelerator_ ( 8 years ago )

you're welcome! for the next one, please try using the buttons in Edit mode to format the question nicely (such as the 01010 button for the code, or the ` symbol..).

mforets gravatar imagemforets ( 8 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 8 years ago

Seen: 271 times

Last updated: Feb 04 '17