i am trying to solve a 4 set of eqn for only two variables using loop and solve(), but it isnt working
2 次查看(过去 30 天)
显示 更早的评论
%area(z) varies from z=1:101 but i need to specifically plot for interval (71<z<101)
%P2,P1,k,area@70, m2, At are known constants
%i only need to find mach(z) for corresponding area (z)
for z= 71:1:101
Eq1= AsAe(z)==(area(70)./area(z))*At;
Eq2= p2pe(z)==P2*P1*(1+0.5*(k-1)*mach(z).^2)^(k/(k-1));
Eq3= tet2(z)==(((1+0.5*(k-1)*mach(z).^2).^-1)*(1+0.5*(k-1)*m2^2)).^0.5;
Eq4= mach(z)==AsAe(z)*p2pe(z)*tet2(z)*m2;
S= solve([Eq1,Eq2,Eq3,Eq4],[mach]);
mach = double(S.mach);
mach(z)=mach;
end
figure(3);
plot(x,mach,'LineWidth',1.1);
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Oceanography and Hydrology 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!