Create your own non-hohmann transfer

  • MHB
  • Thread starter Dustinsfl
  • Start date
In summary, this code allows for the creation and customization of transfer ellipses in TikZ. The semi-major and minor axes, as well as the focus and angle of the ellipses, can be adjusted to create various transfer patterns.
  • #1
Dustinsfl
2,281
5
So I am trying to get this code to do something else for the past few days and I am not making any head way. I don't have a question. I am just sharing code that anyone can play with to create there own transfers in TikZ.
Code:
\documentclass[convert=false]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,intersections,backgrounds,decorations.markings,arrows}\begin{document}
\begin{tikzpicture}[>=triangle 45,every label/.append style={font=\scriptsize},     
dot/.style={inner sep=0pt,shape=circle,draw=black,label={#1}},small dot/.style={minimum size=.05cm,dot={#1}},big dot/.style={minimum size=.1cm,dot={#1}}]     
\tikzset{circle with radius/.style={shape=circle, inner sep=0pt,outer sep=0pt,minimum size={2*(#1)}}}

\coordinate (O) at (0, 0);
\pgfmathsetmacro{\as}{3}
\pgfmathsetmacro{\bs}{2.25}
\pgfmathsetmacro{\c}{sqrt(\as^2 - \bs^2)}
\pgfmathsetmacro{\al}{3.75}
\pgfmathsetmacro{\bl}{2.9}
\pgfmathsetmacro{\cl}{sqrt(\al^2 - \bl^2)}
\pgfmathsetmacro{\xs}{abs(\c - \cl)}
\coordinate (O) at (0, 0);
\node[fill=black,big dot={below left: \(F\)}] (F) at (\c, 0) {};
\path[name path global=line1] (\c, 0) -- ++(60:{\as} and \bs);
\path[name path global=line2] (\c, 0) -- ++(150:6cm);
\begin{scope}[decoration={markings,
mark=at position 0.25 with {\arrow{>}},
mark=at position 0.375 with {\node[draw,shape=circle,inner sep=.04cm,fill=white,font=\tiny] {\(1\)};},
mark=at position 0.75 with {\arrow{>}},}]
\draw[postaction=decorate,name path global=ell1,blue] (O) ellipse (\as cm and \bs cm);
\end{scope}
\begin{scope}[decoration={markings,
mark=at position 0.25 with {\arrow{>}},
mark=at position 0.6 with {\node[draw,shape=circle,inner sep=.04cm,fill=white,font=\tiny] {\(2\)};},
mark=at position 0.75 with {\arrow{>}},},
on background layer]
\draw[postaction = decorate, name path global = ell2, red] (-\xs, 0) ellipse (\al cm and \bl cm);
\end{scope}
\path[name intersections={of=line1 and ell1,by=P1}];
\node[fill=black,big dot={right: \(A\)}] (A) at (P1) {};
\path[name intersections={of=line2 and ell2, by=P2}];
\node[fill=black,big dot={above: \(B\)}] (B) at (P2) {};
\draw[blue] (F) -- (A);
\draw[red] (F) -- (B) node[font=\scriptsize,fill=white,inner sep=0cm,pos=.5] {\(r_B\)};
\begin{scope}[on background layer]
\draw[dashed,-latex] ($(-\al , 0) - (1, 0)$) -- ($(\al, 0) + (.5, 0)$) coordinate (P3);
\draw[dashed,-latex] ($(F) - (0, 3)$) -- ($(F) + (0, 3)$);
\end{scope}
\begin{scope}[declare function={doubleA=5.8cm;},decoration={markings,
mark=at position 0.175 with {\arrow{>}},
mark=at position 0.225 with {\node[draw,shape=circle,inner sep=.04cm,fill=white,font=\tiny] {\(3\)};}}]       
\begin{pgfinterruptboundingbox}
\path let
\p1=($(A) - (F)$),
\p2=($(B) - (F)$),
\n1={veclen(\x1, \y1)},
\n2 = {veclen(\x2, \y2)}
in (A) node[name path global = aCircle, circle with radius = doubleA-\n1] {}
(B) node[name path global=bCircle,circle with radius=doubleA-\n2] {}
(F) node[name path global=fCircle,circle with radius=.5*doubleA] {};
\tikzset{name intersections={of=aCircle and bCircle,name=F'}}
\foreach \solA in {1,2} {
\path ($(F)!.5!(F'-\solA)$) coordinate (C'-\solA) 
($(C'-\solA)!doubleA/2!(F)$) coordinate (xDir-\solA)    
(F'-\solA) node[name path global/.expanded=f'Circle-\solA,circle with radius=.5*doubleA] {};} %!?                                                         
\foreach \solA in {1,2} { %!?
\path[name intersections={of=fCircle and f'Circle-\solA,by={yDir-\solA}}]
($(xDir-\solA)-(C'-\solA)$) coordinate (xDir'-\solA)
($(yDir-\solA)-(C'-\solA)$) coordinate (yDir'-\solA);}
\end{pgfinterruptboundingbox}
\foreach \solA in {1,2}
\draw[x=(xDir'-\solA),y=(yDir'-\solA),postaction=decorate,name path global=traj]
(C'-\solA) circle [radius = 1];
\end{scope}
\draw[on background layer,red] let
\p0 = (F),
\p1 = (B),
\p2 = (P3),
\n1 = {atan2(\x1 - \x0, \y1 - \y0)},
\n2 = {atan2(\x2 - \x0, \y2 - \y0)},
\n3 = {.75cm},
\n4 = {(\n2 + \n1) / 2}
in (F) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]
node[font = \tiny, fill = white, inner sep = 0cm] at ([shift = (F)] \n4:\n3) {\(\nu_B\)}; 
\draw[blue] let
\p0 = (F),
\p1 = (A),
\p2 = (P3),
\n1 = {atan2(\x1 - \x0, \y1 - \y0)},
\n2 = {atan2(\x2 - \x0, \y2 - \y0)},
\n3 = {.5cm},
\n4 = {(\n2 + \n1) / 2}
in (F) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2] node[font = \tiny, fill = white, inner sep = 0cm] at ([shift = (F)] \n4:.75cm) {\(\nu_A\)};
\end{tikzpicture}
\end{document}

You can change any of the pgfmathsetmacros to create your own ellipses. They should be self explanatory: \as and \bs are the semi-major and minor axis of the small ellipse and \c would be its focus. So \al and \bl are the larger ellipse. Don't mess with \xs or the definitions of \c and \cl.

You can change the angles in this code: (60 and 150 degrees)
Code:
\path[name path global=line1] (\c, 0) -- ++(60:{\as} and \bs); \path[name path global=line2] (\c, 0) -- ++(150:6cm);

You can change the doubleA here. However, to small will cause errors since there would be no transfer ellipse for that 2a value.
Code:
\begin{scope}[declare function={doubleA=5.8cm;},decoration={markings,

With the current setup, you will produce
View attachment 983
 

Attachments

  • Screenshot from 2013-07-09 20:06:17.png
    Screenshot from 2013-07-09 20:06:17.png
    17.6 KB · Views: 61
Physics news on Phys.org
  • #2
a transfer ellipse with a focus at the origin and a 2a value of 5.8 cm. You can play around with all of these parameters to create some pretty interesting transfers.
 

1. What is a non-Hohmann transfer?

A non-Hohmann transfer is a type of orbital maneuver used in space flight. It involves changing the trajectory of a spacecraft by using the gravitational pull of a celestial body to alter its velocity and direction.

2. How is a non-Hohmann transfer different from a Hohmann transfer?

A Hohmann transfer is a specific type of orbital maneuver that uses two impulsive burns to transfer a spacecraft between two circular orbits. A non-Hohmann transfer, on the other hand, uses multiple burns and takes a more complex path to reach its destination.

3. What factors influence the design of a non-Hohmann transfer?

The design of a non-Hohmann transfer is influenced by various factors, including the distance and relative positions of the celestial bodies involved, the spacecraft's propulsion capabilities, and the desired time of arrival at the destination.

4. Can any spacecraft perform a non-Hohmann transfer?

Not all spacecraft are capable of performing a non-Hohmann transfer. The spacecraft must have a sufficient amount of fuel and a propulsion system that allows for multiple burns and changes in velocity and direction.

5. Are there any real-life examples of non-Hohmann transfers?

Yes, there are several real-life examples of non-Hohmann transfers. One notable example is the Cassini spacecraft, which used multiple gravity assists from different celestial bodies to reach Saturn. Another example is the New Horizons mission, which used a non-Hohmann transfer to reach Pluto.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Poll
  • General Math
Replies
1
Views
2K
  • Special and General Relativity
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
5K
  • Math Proof Training and Practice
2
Replies
67
Views
10K
  • Sci-Fi Writing and World Building
Replies
2
Views
2K
Replies
8
Views
3K
Back
Top