What is the incorrect in this Simplex Method code?

1 次查看(过去 30 天)
clear all; close all;
if true
% code
end
clc;
FOS= input(' Enter the value for FOS= ');
F= input('Enter Force= ');
L= input('Length= ');
E= input('Enter Youngs Modulus for Material= ');
sigma_y= input('Yield Stress of the Material= ');
def= input(' Maximum allowable deflection= ');
A= F*(L)*FOS/sigma_y;
B= F*(L^3)/E*def;
M1=[A -1;
B -1];
M2= [1/6 ;1/4];
M3 = [-7 -1];
Aeq=[]; Beq=[]; x0=0; lb=[0,0]; ub=[inf,inf]; ans=linprog(M3,M1,M2,Aeq,Beq,lb,ub,x0)
if true
% code
end
when I run this code it results in the command window this:
Enter the value for FOS= 1.5 Enter Force= 1000 Length= 2000 Enter Youngs Modulus for Material= 200000 Yield Stress of the Material= 56 Maximum allowable deflection= 100 The dual-simplex algorithm uses a built-in starting point; ignoring supplied X0.
Problem is unbounded.
ans =
[]
  1 个评论
Stephan
Stephan 2018-10-20
编辑:Stephan 2018-10-20
Is it possible that you want to optimize the width and height of a beam clamped on one side, which is subjected to bending, under given conditions?
Why do i want to know this?
If so, you are really wrong by using linprog.
Then the question would not be how to get the current code to run, but how to formulate the optimization problem and which solver to use to get useful results.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by