Numerical Inputs to Solve and Using the Output value

2 ビュー (過去 30 日間)
Connie
Connie 2012 年 3 月 15 日
Hi,
I have a question about how to use solve. I want to solve an equation for 1 variable, where the other variables in the equation have been calculated as variables earlier in the function. I then want to use the solved for value as a number in later calculations. I seem to be going about this all wrong. Some help with how I could do this and what my errors are would be great.
function [ dVTot dVInit dVinf FinTOrbfbRa ] = vinfleverage(K,L,M,Dir,ParkR,PInitTran,fbRad)
%{
Input Assumptions:
K: Number of Earth Orbit revolutions
L:Number of spacecraft revolutions
M:Orbit of dV manuever
Dir: Pre or Post periapsis intercept
ParkR: Parking Orbit radius
PInitTran: Initial transfer orbit period
fbRad: Fly by radius
Outputs:
dVTot: Total dV for the entire manuever
dVInit: dV to leave inital parking orbit
dVinf: Vinf leveraging manuever delta V in deep space
FinTOrbfbRa: Final post-fly by apoapsis radius
%}
%Constants
Re = 149600000; %Earth orbit radius
MewS = 132700000000; %Standard gravitational parameter of the sun
MewE = 398600; %Standard gravitational parameter of the earth
Ve = sqrt(MewS/Re); %Velocity of the earth
%Velocity in the parking orbit
Vpark = sqrt(MewE/ParkR);
%Total inital velocity prior to burn
Vinit = Ve + Vpark;
%For the initial orbit, Rp = Re, find the initial apoapsis (and final?)
Ra_init = ( (((PInitTran/pi)^2)*2*MewS)^(1/3) )-Re;
%Use the initial apoapsis to solve for the initial transfer velocty
syms Vtran;
Vt = solve(Ra_init == (Re^2*Vtran^2)/(2*MewS-Re*Vtran), Vtran);

回答 (1 件)

Kevin Holst
Kevin Holst 2012 年 3 月 16 日
The problem may be that you're expecting a single value, but solve will return 2 values because it's actually quadratic.
What is the error message that you're getting? I'm not sure I have enough information here.

カテゴリ

Help Center および File ExchangeGravitation, Cosmology & Astrophysics についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by