Ask Your Question
0

Plotting error for parametric plot

asked 2017-02-04 20:29:56 +0100

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));

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-02-05 15:58:10 +0100

mforets gravatar image

updated 2017-02-05 15:59:06 +0100

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

edit flag offensive delete link more

Comments

Perfect - Thank you!

_accelerator_ gravatar image_accelerator_ ( 2017-02-05 16:24:16 +0100 )edit

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 ( 2017-02-05 18:53:40 +0100 )edit

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: 2017-02-04 20:29:56 +0100

Seen: 254 times

Last updated: Feb 04 '17