solving a multiple variable equation with variables that increment
古いコメントを表示
So my program is an attempt to create a simple wind tunnel simulator to test different projectiles. here is the script:
function answer = efficiency()
syms V C A
%% Drag force equation = (1/2)pV^2CA
%p = density of air = 0.00128 g/mL
%V = velocity = variable V
%C = Coefficient of drag = variable C
%A = Cross sectional area = function A
%F = 0.5 * 0.00128(g/mL) * V^2(m/s^2) * C * A(m)
%%Drag Coefficient
% Drag Coefficient of Sphere = 0.47
% Drag Coefficient of cone = 0.50
% Drag Coefficient of cube = 1.05
% Drag Coefficient of long cylinder = 0.82
% Selection of projectile shape
X = menu('projectile shape','sphere','cone','cube','cylinder','main menu');
if X == 1
C = 0.47;
elseif X == 2
C = 0.50;
elseif X == 3
C = 1.05;
elseif X == 4
C = 0.82;
elseif X ==5
C = WindTunnel();
end
%%Cross sectional area
% area of sphere = pi r^2
% area of cone = pi r^2
% area of cube = base * height
% area of long cylinder = pi r^2
for A = .1:.1:1
end
for V = 100:100:1000
end
answer = solve(.00064*C*A*V^2);
answer =
end
It is only outputing zeros for the solutions any help would be appreciated
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!