Graphic optimization problem (matlab syntax)
Show older comments
I'm trying to minimize z = 0,1h^2 +0,8ht so we have two variables t and h. In this assignment, we have few constant variables:
E = 205000
F = 4000
L = 1500
Mt = F*L
sigma = 180
vsall = 14
First two restriction equations are easy
1) t <= h/8
2) t >= h/20
These were pretty easy imo:
t=linspace(5,15)
h=linspace(50,200)
[x1,y1]=meshgrid(t,h)
(5,15 and 50,200 are from my head, and good for this assignment)
rajoitus1 = x1 - y1/20
rajoitus2 = x1 - y1/8
contour (x1,y1,rajoitus1,[0,0])
contour (x1,y1,rajoitus2,[0,0])
Rajoitus = restriction in Finnish! These draw correct straight lines for the restriction 1 and 2.
Restriction 3/4 are bit more complex. They consist a variable Iz = Iz(t,h) which is defined under.
Iz = (1/24)*y1^4 - 1/30*y1*(y1-2*x1)^3
3) vsall >= (F*L^3)/(3*E*Iz)
4) sigma >= (Mt*y1/2) / Iz
When I'm trying to do same with these two as I did for the 1) and 2):
rajoitus3 = vsall - (F*L^3)/(3*E*Iz)
rajoitus4 = sigma - (Mt*y1/2) / Iz
Error for the restriction 3:
""Error using / Matrix dimensions must agree.""
Warning for the restriction 4:
"Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 6.143622e-35. "
What am I doing wrong? What do I have to do if I want to get these four "restriction lines" to same picture (t,h coordinate system)
Answers (0)
Categories
Find more on Ordinary Differential Equations 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!