How do I solve an equation with multiple symbolic variables with a condition on one of the variables?
3 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to program a concrete column interaction curve and one of the points needed is for a column in pure bending. I'm trying to solve for the values 'c' and 'fs' simultaneously, but I need the absolute values of fs to be limited to less than or equal to the yield stress of steel, Fy. Here is the code below:
Fy = 50;
B1 = 0.85;
rows = 3;
Es = 29000;
d = [2.5 7.5 12.5];
As = [5.08 2.54 5.08];
b =15;
fc = 4;
syms c fs
assume(abs(fs)<=Fy)
for i = 1:rows
fs(i) = (0.003/c)*(c-d(i))*Es
product(i) = As(i)*fs(i)
end
eqn = 0.85*fc*B1*c*b + sum(product) == 0
cM = solve(eqn,c);
cM = double(cM(cM >= 0));
fs = double(subs(fs,c,cM))
When I get my output, the absolute values of fs are still greater than Fy. Can anybody give me some advice? Thanks!
0 件のコメント
回答 (1 件)
Karan Gill
2017 年 11 月 14 日
編集済み: Karan Gill
2017 年 11 月 20 日
You should first solve the equation for c and then use that value to find fs.
Also, your problem sounds like an optimization problem. Consider the Optimization Toolbox: https://www.mathworks.com/help/optim/getting-started-with-optimization-toolbox.html.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!