Monday, 15 March 2010

matplotlib - Python: Filling in a gap between two plots -


How can I add two plots to one stop point? I have an equation for the point of continuity. NMP importing as imports Pylab R1 = 1 # AU Earth R2 = 1.524 # AU Mars Delta = 75 * NP PI / 180 # In radian mu = 38.86984154054163 C = NP SCRT (R1 ** 2 + R2 ** 2 - 2 * R1 * R2 * NP COOS (DLTNU) S = (R1 + R2 + C) / 2 M = S / 2 DEF F (A) : Alpha = 2 * np.arcsyn (np squat (s / (2 * a)) beta = 2 * np. rcissin (np squat (sc) / (2 * a)) return (np.sqrt (a ** 3 / mu) * (alpha - beta - (np.sin (alpha) - np.sin (beat) ))) Def g (a): alphag = 2 * np.pi - 2 * np.arcsin (np.sqrt (s / (2 * a))) betag = -2 * np.arcsin (np.sqrt ( (S-C) / (2 * A)) Return (NP.SQRT (one ** 3 / MU) * (Algag - Betag - (NP.sein (algag) - NP ACEIN (Betag))) A = NPLinspace (IM, 2, 500000) fig = YellowBegger) ax = fig.add_subplot (111) ax.plot (a, f (a), color = '# 000000') ax.plot (a, g ( Pylab.ylim ((0, 2) "Https://i.stack.imgur.com/PEi6Y PNG" alt = "Enter image details here">

E indicates that quation: dt = np.sqrt (S ** 3/8) * (np.pi - betam + np.sin (beta M)) where betam = 2 * Np.arcsin (np.sqrt (1 - c / s)) such as dt = 0.5 at a = S / 2 . However, the difference between plots seems larger than one point

I said: ax.plot ([am, am], [.505, .55], color = '# 000000' ) which fills in the difference but it looks like

Enter the image details here It seems that you should only use a value for betag :

 

import NMP as import matplotlib.pyplot plt r1 = 1 # AU earth r2 = 1.524 # AU Mars DeltaNU = 75 * np.pi / 180 # red Angle in mu = 38.86984154054163 c = np.sqrt (r1 ** 2 + r2 ** 2 - 2 * r1 * r2 * np.cos (deltanu)) s = (r1 + r2 + c) / 2 am = s / 2 def g (a, alphag, betag): return (np.sqrt (one ** 3 / mu) * (alpha - betag - (np sin (algag) - np (betag))) a = np. Linspace (m, 2, 500000) fig, ax = PLT. () Alpha = 2 * np.pi - 2 * np.arcsin (np.sqrt (s / (2 * a))) betag = 2 * np.arcsin (np.sqrt ((s - c) / (2 * A)) ax.plot (a, g (a, alphag, betag), color = 'r') alphag = 2 * np.arcsin (np.sqrt (s / (2 * a))) ax. Plot (A, G, A, Elag, Betag), color = 'R') plt.show ()

yield

 Enter image details here

I do not know what's happening here; I found this amiable.

No comments:

Post a Comment