# Balloon Ascent and Descent

조회 수: 1(최근 30일)
Demetris Shields 2020년 11월 20일
답변: Prudhvi Peddagoni 2020년 11월 24일
Hi, I'm currently working on a project within MATLAB that involves the altitude adjustment of a balloon within Venus' atmosphere. In actuality this program would be taking inputs from a BME280 sensor, however, we do not have access to one physically so the program currently runs off user inputs and allows for manual or automatic altitude adjustment. It is a very simple program that adjusts the balloons altitude depending on the desired altitude range. However, I would like to add options to ascend the balloon and descend the balloon at a certain rate. I'd like implement a rate of ascent of 1000 feet per minute (I pulled this rate from NASA weather balloon speeds). I've attached the program below. Also I'm a freshman in college and honestly have no idea how to approach this step of my program so any help is appreciated. This is also my first post so let me now if more information is needed.
% Unit for altitude inputs is in kilometers (km)
althigh = input('Please enter the highest desired altitude:\n');
altlow = input('Please enter the lowest desired altitude:\n');
altnow = input('Please enter the current altitude:\n');
% Automatic altitude adjustment is performed according to the mean of the highest desired altitude and lowest desired altitude
% Manual altitude adjustment is performed according to user input
if altnow > altlow && altnow <althigh
end
if altnow < altlow || altnow > althigh
mode = input('Balloon is outside of desired altitude range, please input whether adjustments should be made manually (1) or automatically (2)\n');
end
if mode == 1
fprintf('Manual altitude adjustment has been chosen.\n');
altnow = input('Please enter a desired altitude:\n');
elseif mode == 2 && altnow < altlow
fprintf('Automatic altitude adjustment has been chosen.\n');
altnow = altnow+((altlow+althigh)/2)-altnow;
elseif mode == 2 && altnow > althigh
fprintf('Automatic altitude adjustment has been chosen.\n');
altnow = altnow-(altnow-(altlow+althigh)/2);
end
% Future changes:
% Find rate of ascent and descent
% Add ascent and descent (from ground and to ground) options
% Look into adding RNG values to current altitude to help simulate atmospheric changes that may affect the balloons altitude.

댓글을 달려면 로그인하십시오.

### 답변(1개)

Prudhvi Peddagoni 2020년 11월 24일
Hi,
You can introduce another variable for denoting time. let's say t is such variable.
You can use while loop and increment t for every iteration. You can add another variable speed to indicate the speed of the balloon. If the speed is 2 (2 feet per second), then you will increment altnow variable by 2 for every iteration(i.e for every second).
Hope this helps.

댓글을 달려면 로그인하십시오.

### 범주

Find more on Weather and Atmospheric Science in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by