Official discussion forum of The Mars Society and MarsNews.com

You are not logged in.

- Topics: Active | Unanswered

Announcement: As a reader of NewMars forum, we have opportunities for you to assist with technical discussions in several initiatives underway. NewMars needs volunteers with appropriate education, skills, talent, motivation and generosity of spirit as a highly valued member. Write to newmarsmember * gmail.com to tell us about your ability's to help contribute to NewMars and become a registered member.

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Here is the MATLAB/octave version:

Note that nargin stands for the number of input arguments

and that my default value for mu=6.672E-11 is wrong.

[code:1]Function y=Hohmann_P(r1, r2, mu)

if nargin<3; mu=6.672E-11; % (N m^2 Kg^-2)

y = Sqrt(mu / r1) * Sqrt(2 * r2 / (r1 + r2) - 1);

End Function[/code:1]

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Anyone Every Look at the MATLAB visual basic builder from excel? I think it allows you to use MATLAB functions form Excel. Check it out.

Illustration 4: Calling myplot

More inportantly this will alows you to advantage of MATLABs plotting features form excel. In my opnion MATLAB plots are far superiour to excel plots.

Elements of a MATLAB Builder for Excel Project

A project consists of all the elements necessary to build a deployable application using MATLAB Builder for Excel. Excel builder components are COM objects accessible from Microsoft Excel through Visual Basic for Applications. COM is an acronym for Component Object Model, which is Microsoft's binary standard for object interoperability. Each COM object exposes a class to the Visual Basic programming environment. The class contains a set of functions called methods, corresponding to the original MATLAB functions included in the component's project.

Also see: Building a Deployable Application So if I just need MATLAB figures I can create Deployable library’s that VB can access and use these figures. I am not sure of the licensing issues though.

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

I'm thinking of renaming the function Hohmann_DV_P as opposed to Hohmann_P

to stand for hohmann departure delta V. The reason being is there could be several things we wish to calculate for a Hohmann trajectory and I would like to keep them seperate.

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Did some google searches. Maybe I should see what is out there first before I program to much:

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

I was looking back some posts in this thread and I realized the cross product was the best way to get the normal vector for the orbital plane and two sets of orthogonal basis vectors that lie in the plane. I will post my corrections on the web soon enough along with code to calculate this plane.

I was thinking about what was the most important thing to calculate. I was thinking a three dimensional plot might be nice plotting, the fraction of the year which you can depart from earth and reach mars with a given delta V in a given time.

We already have a plot of the mass fraction vs delta v for a bunch curves with constant ISP. Another nice plot might be the average delta v that can be delivered in a given time for a given thrust level. The average delta v will be defined as (v2-v1)/(t2-t1). I think a ship that can deliver the same average delta v in a given time frame should be able to reach close to the same point in phase space in that time frame if not exactly the same point.

Dig into the political grab bag at Child Civilization

Offline

**ftlwright****Member**- Registered: 2004-11-17
- Posts: 61

There's a sourceforge project called ORSA that would fit the bill for this. I've used it a couple times and it pretty capable for what your doing now. Also, it's available on Windows, Linux/UNIX and MacOSX. Why worry about the code when others have .

Have fun!

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Here is an updated version of stuff to do with finding the orbit and finding the ellipse. It is in word. I tried to post it in html but geocites won't let me post all the files. Does anyone know a better free hosting place.

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

There's a sourceforge project called ORSA that would fit the bill for this. I've used it a couple times and it pretty capable for what your doing now. Also, it's available on Windows, Linux/UNIX and MacOSX. Why worry about the code when others have .

Looks pretty cool. I will have to investigate it further.

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Look What I found.

http://www.freewebspace.net/

A discussion board devoted to free web housting.

http://www.free-webhosts.com/

This might be a cool place to host but I got to make 10 posts first for some reason.

http://www.trap17.com/forums/index.php?act=portal

I emailed angel fire and they accepted added the file extention I wanted to the allowed file extension list.

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Here is the html version for findining the plane and the ellipse.

Dig into the political grab bag at Child Civilization

Offline

**ERRORIST****Member**- From: OXFORD ALABAMA
- Registered: 2004-01-28
- Posts: 1,182

So how would my pipeline equation look using this program?

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

So how would my pipeline equation look using this program?

If you don’t respond in the right thread I am not going to reply to you. This thread is about orbital mechanics not pipelines. Quote the section you are replaying to and repost in the thread pipelines and space elevators.

Dig into the political grab bag at Child Civilization

Offline

**ERRORIST****Member**- From: OXFORD ALABAMA
- Registered: 2004-01-28
- Posts: 1,182

Sorry, I just thought this program would help. Please don't spank me! ???

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

I updated my orbital mechanics stuff. I thought I would post the result because it is kind of beautiful.

Consequently you can go to the [url=http://mathworld.wolfram.com/Circle-CircleIntersection.html]intersection

of both circles[/url] by starting at the center of the big circle given by the

position vector **m** (the location of mars at arival) and moving a distance

from the center of the big circle with position vector **m**

towards the center of the smaller circle with position vector **g** (the loacation of earth at departure). Then move in a perpendicular direction within the plane of the transfer ellipse a distance:

The overall result is the loacation of second foci of the transfer ellipse is given by

where R is the radius of the big circle r is the radius of

the small circle and d is the distance between the center of each circle. **a** is a unit vector normal to the transfer plane.

Dig into the political grab bag at Child Civilization

Offline

In the a few recent posts there has been some discussion (1,2,3) of the delta-v required to go to mars for various transit times. Until I work out the details my self, the numbers only mean so much to me. Thus, this thread is created to discuss the principles of orbital mechanics. I can only spend so much time learning this because I should be doing reading that is more relevant to my masters (My thesis will probably be a servo motor control system). My ultimate goal with this thread is to learn enough about orbital mechanics so that I can implement a model predictive control space flight system in MATLAB. If I construct such a control system I can then begin simulating various flight systems to see how quickly they can travel to mars and how robust they are to error. One step at a time.

John,

An excellent textbook is _Orbital Mechanics_ by John E. Prussing and Bruce A. Conway. Of particular interest is chapter 4 Lambert's Problem. In this chapter on page 62 is "Transfer Orbits Between Specified Points" and on page 75 "The Terminal Velocity Vectors"

I've made an excel spreadsheet that approximates Mars, Earth and an asteroid orbit of your choice. The elliptical orbits are approximated with 2000 sided polygons. The polygon approximations are rotated into place by a matrices made from orbital elements. Each vertice has time as well as spatial coordinates. Velocity vectors at each vertice are calculated.

If you like, I could send you this spreadsheet. But be forewarned it's 3 megabytes.

Hop's Orbital Mechanics Coloring Book - For kids from kindergarten to college.

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Maybe I will set up an FTP site on my web server soon so you can transfer it over. I am hosted

with www.trap17.com and I have 20 magabites of space free with no adds. I think I can upgrade

relatively easy too. I am interested in building an educational site centered around orbital

mechanics but with lots of links for people to learn about math and other stuff. I want lots of

examples of how to calculate this stuff by various methods, including spreadhseets (excell), by

hand, and programming languages (MATLAB Visual basic). I think you could probably shrink

the size of your spreadsheet if you tried creating some macros in visual basic but some pure

spread sheet examples will be good. Just give me some time. Maybe I will even try and set up

some web boards where registered users can add to the site. The text book sounds good. I think

someday I will get it but as far as the two point orbit problem I pretty much figured that one out

on my own. So I will wait on getting the book so my site doesn’t look too close to the text book.

Dig into the political grab bag at Child Civilization

Offline

**GraemeSkinner****Member**- From: Eden Hall, Cumbria
- Registered: 2004-02-20
- Posts: 563
- Website

In regards to the Matlab software, you can't even download a trial without having to fill in a licence request and then wait for them to contact you to discuss your needs

So I'll stick to a calculator for now I think.

Graeme

There was a young lady named Bright.

Whose speed was far faster than light;

She set out one day

in a relative way

And returned on the previous night.

--Arthur Buller--

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

In regards to the Matlab software, you can't even download a trial without having to fill in a licence request and then wait for them to contact you to discuss your needs

So I'll stick to a calculator for now I think.Graeme

You can use octave instead. It has the same syntax for matricies and plotting. It just doesn't have all the same tool boxes.

This link could be helpfull:

How to Build and Instal Octive

If you want to lear octive here is the documentation:

I also said I would try to create some macros for excell. So if you have excell then you could use those.

Dig into the political grab bag at Child Civilization

Offline

**GraemeSkinner****Member**- From: Eden Hall, Cumbria
- Registered: 2004-02-20
- Posts: 563
- Website

You can use octave instead. It has the same syntax for matricies and plotting. It just doesn't have all the same tool boxes.

Cheers John, downloading it now

Graeme

There was a young lady named Bright.

Whose speed was far faster than light;

She set out one day

in a relative way

And returned on the previous night.

--Arthur Buller--

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Cheers John, downloading it now

Tell me how it works. I havn't tried it yet. I will offer help I am quite good at MATLAB and I think octave is pretty much the same.

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

I've made an excel spreadsheet that approximates Mars, Earth and an asteroid orbit of your choice. The elliptical orbits are approximated with 2000 sided polygons. The polygon approximations are rotated into place by a matrices made from orbital elements. Each vertice has time as well as spatial coordinates. Velocity vectors at each vertice are calculated.

If you like, I could send you this spreadsheet. But be forewarned it's 3 megabytes.

Actually send it to me. I think email can handel 3 megabytes:

JohnCreighton_@hotmail.com

Dig into the political grab bag at Child Civilization

Offline

**GraemeSkinner****Member**- From: Eden Hall, Cumbria
- Registered: 2004-02-20
- Posts: 563
- Website

Tell me how it works. I havn't tried it yet. I will offer help I am quite good at MATLAB and I think octave is pretty much the same.

Installed and ran no problem, I'll have a proper play with it soon but it looks from first glance to be fairly good software.

Graeme

There was a young lady named Bright.

Whose speed was far faster than light;

She set out one day

in a relative way

And returned on the previous night.

--Arthur Buller--

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

I’m resurrecting this thread again because it occurred to me that if I put orbital calculations already done by some program in a look up table for every month or so that I could get the intermediate values though numeric integration without having to worry about using some sophisticated algorithm like a simplastic integrator. This way I could work within MATLAB and get good results without having to reinvent the weal and then I could add components as I need, depending on what I am trying to do.

Dig into the political grab bag at Child Civilization

Offline

**John Creighton****Member**- From: Nova Scotia, Canada
- Registered: 2001-09-04
- Posts: 2,401
- Website

Offline

**SpaceNut****Administrator**- From: New Hampshire
- Registered: 2004-07-22
- Posts: 21,841

This topic is now fixed from the forum software conversions from ikonboard which still have instruction in some posts.

The redirect was from the original wiki link.

The link within the wiki is not quite right as the id of topic uses a T and not ID for the viewtopic php instruction

This is the NewMars wiki home page we do not have any ability as of yet to add or modify its content but hopefully soon we will have a replacement.

Offline