Numerical Inputs to Solve and Using the Output value

조회 수: 1 (최근 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 CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by