Debug: Database connection successful GW Johnson Postings and @Exrocketman1 YouTube videos (Page 22) / Meta New Mars / New Mars Forums

New Mars Forums

Official discussion forum of The Mars Society and MarsNews.com

You are not logged in.

Announcement

Announcement: This forum is accepting new registrations via email. Please see Recruiting Topic for additional information. Write newmarsmember[at_symbol]gmail.com.

#526 2025-05-03 15:00:20

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

GW Johnson sent a pdf study for the Solar Rocket project.   The pdf consists of images.

https://www.dropbox.com/scl/fi/56wex2tj … kdlh8&dl=0

(th)

Offline

Like button can go here

#527 2025-05-04 15:23:38

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

GW is working on orbital refueling.  He's published a number of concepts.

Here is the latest:

dAtAARb.png

(th)

Offline

Like button can go here

#528 2025-05-14 07:39:56

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For GW Johnson re difficulty of finding work by a forum author...

The default design of the forum software did not anticipate the need that I see, for a way to find particular work by particular authors on the platform.

Let's think about the possibility of creating an index to your work here, comparable to the index you create periodically for your work in the exRocketman blog.

If we decide to create such an index, a logical category would be this category (Meta New Mars) and it might have a title like:

Index to posts by GW Johnson (or something similar)

In order for this to make sense, the posts in that topic should be owned by you, so you can update them as needed.

(th)

Offline

Like button can go here

#529 2025-05-14 08:32:35

GW Johnson
Member
From: McGregor, Texas USA
Registered: 2011-12-04
Posts: 5,990
Website

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

I guess I do not understand clearly what the words refer to. 

Never having used the forum's search tool,  I cannot say,  but I would think it should locate everything a user posted,  if you search for his username. 

Does it not do that?

GW


GW Johnson
McGregor,  Texas

"There is nothing as expensive as a dead crew,  especially one dead from a bad management decision"

Online

Like button can go here

#530 2025-05-18 09:26:42

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For GW Johnson re post in FR-TSTO topic...

First, thanks for your contribution to the topic:
http://newmars.com/forums/viewtopic.php … 60#p231760

I'd like to point something out that one or two of our readers may be missing....

Once full reusability is achieved, the only cost of flight (not considering the business expenses that are the same for all businesses) is fuel.  At that point, the amount of payload you can get to LEO is not important, except in terms of how many flights you book for your particular use case.

At that point, the decision is based upon the size of the vehicle, just as it is in the aeronautics industry.

(th)

Offline

Like button can go here

#531 2025-05-18 16:44:48

RGClark
Member
From: Philadelphia, PA
Registered: 2006-07-05
Posts: 830
Website

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

tahanson43206 wrote:

For GW Johnson...

RGClark just opened a new topic about an Italian company that is (apparently) planning to use a rocket fuel that produces a greater ISP than any rocket created by humans to this point.

My recollection is that among your many publications is one that shows that an ISP greater that 450 can produce desirable results.

If you have a moment or two, please add a post to  RGClark's new topic.

Please don't say that the new rocket is not possible with known technology, because clearly the company will be using technology that is new and far beyond anything achieved in the past several thousand years.

Instead, please show what the ISP of the new rocket fuel must be to achieve the desired result.

I assume the ISP must be greater than 450, but perhaps no more than 650?

(th)

I did a search of “RGClark” on the forum, to find posts I hadn’t seen and saw this. I don’t remember it. Perhaps you mean Sidereus that want’s to make a small SSTO:

Sidereus Space Dynamics Complete Integrated Static Fire Test.
https://europeanspaceflight.com/sidereu … fire-test/

  Bob Clark


Old Space rule of acquisition (with a nod to Star Trek - the Next Generation):

      “Anything worth doing is worth doing for a billion dollars.”

Offline

Like button can go here

#532 2025-05-21 11:34:28

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For All...

This post is to mark a step taken by GW Johnson to register a claim for a possible solution for challenges of on-orbit refueling.  A series of documents were submitted today to the US Patent Office web site, in accordance with requirements for this type of application, and the fee was paid.

I am hoping this set of documents will become public, and when that happens I'll post the links so NewMars members can see the claim.

Please note that the intellectual property claimed may already be covered in an existing patent, or in a patent application that is pending, but it costs thousands of dollars to find out.

***
Update: GW Johnson clarified that the documentation he filed is NOT made available, unless and until it becomes part of a full application. GW has one year from today to complete a full application, with the assurance the documents he filed today will show primacy if a search does not turn up prior art, or a patent pending that covers the IP.

GW will be working on a presentation for prospective investors, so we might be able to see that at some point.

(th)

Offline

Like button can go here

#533 2025-05-23 06:16:48

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

This post is to report on further developments building upon GW's registry of a concept for his on-orbit refueling depot with the US Patent Office.  He completed a set of elements for a presentation at a conference (slides, text, images). 

There are plenty of space related conferences, including the Mars Society in October (9-11) of 2025.

Suggestions of conferences by NewMars members are welcome.

I'll report more news as it becomes available.

(th)

Offline

Like button can go here

#534 2025-05-28 11:04:53

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For GW Johnson re comments on Flight Test 9

Thanks for your perspective on the flight and recommendation(s) for improvements.

In your post, you indicated the possibility the booster may have lit three center engines to provide ullage to insure propellant stayed at the bottom of the tank after Starship departed.

This post is to confirm that those center three engines did indeed light, if the digital readout can be trusted.

I thought at the time that this must be part of the planned activity to improve chances of success of the Hot staging maneuver.

Your observations about the Angle of Attack planned increase are helpful.  It occurs to me that the design team may be looking at the point of failure of the air frame, to see if it can be strengthened.  I would assume there must be tradeoffs at work, to improve the reusability of the Super Heavy.  Perhaps a steeper AOA would mean a faster return to the launch point, and thus perhaps less fuel for the return, as a tradeoff for increased mass of the air frame?

(th)

Offline

Like button can go here

#535 2025-05-28 19:02:45

GW Johnson
Member
From: McGregor, Texas USA
Registered: 2011-12-04
Posts: 5,990
Website

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

The idea behind high AOA during booster entry is that high AOA flight is higher drag that acts to decelerate you.  That reduces the propellant quantity required for the landing burn.  The problem is that high AOA is a high crossflow velocity with larger wind loads perpendicular to the stage axis.  Every supersonic airframe I ever heard of would break up under those crossflow air loads in supersonic flight,  if there was more than trivial ambient atmospheric density.  Higher AOA is higher breakup risk. Simple as that.

GW


GW Johnson
McGregor,  Texas

"There is nothing as expensive as a dead crew,  especially one dead from a bad management decision"

Online

Like button can go here

#536 2025-05-29 08:33:58

GW Johnson
Member
From: McGregor, Texas USA
Registered: 2011-12-04
Posts: 5,990
Website

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

Found this in today's AIAA "Daily Launch" email newsletter:

----------   
article image   
Aviation Week Network

Space Ops: Blue Origin Prepares To Leapfrog SpaceX To The Moon

Blue Origin plans to attempt a lunar landing this year. If successful, the MK1, which is 26 ft. tall and 10 ft. in diameter, would become the largest vehicle to touch down on the surface of the Moon, eclipsing the Apollo program’s Lunar Modules (LM) that landed crews six times in 1969-72. Fully fueled, the MK1 weighs 47,000 lb., compared with the 36,200-lb. mass of the extended Apollo LM.
-----------   

We will soon see if it works.  Between the larger size,  and the hydrogen fuel,  that is how the Blue Origin lander can do the landing single stage,  even from that ridiculous Gateway orbit with the one-way dV that is at least factor 1.5 larger than Apollo's.

Meanwhile,  SpaceX is getting into trouble with its basic design approaches,  and I'm unsure they actually realize it.  Had they had attitude thrusters independent of propellant tank pressurization,  Flight 9 might have been under control at reentry!  Simple as that!  Between Flights 7 and 8,  that answer has been staring them in the face.

GW


GW Johnson
McGregor,  Texas

"There is nothing as expensive as a dead crew,  especially one dead from a bad management decision"

Online

Like button can go here

#537 2025-05-29 08:36:29

GW Johnson
Member
From: McGregor, Texas USA
Registered: 2011-12-04
Posts: 5,990
Website

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

From the same issue of Daily Launch" as the previous post:

------
SpaceX Starship failure casts further doubt on NASA’s moon landing timeline

NASA hopes to put astronauts on the moon in just two years, but a critical spacecraft required for the mission keeps exploding or disintegrating: SpaceX’s Starship, the largest rocket ever built. Originally envisioned as a Mars rocket, it is also a key piece of NASA’s plan to outpace China and land humans on the lunar surface for the first time in more than half a century.
------ 
Just goes to show that resolving this is a very serious issue,  despite all the chaos released upon NASA by that crowd in DC.

GW


GW Johnson
McGregor,  Texas

"There is nothing as expensive as a dead crew,  especially one dead from a bad management decision"

Online

Like button can go here

#538 2025-05-31 17:59:45

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

This post is offered to try to encourage further development of ideas in the Starship is Go topic...

The 10 Hertz oscillation is NOT being observed in a 50 meter long ship.

The 10 Hertz oscillation ** is ** being observed in the test facility in McGregor, Texas.

Could there be resonate piping at McGregor?

(th)

Offline

Like button can go here

#539 2025-05-31 22:08:19

GW Johnson
Member
From: McGregor, Texas USA
Registered: 2011-12-04
Posts: 5,990
Website

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

You completely missed my points.

There is some kind of 10 Hz pressure oscillation in the engine chamber.  I can feel those effects from 6 miles away,  and they are there whether or not there is any sort of plumbing around the engine. 

In the ship, but not the test stand in McGregor,  there are particular forms of plumbing that might be susceptible to being driven by that 10 Hz oscillation in engine pressure,  via the mechanical shaking of the engine in its mountings in the stage.  That is because of the lengths of feed piping in the ship (that are not there at McGregor).  You have to pipe propellants from the tanks to the engines.  One of the header tanks has been in the nose,  almost 50 meters away.  The lengths are there to hit one of the first couple of harmonics to that 10 Hz oscillation.

If the plumbing responds to the 10 Hz shake by its contained fluid resonating with it,  that could affect the propellant flow,  which literally is the energy release rate in the chamber,  so there is the possibility that there could be an energy feedback from engine to plumbing and back to engine.  The engine shake drives a wave in the plumbing,  which affects flow rate,  which increases the intensity of the vortex shedding oscillations in the chamber.  If the wave in the plumbing gets strong enough,  the pressure nodes of it it break a tube or a fitting somewhere.  And THAT effect is exactly what they have been describing with their talk about oscillations and fuel leaks. 

It does not matter one tinker's damn that there is no ship or ship-like plumbing at the McGregor test stands!  The initiating oscillation in the engine is still there!  Which is what I have been feeling from all three versions of Raptor. There is nothing outside the engine for it to interact with.  Put the engine in the ship,  and there is.

Merlin does not seem have this problem with pressure oscillations in its chamber,  at least not at a strength that I can observe.  But it burns kerosene,  not methane!  That's inherently a sooty flame,  and that soot cloud is a draggy inertia on the gas oscillations,  acting to damp them down.  So,  even if the propellant injection geometry is identical in both engines,  and so cause the same exploding-vortex shedding,  the two engines are just not very likely to respond in the same way,  as one has a damping cloud in it,  the other does not.  Methane burns virtually soot-free.

GW

Last edited by GW Johnson (2025-05-31 22:16:18)


GW Johnson
McGregor,  Texas

"There is nothing as expensive as a dead crew,  especially one dead from a bad management decision"

Online

Like button can go here

#540 2025-06-01 16:33:07

SpaceNut
Administrator
From: New Hampshire
Registered: 2004-07-22
Posts: 29,480

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

I started to look at the test stand as one place that is largely different than a starship in flight.
Merlin-stands-crop-Aero-Photo.jpg

Offline

Like button can go here

#541 2025-06-05 09:22:32

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For GW Johnson re image of kbd512's ITV with dual rotating batons...

JHA0kAc.png

The early NASA study that kbd512 found to illustrate the baton concept featured braces to protect the booms from stress caused by propulsion forces.

Without protection the booms will snap off at the base.

G forces that may be exerted could reach as high as 3 during normal operation, and special circumstances may cause even greater acceleration.

The habitat booms can be protected with light weight cables, provided that the booms are separated by enough distance.

At this point I do not know what the effect of separating the counter-rotating batons might be on the operation of the space craft.

This topic (GW Johnson) is not limited to any particular technology or subject, so a study of gyroscopic effects in microgravity would be a welcome addition to the NewMars archive.

A simple test instrument could be created to fly on the ISS, to investigate the behavior of a system consisting of a non-rotating shaft with two counter rotating batons that can be mounted at various locations on the shaft.  The test instrument could be equipped with battery powered motors to turn the batons at various rates.  An ISS researcher could perform experiments such as pushing the end of the central shaft to see what effect longitudinal acceleration has on the system.

The same experiment could be performed on a parabolic flight, but the duration of the experiment would necessarily be less.

(th)

Offline

Like button can go here

#542 2025-06-09 06:54:16

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For GW Johnson re link in one of Void's posts:
https://newmars.com/forums/viewtopic.ph … 17#p232117

Void provided us a link to a presentation by Angry Astronaut about a nuclear thermal rocket.

About half way through the presentation, AA provides an animated graphic on the Hohmann Transfer. I am curious about the graphic and would appreciate your opinion.  It seems to me the graphic fails to account for the difference in velocity of Mars with respect to the arriving vessel.  As I view the animation, I get the impression the person who created the graphic was unaware of the difference in velocity of the vessel as it reached the apogee of the Hohmann Transfer ellipse, and the velocity of Mars in it's orbital ellipse.

In many posts, you have given that velocity as a not insignificant value in km/s.  In addition, you have mentioned the acceleration of Mars as it acts upon the vessel, to accelerate the vessel toward Mars. What I don't recall is whether the gravity of Mars might be enlisted to help the arriving vessel to catch up to Mars as it approaches from behind the vessel?

(th)

Offline

Like button can go here

#543 2025-06-09 15:56:03

GW Johnson
Member
From: McGregor, Texas USA
Registered: 2011-12-04
Posts: 5,990
Website

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

He did not seem to realize that the spacecraft as it reaches Mars's orbit,  is moving slower than Mars.  He said it was moving faster,  and that is entirely wrong.  Mars literally runs over you from behind!  All these speeds are with respect to the sun.

Him saying you have to slow down to arrive at Mars was correct,  although I believe his understanding of that is flawed.  There is a change of coordinates involved,  before you can determine speed relative to Mars instead of the sun.  Your speed with respect to the sun,  minus Mars's speed with respect to the sun,  is your relative speed with respect to Mars.  That will be a negative number,  because Mars is faster. 

Doesn't matter,  that difference is BEFORE the effect of Mars's gravity accelerates you toward the planet to an even higher speed relative to Mars (still a negative number).  The negative numbers do not matter,  when you square them to compute kinetic energy.  That's what my little correction equation for "Vnear" vs "Vfar" does.  And that higher speed close-in is what you have to "kill" to one extent or another,  either to land directly,  or to go into orbit about Mars. 

Off of Hohmann,  that Vnear higher speed is actually a little above Mars surface escape,  at about 5.4 km/s (escape 5.0 km/s).  Off a faster trajectory,  it is higher still,  and requires vector math to compute,  since the orbit arrival point is not a collinear tangency,  but a crossing at some significant angle.  Off the 2-year abort ellipse,  it is closer to 7.4 km/s.

Since Mars is literally running over you from behind for a Hohmann transfer,  you cannot use its gravity to "catch up the planet",  it is catching up to you (!!!),  and it is pulling you in ever faster as it tries to run over you from behind.

GW

Last edited by GW Johnson (2025-06-09 15:56:29)


GW Johnson
McGregor,  Texas

"There is nothing as expensive as a dead crew,  especially one dead from a bad management decision"

Online

Like button can go here

#544 2025-06-09 16:08:05

GW Johnson
Member
From: McGregor, Texas USA
Registered: 2011-12-04
Posts: 5,990
Website

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

The liquid core nuclear thermal concept is not at all new.  It dates back to the late 1950's,  as does the two gas core concepts.  All these got a little bit of design work,  based on presumptions,  not hard data.  What little experimental work there was,  was academic-type bench testing.  No engine test articles were ever built.

Actually,  the open-cycle gas core nuclear thermal engine might actually be an easier problem to solve.  The bench tests confirmed a reactor core in the gas phase could be controlled,  and a couple of flow schemes tested as plasma devices showed that the hydrogen/uranium flow rate ratio could be near 1000:1,  which was effectively as good as "perfect containment",  due to burnup time being about the same order of magnitude as the uranium residence time.  There would be hard radiation in the plume,  composed of nuclear reaction products.  The Isp was estimated as around 2500 s,  with simple regenerative cooling,  which led to a really good-looking estimated thrust/weight for the whole engine system.

The other gas core concept was the "nuclear light bulb",  which had a double quartz wall between the uranium fireball and the hydrogen to be heated.  The hydrogen flowed between the quartz walls to cool them,  before finishing its heatup outside the wall.  This was estimated as 1300-1500 s Isp,  and a thrust to weight looking only slightly better than solid core.  It could theoretically have a plume free of radiation,  but you'd have to do something about the products accumulating in the gas core.  No one ever figured that difficulty out. . 

GW

Last edited by GW Johnson (2025-06-09 16:11:03)


GW Johnson
McGregor,  Texas

"There is nothing as expensive as a dead crew,  especially one dead from a bad management decision"

Online

Like button can go here

#545 2025-06-11 19:43:57

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

The pdf at the link below contains a five page study on Transfer Orbits in images with words to explain the diagrams.

https://www.dropbox.com/scl/fi/rbcd3k9l … fgwx8&dl=0

(th)

Offline

Like button can go here

#546 2025-06-28 19:30:07

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

This post is to contain a copy of XYTRAJ.ASC

'   PROGRAM XYTRAJ.BAS
'
DECLARE SUB atmos (h, pamb, Tamb)
DECLARE SUB intrp (n%, v(), u(), x, y)
'
'
'
CLS
PRINT "Welcome to Program XYTRAJ.BAS, version 1, coded by G.W.Johnson,P.E.,"
PRINT "in the QuickBASIC 4.5 language on an IBM-compatible PC, 2-21-90."
PRINT
PRINT "This code integrates two-dimensional cartesian trajectory performance"
PRINT "of nonlifting point mass vehicles with thrust and drag over a flat"
PRINT "earth. Variation of gravity with altitude is included. Propulsion is"
PRINT "simple single stage rocket with thrust versus time and motor mass "
PRINT "versus time inputs in tabular form. Thrust data are input as vacuum "
PRINT "levels and corrected for the backpressure term by the code. No "
PRINT "corrections are made for nozzle flow separation. Nozzle exit area is"
PRINT "an input. Drag is computed from an input reference area and tabular "
PRINT "input of the drag coefficient versus flight Mach number. This drag is"
PRINT "the power-on drag. Power-off drag is approximated by the negative back"
PRINT "pressure term added to a zero vacuum thrust with the power-on drag."
PRINT "Be sure your motor and drag curves extend beyond the limit time."
PRINT
PRINT "(Hit any key to continue)"
SLEEP
PRINT
PRINT "This code uses a simple forward-stepping computation of the kinematics"
PRINT "using the current position, kinematics, and dynamics, ignoring jerk "
PRINT "effects due to variable mass and forces over the step interval. Normally,"
PRINT "this would be inaccurate except at very small time steps, which can be"
PRINT "rather inefficient. However, this code features a variable time step"
PRINT "that limits the maximum velocity increment to a user-input fraction of"
PRINT "the current velocity, subject to a minimum value of 1 msec for the step."
PRINT "0.10 is recommended as maximum fraction for rough estimates, and 0.01"
PRINT "or 0.02 is probably more appropriate for problems of ordinary scale "
PRINT "near the surface of the earth, especially with significant drag and/or"
PRINT "thrust. For zero-thrust problems, be sure to input zero nozzle exit "
PRINT "area to kill the power-off drag increment approximation -Patm*Ae."
PRINT "One quirk: to enforce your initial launch angle at zero initial velocity,"
PRINT "you must input a small nonzero velocity, say, 0.01 fps. Because of the"
PRINT "variable, velocity-dependent time step, the code will be very slow to "
PRINT "integrate low initial velocity problems -- say, under 100 fps."
PRINT
INPUT "Do you want a hard copy output? 0 = no, 1 = yes "; copy%
IF copy% > 0 THEN
LPRINT "Welcome to Program XYTRAJ.BAS, version 1,coded by G.W.Johnson,P.E.,"
LPRINT "in the QuickBASIC 4.5 language on an IBM-compatible PC, 2-21-90."
LPRINT
LPRINT "This code integrates two-dimensional cartesian trajectory performance"
LPRINT "of nonlifting point mass vehicles with thrust and drag over a flat"
LPRINT "earth. Variation of gravity with altitude is included. Propulsion is"
LPRINT "simple single stage rocket with thrust versus time and motor mass "
LPRINT "versus time inputs in tabular form. Thrust data are input as vacuum "
LPRINT "levels and corrected for the backpressure term by the code. No "
LPRINT "corrections are made for nozzle flow separation. Nozzle exit area is"
LPRINT "an input. Drag is computed from an input reference area and tabular "
LPRINT "input of the drag coefficient versus flight Mach number. This drag is"
LPRINT "the power-on drag. Power-off drag is approximated by the negative back"
LPRINT "pressure term added to a zero vacuum thrust with the power-on drag."
LPRINT "Be sure your motor and drag curves extend beyond the limit time."
LPRINT
LPRINT "This code uses a simple forward-stepping computation of the kinematics"
LPRINT "using the current position, kinematics, and dynamics, ignoring jerk "
LPRINT "effects due to variable mass and forces over the step interval. Normally,"
LPRINT "this would be inaccurate except at very small time steps, which can be"
LPRINT "rather inefficient. However, this code features a variable time step"
LPRINT "that limits the maximum velocity increment to a user-input fraction of"
LPRINT "the current velocity, subject to a minimum value of 1 msec for the step."
LPRINT "0.10 is recommended as maximum fraction for rough estimates, and 0.01"
LPRINT "or 0.02 is probably more appropriate for problems of ordinary scale "
LPRINT "near the surface of the earth, especially with significant drag and/or"
LPRINT "thrust. For zero-thrust problems, be sure to input zero nozzle exit "
LPRINT "area to kill the power-off drag increment approximation -Patm*Ae."
LPRINT "One quirk: to enforce your initial launch angle at zero initial velocity,"
LPRINT "you must input a small nonzero velocity, say, 0.01 fps. Because of the"
LPRINT "variable, velocity-dependent time step, the code will be very slow to "
LPRINT "integrate low initial velocity problems -- say, under 100 fps."
END IF
'
'
DIM Ftimes(1 TO 10)
DIM Fvacs(1 TO 10)
DIM Wtimes(1 TO 10)
DIM Wos(1 TO 10)
DIM Ms(1 TO 10)
DIM cds(1 TO 10)
'
'
'   Constants
'
'
gc = 32.174
pi = 3.141592654#
RE = 2.09262E+07
dummy = .000001
'
'
'   Input rocket thrust model
'
'
PRINT "Code requires arrays for vacuum thrust vs time and motor mass vs time"
PRINT
INPUT "how many points in the vacuum thrust vs time curve, 10 max "; nFvac%
PRINT
FOR i% = 1 TO nFvac% STEP 1
INPUT "time, sec, and vacuum thrust, pounds "; Ftimes(i%), Fvacs(i%)
NEXT i%
PRINT
INPUT "what is the nozzle exit area, inch2 "; Ae
PRINT
INPUT "how many points in the motor mass vs time curve, 10 max "; nWo%
PRINT
FOR i% = 1 TO nWo% STEP 1
INPUT "time, sec, and motor mass, pounds-mass "; Wtimes(i%), Wos(i%)
NEXT i%
'
'
'   Input vehicle drag model
'
'
PRINT
PRINT "Code requires an array of drag coefficients vs flight Mach number"
PRINT
INPUT "how many points in the cd vs Mach curve, 10 max "; ncd%
PRINT
FOR i% = 1 TO ncd% STEP 1
INPUT "Mach number and cd "; Ms(i%), cds(i%)
NEXT i%
PRINT
INPUT "what is the reference area for cd, inch2 "; Aref
'
'
'   Input other data
'
'
PRINT
INPUT "What is the nonpropulsive mass, pounds-mass "; Wnp
PRINT
INPUT "What fraction of velocity is the allowable velocity increment "; converge
'
'
'   Input the initial conditions
'
'
PRINT
INPUT "initial time, sec "; time
INPUT "initial velocity, feet/sec "; Vi
INPUT "initial path angle, degrees, positive upward "; dangli
INPUT "initial range, feet "; x
INPUT "initial altitude, feet "; y
angli = dangli * pi / 180!
xd = Vi * COS(angli)
yd = Vi * SIN(angli)
'
'
'   Input the stopping conditions
'
'
PRINT
INPUT "what is the max problem time, sec "; limit
INPUT "what is the max range, feet "; max
INPUT "what is the min altitude, feet "; min
'
'
'   Echo the inputs
'
'
CLS
PRINT "Wnp,lbm", "Aref,in2", "Ae,in2", "delV/V"
PRINT Wnp, Aref, Ae, converge
PRINT
PRINT "time,sec", "Fvac,lb", "Vacuum thrust curve"
FOR i% = 1 TO nFvac% STEP 1
PRINT Ftimes(i%), Fvacs(i%)
NEXT i%
PRINT
PRINT "hit any key to continue"
SLEEP
PRINT
PRINT "time,sec", "mass,lbm", "Motor mass curve"
FOR i% = 1 TO nWo% STEP 1
PRINT Wtimes(i%), Wos(i%)
NEXT i%
PRINT
PRINT "hit any key to continue"
SLEEP
PRINT
PRINT "Mach", "cd", "Drag coefficient vs Mach number curve"
FOR i% = 1 TO ncd% STEP 1
PRINT Ms(i%), cds(i%)
NEXT i%
PRINT
PRINT "hit any key to continue"
SLEEP
PRINT
PRINT "Initial Conditions"
PRINT "time,sec", "range,ft", "alt,ft", "vel,fps", "angl,deg"
PRINT time, x, y, Vi, dangli
PRINT " ", "xdot,fps", "ydot,fps"
PRINT " ", xd, yd
PRINT
PRINT "Stopping Conditions"
PRINT "max t,sec", "max x,ft", "min y,ft"
PRINT limit, max, min
   IF copy% > 0 THEN
   LPRINT
   LPRINT "    ECHO OF INPUT DATA "
   LPRINT
   LPRINT "Wnp,lbm", "Aref,in2", "Ae,in2"
   LPRINT Wnp, Aref, Ae
   LPRINT
   LPRINT "time,sec", "Fvac,lb", "Vacuum thrust curve"
   FOR i% = 1 TO nFvac% STEP 1
   LPRINT Ftimes(i%), Fvacs(i%)
   NEXT i%
   LPRINT
   LPRINT "time,sec", "mass,lbm", "Motor mass curve"
   FOR i% = 1 TO nWo% STEP 1
   LPRINT Wtimes(i%), Wos(i%)
   NEXT i%
   LPRINT
   LPRINT "Mach", "cd", "Drag coefficient vs Mach number curve"
   FOR i% = 1 TO ncd% STEP 1
   LPRINT Ms(i%), cds(i%)
   NEXT i%
   LPRINT
   LPRINT "Initial Conditions"
   LPRINT "time,sec", "range,ft", "alt,ft", "vel,fps", "angl,deg"
   LPRINT time, x, y, Vi, dangli
   LPRINT " ", "xdot,fps", "ydot,fps"
   LPRINT " ", xd, yd
   LPRINT
   LPRINT "Stopping Conditions"
   LPRINT "max t,sec", "max x,ft", "min y,ft"
   LPRINT limit, max, min
   END IF
PRINT
PRINT "we are now ready to fly -- hit any key to continue"
SLEEP
count% = 0
   IF copy% > 0 THEN
   LPRINT
   LPRINT "    TRAJECTORY PERFORMANCE DATA LISTING "
   LPRINT
   LPRINT "time,sec", "x,ft", "xd,fps", "xdd,fps2", "sumFx,lb"
   LPRINT "delt,sec", "y,ft", "yd,fps", "ydd,fps2", "sumFy,lb"
   LPRINT " ", "vel,fps", "angl,deg", "Mach no.", "qamb,psf"
   LPRINT " ", "thrust,lb", "drag,lb", "veh.mass,lbm", "veh.wt.,lb"
   END IF
'
'
'   THIS IS WHERE WE ACTUALLY "FLY" IN THE CODE
'
'
'   Iteration loop starts here
'
'
10 count% = count% + 1
   IF count% <= 1 THEN
   PRINT "time,sec", "x,ft", "xd,fps", "xdd,fps2", "sumFx,lb"
   PRINT "delt,sec", "y,ft", "yd,fps", "ydd,fps2", "sumFy,lb"
   PRINT " ", "vel,fps", "angl,deg", "Mach no.", "qamb,psf"
   PRINT " ", "thrust,lb", "drag,lb", "veh.mass,lbm", "veh.wt.,lb"
   END IF
'
'
'   First let's check for stopping conditions
'
'
IF time > limit THEN
code% = 1
GOTO 99
END IF
'
IF y < min THEN
code% = 2
GOTO 99
END IF
'
IF ABS(x) > max THEN
code% = 3
GOTO 99
END IF
'
'
'
'   THIS IS THE ONE-PASS POSITION/VELOCITY UPDATE LOGIC
'
'
'   Solve for the forces and dynamics at the current pos & vel & time
'
'
vel = SQR(xd * xd + yd * yd)
   IF ABS(xd) < 1E-09 THEN
   xd = 1E-09
   END IF
angl = ATN(yd / xd)
h = y
CALL atmos(h, pamb, Tamb)
c = 49.02 * SQR(Tamb)
Mach = vel / c
CALL intrp(nFvac%, Fvacs(), Ftimes(), time, Fvac)
   IF Fvac < 0! THEN
   Fvac = 0!
   END IF
Fth = Fvac - pamb * Ae
qamb = .7 * pamb * Mach * Mach
CALL intrp(ncd%, cds(), Ms(), Mach, cd)
D = cd * qamb * Aref
CALL intrp(nWo%, Wos(), Wtimes(), time, Wo)
Wo = Wo + Wnp
m = Wo / gc
g = gc * (RE * RE) / ((h + RE) * (h + RE))
W = m * g
Fx = (Fth - D) * COS(angl)
Fy = (Fth - D) * SIN(angl) - W
xdd = Fx / m
ydd = Fy / m
'
'
'   First order of business is to set the time step delt
'
'
Vd = SQR(xdd * xdd + ydd * ydd)
delt = ABS(converge * vel / Vd)
IF delt < .001 THEN
delt = .001
END IF
'
'
'   Print what you know at where and when you are
'
'
dangl = angl * 180! / pi
bigq = qamb * 144!
PRINT
PRINT USING "#######.######"; time; x; xd; xdd; Fx
PRINT USING "#######.######"; delt; y; yd; ydd; Fy
PRINT USING "#######.######"; dummy; vel; dangl; Mach; bigq
PRINT USING "#######.######"; dummy; Fth; D; Wo; W
   IF copy% > 0 THEN
   LPRINT
   LPRINT USING "#######.######"; time; x; xd; xdd; Fx
   LPRINT USING "#######.######"; delt; y; yd; ydd; Fy
   LPRINT USING "#######.######"; dummy; vel; dangl; Mach; bigq
   LPRINT USING "#######.######"; dummy; Fth; D; Wo; W
   END IF
IF count% >= 3 THEN
count% = 0
PRINT
PRINT "hit any key to continue"
SLEEP
END IF
'
'
'   Now compute the new pos & vel at time t + delt & update the time
'
'
x = .5 * xdd * delt * delt + xd * delt + x
y = .5 * ydd * delt * delt + yd * delt + y
xd = xdd * delt + xd
yd = ydd * delt + yd
time = time + delt
'
'
'   THIS ENDS THE ONE-PASS UPDATE LOGIC
'
'
GOTO 10
'
'
'
99 PRINT
SELECT CASE code%
   CASE 1
   PRINT "TERMINATION ON MAXIMUM PROBLEM TIME, SEC = ", limit
   CASE 2
   PRINT "TERMINATION ON ALTITUDE BELOW MINIMUM, FT = ", min
   CASE 3
   PRINT "TERMINATION ON RANGE BEYOND MAXIMUM, FT = ", max
END SELECT
   IF copy% > 0 THEN
      LPRINT
      SELECT CASE code%
         CASE 1
         LPRINT "TERMINATION ON MAXIMUM PROBLEM TIME, SEC = ", limit
         CASE 2
         LPRINT "TERMINATION ON ALTITUDE BELOW MINIMUM, FT = ", min
         CASE 3
         LPRINT "TERMINATION ON RANGE BEYOND MAXIMUM, FT = ", max
      END SELECT
   END IF
END

 

SUB atmos (h, p, T)
'
'
'   STANDARD ATMOSPHERE TO THE STRATOPAUSE -- 65,000 ft max
'
'
'   Code is based on relations given in R.von Mises "Theory of Flight"
'
'
p0 = 14.7
T0 = 519!
p1p0 = .23135
T1 = 393!
h1 = 35332!
'
'
'
IF h <= h1 THEN
pp0 = (1! - 6.88E-06 * h) ^ 5.256
p = p0 * pp0
T = 519! - .003566 * h
END IF
'
IF h > h1 THEN
pp1 = EXP(-.0000478 * (h - h1))
p = p0 * p1p0 * pp1
T = T1
END IF
'
END SUB

SUB intrp (n%, v(), u(), x, y)
'
'
'
'    This routine performs linear interpolation between abscissa array "u" and
'    ordinate array "v" for interpolated ordinate "y" based upon abscissa "x".
'    The only restriction is that array "u" must monotonically increase with
'    increasing index "i%".
'
'
'
j% = 1
FOR i% = 1 TO n% STEP 1
IF x > u(i%) THEN j% = i%
NEXT i%
IF j% >= n% THEN j% = n% - 1
f = (x - u(j%)) / (u(j% + 1) - u(j%))
y = v(j%) + f * (v(j% + 1) - v(j%))
END SUB

Offline

Like button can go here

#547 2025-06-30 18:24:42

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For GW Johnson!

Gemini just finished putting the finishing touches on the Windows version of your XYTRAJ program.  It then ran out of steam and asked to work on something else.  I recognize this as a sign that it has run out of patience, or resources, or both, so i signed off with thanks for all it had done.  It saved me weeks of work, which I would not have completed, because I have so many other demands on my time. The program now runs on Windows 7, so it will (most likely) work on any Windows 64 bit machine. 

I'll put the EXE file up on Dropbox, and return here to post the link.

Every NewMars member who has a Windows 64 bit machine and any OS from 7 on up should be able to run the program.

This version runs in a Command Window, which should be familiar to everyone who lived through the DOS days.

Removed after test on Windows 10 ... I'll zip the file and try again.  OK! Zip file is available.

https://www.dropbox.com/scl/fi/hb3bu5u9 … 83tio&dl=0

When you ask Dropbox for a file, it may invite you to set up an account. All you have to do is to download the file. The file size should be 180,005 bytes if the file copied correctly.  You should be able to run the file by just clicking on it.  it will open a Command window and start running, if all goes well.

Note: This program is compiled for Windows 64 bit, but I've only confirmed it runs on Windows 7. There may be adjustments needed.

I've tested on a Windows 10 laptop, and it reported a .Net component is missing. It appears I'm not yet out of the woods.

Feedback would be welcome.

(th)

Offline

Like button can go here

#548 2025-07-01 06:44:06

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For GW Johnson!

Here is a link to the zipped up program on Dropbox:
https://www.dropbox.com/scl/fi/w6i6xswi … h4qfx&dl=0

This is what your XYTRAJ program looks like converted to Visual Basic as of 2019:

Option Explicit On
' Option Strict On helps catch type conversion errors at compile time, highly recommended.
Option Strict On

Imports System
Imports System.IO ' For StreamWriter
Imports System.Threading ' For Thread.Sleep

Module XYTRAJ

    ' Option Explicit is good practice in VB.NET
    ' Constants (can be module-level or within Main if only used there)
    Const gc As Double = 32.174
    Const pi As Double = 3.1415926535897931 ' Use full double precision for PI
    Const RE As Double = 20926200.0
    Const dummy As Double = 0.000001 ' Original used .000001

    ' We'll need a StreamWriter for LPRINT output
    Private logWriter As System.IO.StreamWriter = Nothing
    Private Const LogFileName As String = "XYTRAJ_Output.txt" ' Define a log file name

    ' SUB atmos (h, p, T) - (Already translated, not repeated here for brevity)
    ' ...

    ' SUB intrp (n%, v(), u(), x, y) - (Already translated and fixed for n<2, not repeated here for brevity)
    ' ...

    Sub Main()
        Dim inputStr As String
        Dim copy As Integer ' QuickBASIC's copy% becomes 'copy As Integer'

        Console.WriteLine("Welcome to Program XYTRAJ.BAS, version 2, coded by G.W.Johnson,P.E.,")
        Console.WriteLine("in the QuickBASIC 4.5 language on an IBM-compatible PC, 2-21-90.")
        Console.WriteLine("Updated to Visual Basic using .Net on 2025/06/30 .")
        Console.WriteLine()
        Console.WriteLine("This code integrates two-dimensional cartesian trajectory performance")
        Console.WriteLine("of nonlifting point mass vehicles with thrust and drag over a flat")
        Console.WriteLine("earth. Variation of gravity with altitude is included. Propulsion is")
        Console.WriteLine("simple single stage rocket with thrust versus time and motor mass ")
        Console.WriteLine("versus time inputs in tabular form. Thrust data are input as vacuum ")
        Console.WriteLine("levels and corrected for the backpressure term by the code. No ")
        Console.WriteLine("corrections are made for nozzle flow separation. Nozzle exit area is")
        Console.WriteLine("an input. Drag is computed from an input reference area and tabular ")
        Console.WriteLine("input of the drag coefficient versus flight Mach number. This drag is")
        Console.WriteLine("the power-on drag. Power-off drag is approximated by the negative back")
        Console.WriteLine("pressure term added to a zero vacuum thrust with the power-on drag.")
        Console.WriteLine("Be sure your motor and drag curves extend beyond the limit time.")
        Console.WriteLine()
        Console.WriteLine("(Hit any key to continue)")
        Console.ReadKey(True) ' Changed from Thread.Sleep to Console.ReadKey(True)
        Console.WriteLine()
        Console.WriteLine("This code uses a simple forward-stepping computation of the kinematics")
        Console.WriteLine("using the current position, kinematics, and dynamics, ignoring jerk ")
        Console.WriteLine("effects due to variable mass and forces over the step interval. Normally,")
        Console.WriteLine("this would be inaccurate except at very small time steps, which can be")
        Console.WriteLine("rather inefficient. However, this code features a variable time step")
        Console.WriteLine("that limits the maximum velocity increment to a user-input fraction of")
        Console.WriteLine("the current velocity, subject to a minimum value of 1 msec for the step.")
        Console.WriteLine("0.10 is recommended as maximum fraction for rough estimates, and 0.01")
        Console.WriteLine("or 0.02 is probably more appropriate for problems of ordinary scale ")
        Console.WriteLine("near the surface of the earth, especially with significant drag and/or")
        Console.WriteLine("thrust. For zero-thrust problems, be sure to input zero nozzle exit ")
        Console.WriteLine("area to kill the power-off drag increment approximation -Patm*Ae.")
        Console.WriteLine("One quirk: to enforce your initial launch angle at zero initial velocity,")
        Console.WriteLine("you must input a small nonzero velocity, say, 0.01 fps. Because of the")
        Console.WriteLine("variable, velocity-dependent time step, the code will be very slow to ")
        Console.WriteLine("integrate low initial velocity problems -- say, under 100 fps.")
        Console.WriteLine()

        Dim inputParsed As Boolean
        Do
            Console.Write("Do you want a hard copy output? 0 = no, 1 = yes ")
            inputStr = Console.ReadLine()
            inputParsed = Integer.TryParse(inputStr, copy)
            If Not inputParsed Then
                Console.WriteLine("Invalid input. Please enter 0 or 1.")
            End If
        Loop While Not inputParsed

        If copy > 0 Then
            Try
                ' Ensure we dispose of previous writer if running multiple times
                If logWriter IsNot Nothing Then
                    logWriter.Close()
                    logWriter.Dispose()
                End If
                logWriter = New System.IO.StreamWriter(LogFileName, False) ' False for overwrite
                logWriter.WriteLine("Welcome to Program XYTRAJ.BAS, version 1,coded by G.W.Johnson,P.E.,")
                logWriter.WriteLine("in the QuickBASIC 4.5 language on an IBM-compatible PC, 2-21-90.")
                logWriter.WriteLine()
                logWriter.WriteLine("This code integrates two-dimensional cartesian trajectory performance")
                logWriter.WriteLine("of nonlifting point mass vehicles with thrust and drag over a flat")
                logWriter.WriteLine("earth. Variation of gravity with altitude is included. Propulsion is")
                logWriter.WriteLine("simple single stage rocket with thrust versus time and motor mass ")
                logWriter.WriteLine("versus time inputs in tabular form. Thrust data are input as vacuum ")
                logWriter.WriteLine("levels and corrected for the backpressure term by the code. No ")
                logWriter.WriteLine("corrections are made for nozzle flow separation. Nozzle exit area is")
                logWriter.WriteLine("an input. Drag is computed from an input reference area and tabular ")
                logWriter.WriteLine("input of the drag coefficient versus flight Mach number. This drag is")
                logWriter.WriteLine("the power-on drag. Power-off drag is approximated by the negative back")
                logWriter.WriteLine("pressure term added to a zero vacuum thrust with the power-on drag.")
                logWriter.WriteLine("Be sure your motor and drag curves extend beyond the limit time.")
                logWriter.WriteLine()
                logWriter.WriteLine("This code uses a simple forward-stepping computation of the kinematics")
                logWriter.WriteLine("using the current position, kinematics, and dynamics, ignoring jerk ")
                logWriter.WriteLine("effects due to variable mass and forces over the step interval. Normally,")
                logWriter.WriteLine("this would be inaccurate except at very small time steps, which can be")
                logWriter.WriteLine("rather inefficient. However, this code features a variable time step")
                logWriter.WriteLine("that limits the maximum velocity increment to a user-input fraction of")
                logWriter.WriteLine("the current velocity, subject to a minimum value of 1 msec for the step.")
                logWriter.WriteLine("0.10 is recommended as maximum fraction for rough estimates, and 0.01")
                logWriter.WriteLine("or 0.02 is probably more appropriate for problems of ordinary scale ")
                logWriter.WriteLine("near the surface of the earth, especially with significant drag and/or")
                logWriter.WriteLine("thrust. For zero-thrust problems, be sure to input zero nozzle exit ")
                logWriter.WriteLine("area to kill the power-off drag increment approximation -Patm*Ae.")
                logWriter.WriteLine("One quirk: to enforce your initial launch angle at zero initial velocity,")
                logWriter.WriteLine("you must input a small nonzero velocity, say, 0.01 fps. Because of the")
                logWriter.WriteLine("variable, velocity-dependent time step, the code will be very slow to ")
                logWriter.WriteLine("integrate low initial velocity problems -- say, under 100 fps.")
                logWriter.Flush() ' Ensure data is written
            Catch ex As Exception
                Console.WriteLine("Error opening log file: " & ex.Message)
                copy = 0 ' Disable hard copy if there's an error
            End Try
        End If

        ' --- NEW: Outer loop for running multiple simulations ---
        ' --- NEW: Declare a flag to track the first run

        Dim isFirstRun As Boolean = True ' This variable is visible throughout the Main sub

        Dim runAnotherSimulation As Boolean = True

        Do While runAnotherSimulation
            ' Clear console for a new run, but only after the first one
            ' MODIFIED LINE: Use the 'isFirstRun' flag instead of 'time', 'x', 'y'
            If Not isFirstRun Then
                Console.Clear()
            End If

            ' Reset simulation-specific variables for each run
            Dim nFvac As Integer = 0
            Dim Ae As Double = 0.0
            Dim nWo As Integer = 0
            Dim ncd As Integer = 0
            Dim Aref As Double = 0.0
            Dim Wnp As Double = 0.0
            Dim converge As Double = 0.0
            Dim time As Double = 0.0
            Dim Vi As Double = 0.0
            Dim dangli As Double = 0.0
            Dim x As Double = 0.0
            Dim y As Double = 0.0
            Dim angli As Double = 0.0
            Dim xd As Double = 0.0
            Dim yd As Double = 0.0
            Dim limit As Double = 0.0
            Dim max As Double = 0.0
            Dim min As Double = 0.0

            Dim i As Integer ' Loop counter
            Dim parts() As String ' For splitting input strings

            ' QuickBASIC arrays are 1-based by default when declared with TO.
            ' To replicate this in VB.NET, we explicitly dimension from 1.
            ' These arrays retain their size but their contents will be overwritten by input
            Dim Ftimes(0 To 10) As Double
            Dim Fvacs(0 To 10) As Double
            Dim Wtimes(0 To 10) As Double
            Dim Wos(0 To 10) As Double
            Dim Ms(0 To 10) As Double
            Dim cds(0 To 10) As Double

            ' Input rocket thrust model
            Console.WriteLine("Code requires arrays for vacuum thrust vs time and motor mass vs time")
            Console.WriteLine()
            Do
                Console.Write("how many points in the vacuum thrust vs time curve (1 to 10 max) ")
                inputStr = Console.ReadLine()
                inputParsed = Integer.TryParse(inputStr, nFvac) AndAlso nFvac >= 1 AndAlso nFvac <= 10
                If Not inputParsed Then
                    Console.WriteLine("Invalid input. Please enter a number between 1 and 10.")
                End If
            Loop While Not inputParsed
            Console.WriteLine()
            For i = 1 To nFvac
                Do
                    Console.Write("Point {0}: time, sec, and vacuum thrust, pounds (e.g., 0 100) ", i)
                    inputStr = Console.ReadLine()
                    parts = inputStr.Split(" "c) ' Split by space
                    inputParsed = False
                    If parts.Length >= 2 Then
                        If Double.TryParse(parts(0), Ftimes(i)) AndAlso Double.TryParse(parts(1), Fvacs(i)) Then
                            inputParsed = True
                        End If
                    End If
                    If Not inputParsed Then
                        Console.WriteLine("Invalid input format. Please enter two numbers separated by space.")
                    End If
                Loop While Not inputParsed
            Next i
            Console.WriteLine()

            Do
                Console.Write("what is the nozzle exit area, inch2 ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, Ae)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed
            Console.WriteLine()

            Do
                Console.Write("how many points in the motor mass vs time curve (1 to 10 max) ")
                inputStr = Console.ReadLine()
                inputParsed = Integer.TryParse(inputStr, nWo) AndAlso nWo >= 1 AndAlso nWo <= 10
                If Not inputParsed Then
                    Console.WriteLine("Invalid input. Please enter a number between 1 and 10.")
                End If
            Loop While Not inputParsed
            Console.WriteLine()
            For i = 1 To nWo
                Do
                    Console.Write("Point {0}: time, sec, and motor mass, pounds-mass (e.g., 0 50) ", i)
                    inputStr = Console.ReadLine()
                    parts = inputStr.Split(" "c)
                    inputParsed = False
                    If parts.Length >= 2 Then
                        If Double.TryParse(parts(0), Wtimes(i)) AndAlso Double.TryParse(parts(1), Wos(i)) Then
                            inputParsed = True
                        End If
                    End If
                    If Not inputParsed Then
                        Console.WriteLine("Invalid input format. Please enter two numbers separated by space.")
                    End If
                Loop While Not inputParsed
            Next i

            ' Input vehicle drag model
            Console.WriteLine()
            Console.WriteLine("Code requires an array of drag coefficients vs flight Mach number")
            Console.WriteLine()
            Do
                Console.Write("how many points in the cd vs Mach curve (1 to 10 max) ")
                inputStr = Console.ReadLine()
                inputParsed = Integer.TryParse(inputStr, ncd) AndAlso ncd >= 1 AndAlso ncd <= 10
                If Not inputParsed Then
                    Console.WriteLine("Invalid input. Please enter a number between 1 and 10.")
                End If
            Loop While Not inputParsed
            Console.WriteLine()
            For i = 1 To ncd
                Do
                    Console.Write("Point {0}: Mach number and cd (e.g., 0 0.5) ", i)
                    inputStr = Console.ReadLine()
                    parts = inputStr.Split(" "c)
                    inputParsed = False
                    If parts.Length >= 2 Then
                        If Double.TryParse(parts(0), Ms(i)) AndAlso Double.TryParse(parts(1), cds(i)) Then
                            inputParsed = True
                        End If
                    End If
                    If Not inputParsed Then
                        Console.WriteLine("Invalid input format. Please enter two numbers separated by space.")
                    End If
                Loop While Not inputParsed
            Next i
            Console.WriteLine()

            Do
                Console.Write("what is the reference area for cd, inch2 ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, Aref)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed

            ' Input other data
            Console.WriteLine()
            Do
                Console.Write("What is the nonpropulsive mass, pounds-mass ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, Wnp)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed
            Console.WriteLine()

            Do
                Console.Write("What fraction of velocity is the allowable velocity increment ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, converge)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed

            ' Input the initial conditions
            Console.WriteLine()
            Do
                Console.Write("initial time, sec ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, time)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed
            Do
                Console.Write("initial velocity, feet/sec ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, Vi)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed
            Do
                Console.Write("initial path angle, degrees, positive upward ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, dangli)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed
            Do
                Console.Write("initial range, feet ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, x)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed
            Do
                Console.Write("initial altitude, feet ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, y)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed

            angli = dangli * pi / 180.0
            xd = Vi * Math.Cos(angli)
            yd = Vi * Math.Sin(angli)

            ' Input the stopping conditions
            Console.WriteLine()
            Do
                Console.Write("what is the max problem time, sec ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, limit)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed
            Do
                Console.Write("what is the max range, feet ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, max)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed
            Do
                Console.Write("what is the min altitude, feet ")
                inputStr = Console.ReadLine()
                inputParsed = Double.TryParse(inputStr, min)
                If Not inputParsed Then Console.WriteLine("Invalid input. Please enter a number.")
            Loop While Not inputParsed


            ' Echo the inputs
            Console.Clear() ' CLS
            Console.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}", "Wnp,lbm", "Aref,in2", "Ae,in2", "delV/V")
            Console.WriteLine("{0,-12:F6}{1,-12:F6}{2,-12:F6}{3,-12:F6}", Wnp, Aref, Ae, converge)
            Console.WriteLine()
            Console.WriteLine("{0,-12}{1,-12}{2}", "time,sec", "Fvac,lb", "Vacuum thrust curve")
            For i = 1 To nFvac
                Console.WriteLine("{0,-12:F6}{1,-12:F6}", Ftimes(i), Fvacs(i))
            Next i
            Console.WriteLine()
            Console.WriteLine("hit any key to continue")
            Console.ReadKey(True)
            Console.WriteLine()
            Console.WriteLine("{0,-12}{1,-12}{2}", "time,sec", "mass,lbm", "Motor mass curve")
            For i = 1 To nWo
                Console.WriteLine("{0,-12:F6}{1,-12:F6}", Wtimes(i), Wos(i))
            Next i
            Console.WriteLine()
            Console.WriteLine("hit any key to continue")
            Console.ReadKey(True)
            Console.WriteLine()
            Console.WriteLine("{0,-12}{1,-12}{2}", "Mach", "cd", "Drag coefficient vs Mach number curve")
            For i = 1 To ncd
                Console.WriteLine("{0,-12:F6}{1,-12:F6}", Ms(i), cds(i))
            Next i
            Console.WriteLine()
            Console.WriteLine("hit any key to continue")
            Console.ReadKey(True)
            Console.WriteLine()
            Console.WriteLine("Initial Conditions")
            Console.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", "time,sec", "range,ft", "alt,ft", "vel,fps", "angl,deg")
            Console.WriteLine("{0,-12:F6}{1,-12:F6}{2,-12:F6}{3,-12:F6}{4,-12:F6}", time, x, y, Vi, dangli)
            Console.WriteLine("{0,-12}{1,-12:F6}{2,-12:F6}", " ", "xdot,fps", "ydot,fps")
            Console.WriteLine("{0,-12}{1,-12:F6}{2,-12:F6}", " ", xd, yd)
            Console.WriteLine()
            Console.WriteLine("Stopping Conditions")
            Console.WriteLine("{0,-12}{1,-12}{2,-12}", "max t,sec", "max x,ft", "min y,ft")
            Console.WriteLine("{0,-12:F6}{1,-12:F6}{2,-12:F6}", limit, max, min)

            If copy > 0 Then
                If logWriter IsNot Nothing Then
                    logWriter.WriteLine()
                    logWriter.WriteLine("    ECHO OF INPUT DATA ")
                    logWriter.WriteLine()
                    logWriter.WriteLine("{0,-12}{1,-12}{2,-12}", "Wnp,lbm", "Aref,in2", "Ae,in2")
                    logWriter.WriteLine("{0,-12:F6}{1,-12:F6}{2,-12:F6}", Wnp, Aref, Ae)
                    logWriter.WriteLine()
                    logWriter.WriteLine("{0,-12}{1,-12}{2}", "time,sec", "Fvac,lb", "Vacuum thrust curve")
                    For i = 1 To nFvac
                        logWriter.WriteLine("{0,-12:F6}{1,-12:F6}", Ftimes(i), Fvacs(i))
                    Next i
                    logWriter.WriteLine()
                    logWriter.WriteLine("{0,-12}{1,-12}{2}", "time,sec", "mass,lbm", "Motor mass curve")
                    For i = 1 To nWo
                        logWriter.WriteLine("{0,-12:F6}{1,-12:F6}", Wtimes(i), Wos(i))
                    Next i
                    logWriter.WriteLine()
                    logWriter.WriteLine("{0,-12}{1,-12}{2}", "Mach", "cd", "Drag coefficient vs Mach number curve")
                    For i = 1 To ncd
                        logWriter.WriteLine("{0,-12:F6}{1,-12:F6}", Ms(i), cds(i))
                    Next i
                    logWriter.WriteLine()
                    logWriter.WriteLine("Initial Conditions")
                    logWriter.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", "time,sec", "range,ft", "alt,ft", "vel,fps", "angl,deg")
                    logWriter.WriteLine("{0,-12:F6}{1,-12:F6}{2,-12:F6}{3,-12:F6}{4,-12:F6}", time, x, y, Vi, dangli)
                    logWriter.WriteLine("{0,-12}{1,-12:F6}{2,-12:F6}", " ", "xdot,fps", "ydot,fps")
                    logWriter.WriteLine("{0,-12}{1,-12:F6}{2,-12:F6}", " ", xd, yd)
                    logWriter.WriteLine()
                    logWriter.WriteLine("Stopping Conditions")
                    logWriter.WriteLine("{0,-12}{1,-12}{2,-12}", "max t,sec", "max x,ft", "min y,ft")
                    logWriter.WriteLine("{0,-12:F6}{1,-12:F6}{2,-12:F6}", limit, max, min)
                    logWriter.Flush()
                End If
            End If

            Console.WriteLine()
            Console.WriteLine("we are now ready to fly -- hit any key to continue")
            Console.ReadKey(True)

            Dim count As Integer = 0 ' count% becomes count As Integer
            Dim code As Integer = 0 ' To store termination code
            Dim terminateLoop As Boolean = False ' Reset for each run

            If copy > 0 Then
                If logWriter IsNot Nothing Then
                    logWriter.WriteLine()
                    logWriter.WriteLine("    TRAJECTORY PERFORMANCE DATA LISTING ")
                    logWriter.WriteLine()
                    logWriter.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", "time,sec", "x,ft", "xd,fps", "xdd,fps2", "sumFx,lb")
                    logWriter.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", "delt,sec", "y,ft", "yd,fps", "ydd,fps2", "sumFy,lb")
                    logWriter.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", " ", "vel,fps", "angl,deg", "Mach no.", "qamb,psf")
                    logWriter.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", " ", "thrust,lb", "drag,lb", "veh.mass,lbm", "veh.wt.,lb")
                    logWriter.Flush()
                End If
            End If

            ' THIS IS WHERE WE ACTUALLY "FLY" IN THE CODE

            ' Iteration loop starts here (replacing GOTO 10)
            Do While Not terminateLoop
                count += 1 ' count% = count% + 1

                If count <= 1 Then
                    Console.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", "time,sec", "x,ft", "xd,fps", "xdd,fps2", "sumFx,lb")
                    Console.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", "delt,sec", "y,ft", "yd,fps", "ydd,fps2", "sumFy,lb")
                    Console.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", " ", "vel,fps", "angl,deg", "Mach no.", "qamb,psf")
                    Console.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}{4,-12}", " ", "thrust,lb", "drag,lb", "veh.mass,lbm", "veh.wt.,lb")
                End If

                ' First let's check for stopping conditions
                If time > limit Then
                    code = 1
                    terminateLoop = True
                ElseIf y < min Then ' Use ElseIf for mutually exclusive conditions
                    code = 2
                    terminateLoop = True
                ElseIf Math.Abs(x) > max Then
                    code = 3
                    terminateLoop = True
                End If

                If terminateLoop Then Exit Do ' Exit the Do While loop

                ' THIS IS THE ONE-PASS POSITION/VELOCITY UPDATE LOGIC

                ' Solve for the forces and dynamics at the current pos & vel & time
                Dim vel As Double = Math.Sqrt(xd * xd + yd * yd)
                If Math.Abs(xd) < 0.000000001 Then ' 1E-09 is 1e-09 in VB.NET
                    xd = 0.000000001
                End If
                Dim angl As Double = Math.Atan2(yd, xd) ' ATN(yd / xd) is prone to issues when xd is 0. Math.Atan2 is safer.
                Dim h As Double = y
                Dim pamb As Double = 0.0 ' Declare before Call
                Dim Tamb As Double = 0.0 ' Declare before Call
                atmos(h, pamb, Tamb) ' CALL atmos(h, pamb, Tamb)

                Dim c As Double = 49.02 * Math.Sqrt(Tamb)
                Dim Mach As Double = vel / c
                Dim Fvac As Double = 0.0 ' Declare before Call
                intrp(nFvac, Fvacs, Ftimes, time, Fvac) ' CALL intrp(nFvac%, Fvacs(), Ftimes(), time, Fvac)

                If Fvac < 0 Then
                    Fvac = 0
                End If
                Dim Fth As Double = Fvac - pamb * Ae
                Dim qamb As Double = 0.7 * pamb * Mach * Mach
                Dim cd As Double = 0.0 ' Declare before Call
                intrp(ncd, cds, Ms, Mach, cd) ' CALL intrp(ncd%, cds(), Ms(), Mach, cd)

                Dim D As Double = cd * qamb * Aref
                Dim Wo As Double = 0.0 ' Declare before Call
                intrp(nWo, Wos, Wtimes, time, Wo) ' CALL intrp(nWo%, Wos(), Wtimes(), time, Wo)

                Wo = Wo + Wnp
                Dim m As Double = Wo / gc
                Dim g As Double = gc * (RE * RE) / ((h + RE) * (h + RE))
                Dim W As Double = m * g
                Dim Fx As Double = (Fth - D) * Math.Cos(angl)
                Dim Fy As Double = (Fth - D) * Math.Sin(angl) - W
                Dim xdd As Double = Fx / m
                Dim ydd As Double = Fy / m

                ' First order of business is to set the time step delt
                Dim Vd As Double = Math.Sqrt(xdd * xdd + ydd * ydd)
                Dim delt As Double = Math.Abs(converge * vel / Vd)
                If delt < 0.001 Then
                    delt = 0.001
                End If

                ' Print what you know at where and when you are
                Dim dangl As Double = angl * 180.0 / pi
                Dim bigq As Double = qamb * 144.0

                ' Replicating PRINT USING
                Console.WriteLine()
                Console.WriteLine("{0,12:F6}{1,12:F6}{2,12:F6}{3,12:F6}{4,12:F6}", time, x, xd, xdd, Fx)
                Console.WriteLine("{0,12:F6}{1,12:F6}{2,12:F6}{3,12:F6}{4,12:F6}", delt, y, yd, ydd, Fy)
                Console.WriteLine("{0,12:F6}{1,12:F6}{2,12:F6}{3,12:F6}{4,12:F6}", dummy, vel, dangl, Mach, bigq)
                Console.WriteLine("{0,12:F6}{1,12:F6}{2,12:F6}{3,12:F6}{4,12:F6}", dummy, Fth, D, Wo, W)

                If copy > 0 Then
                    If logWriter IsNot Nothing Then
                        logWriter.WriteLine()
                        logWriter.WriteLine("{0,12:F6}{1,12:F6}{2,12:F6}{3,12:F6}{4,12:F6}", time, x, xd, xdd, Fx)
                        logWriter.WriteLine("{0,12:F6}{1,12:F6}{2,12:F6}{3,12:F6}{4,12:F6}", delt, y, yd, ydd, Fy)
                        logWriter.WriteLine("{0,12:F6}{1,12:F6}{2,12:F6}{3,12:F6}{4,12:F6}", dummy, vel, dangl, Mach, bigq)
                        logWriter.WriteLine("{0,12:F6}{1,12:F6}{2,12:F6}{3,12:F6}{4,12:F6}", dummy, Fth, D, Wo, W)
                        logWriter.Flush()
                    End If
                End If

                If count >= 3 Then
                    count = 0
                    Console.WriteLine()
                    Console.WriteLine("hit any key to continue")
                    Console.ReadKey(True) ' Changed from Thread.Sleep to Console.ReadKey(True)
                End If

                ' Now compute the new pos & vel at time t + delt & update the time
                x = 0.5 * xdd * delt * delt + xd * delt + x
                y = 0.5 * ydd * delt * delt + yd * delt + y
                xd = xdd * delt + xd
                yd = ydd * delt + yd
                time = time + delt

                ' THIS ENDS THE ONE-PASS UPDATE LOGIC
            Loop

            ' Label 99 replacement
            Console.WriteLine()
            Select Case code
                Case 1
                    Console.WriteLine("TERMINATION ON MAXIMUM PROBLEM TIME, SEC = {0}", limit)
                Case 2
                    Console.WriteLine("TERMINATION ON ALTITUDE BELOW MINIMUM, FT = {0}", min)
                Case 3
                    Console.WriteLine("TERMINATION ON RANGE BEYOND MAXIMUM, FT = {0}", max)
            End Select

            If copy > 0 Then
                If logWriter IsNot Nothing Then
                    logWriter.WriteLine()
                    Select Case code
                        Case 1
                            logWriter.WriteLine("TERMINATION ON MAXIMUM PROBLEM TIME, SEC = {0}", limit)
                        Case 2
                            logWriter.WriteLine("TERMINATION ON ALTITUDE BELOW MINIMUM, FT = {0}", min)
                        Case 3
                            logWriter.WriteLine("TERMINATION ON RANGE BEYOND MAXIMUM, FT = {0}", max)
                    End Select
                    logWriter.Flush()
                End If
            End If

            ' NEW: Set the flag to False after the first run is complete
            isFirstRun = False

            ' --- NEW: Ask to run again ---
            Console.WriteLine()
            Console.Write("Do you want to run another simulation (Y/N)? ")
            inputStr = Console.ReadLine().Trim().ToUpper()
            If inputStr <> "Y" Then
                runAnotherSimulation = False
            End If
            ' --- END NEW ---

        Loop ' End of Do While runAnotherSimulation

        ' Final cleanup (like closing logWriter)
        If logWriter IsNot Nothing Then
            logWriter.Close()
            logWriter.Dispose()
        End If

        Console.WriteLine("Program finished. Press any key to exit.")
        Console.ReadKey(True) ' Wait for final key press before console closes

    End Sub

    ' SUB atmos (h, p, T)
    Public Sub atmos(ByVal h As Double, ByRef p As Double, ByRef T As Double)
        ' STANDARD ATMOSPHERE TO THE STRATOPAUSE -- 65,000 ft max
        ' Code is based on relations given in R.von Mises "Theory of Flight"

        Dim p0 As Double = 14.7
        Dim T0 As Double = 519.0
        Dim p1p0 As Double = 0.23135
        Dim T1 As Double = 393.0
        Dim h1 As Double = 35332.0

        If h <= h1 Then
            Dim pp0 As Double = Math.Pow((1.0 - 0.00000688 * h), 5.256)
            p = p0 * pp0
            T = 519.0 - 0.003566 * h
        Else
            ' IF h > h1 THEN
            Dim pp1 As Double = Math.Exp(-0.0000478 * (h - h1))
            p = p0 * p1p0 * pp1
            T = T1
        End If
    End Sub

    ' SUB intrp (n%, v(), u(), x, y)
    Public Sub intrp(ByVal n As Integer, ByVal v() As Double, ByVal u() As Double, ByVal x As Double, ByRef y As Double)
        ' This routine performs linear interpolation between abscissa array "u" and
        ' ordinate array "v" for interpolated ordinate "y" based upon abscissa "x".
        ' The only restriction is that array "u" must monotonically increase with
        ' increasing index "i".

        ' --- ADDED: Handle cases with insufficient data points for interpolation ---
        If n < 1 Then
            y = 0.0 ' No data points, cannot interpolate.
            Return
        ElseIf n = 1 Then
            y = v(1) ' Only one data point. Return the value at that point.
            Return
        End If
        ' --- END ADDED ---

        Dim j As Integer = 1

        For i As Integer = 1 To n
            If x >= u(i) Then ' Use >= to find the correct segment
                j = i
            Else
                ' If x is less than u(i), we've gone past the segment.
                ' The current j is the right segment start.
                Exit For
            End If
        Next i

        ' Ensure j is within valid bounds for interpolation (j and j+1)
        If j >= n Then ' If x is greater than or equal to the last point, use the last segment
            j = n - 1
        End If

        If j < 1 Then ' If x is less than the first point, use the first segment (u(1) to u(2))
            j = 1
        End If

        ' Calculate f
        Dim denominator As Double = (u(j + 1) - u(j))
        Dim f As Double
        If Math.Abs(denominator) < Double.Epsilon Then ' Use a small epsilon to check for near-zero
            f = 0.0 ' If interval is zero (duplicate x-values), assume no change
        Else
            f = (x - u(j)) / denominator
        End If

        y = v(j) + f * (v(j + 1) - v(j))
    End Sub

End Module

(th)

Offline

Like button can go here

#549 2025-07-01 08:44:11

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

This is a follow up to #548

As a mini-Milestone, I just got the Visual Basic version of XYTRAJ running in Visual Studio 2008 on a 32 bit machine.

This is significant because 64 bit machines have a built-in 32 bit emulation mode, and I have found that .Net program generated on the 32 bit machine will run on 64 bit Windows without difficulty.

My next step will be to see if the 32 bit EXE runs on one of my Windows 10 machines.

I expect it will but we'll see.

As a reminder for anyone reading this post out of the blue, we started with a 16 bit program that runs on a 32 bit machine but not on a 64 bit one, because the 32 bit machine has a 16 bit emulation mode.

We've updated the source code from 1990 to 2019, and now dropped back to 2008, where it runs happily as a 32 bit program.

(th)

Offline

Like button can go here

#550 2025-07-01 08:58:17

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,717

Re: GW Johnson Postings and @Exrocketman1 YouTube videos

For GW Johnson re RGClark's post about throat adjustment vs bell adjustment.

This is a fascinating topic and I hope you and RGClark will pursue it further.

I doubt that RGClark reads any topics other than the ones where he posted, so I'm hoping you will read this one.

The problem you have identified (as I remember it) is that if a rocket engineer puts a vacuum bell on an engine and fires that engine at sea level, the forces generated will cut the bell at the point decreed by physics. 

In a recent post, RGClark asked if modifying the throat might reduce or eliminate that problem.

You came back with a report that you had actually participated in an experiment doing something like that.

I hope you and RGClark will pursue this will-of-the-wisp further.  I doubt it will lead to anything, but at least it is another opportunity for NewMars members and readers to learn a bit more rocket science.

(th)

Offline

Like button can go here

Board footer

Powered by FluxBB