Output issues with deformation calculation

I have been having some issues with a deformation calculator, the output is correct against my hand calculation, however I cannot figure how to have it output in mm,
%step bar internal force, internal stress and deformation calculator
syms FA1 FC2
format longEng
%A IS TOP POINT, B IS CENTRAL AND C IS BOTTOM
LAB=0.4;
LBC=0.5;
DAB=0.02;
DBC=0.06;
E=200e9;
%upwards +
FA= 10000;
FB= -30000;
eqn1= FA-FA1==0;
FAS = solve(eqn1,FA1)
FAS = 
10000
eqn2= FA+FB-FC2 ==0;
FCS= solve(eqn2,FC2)
FCS = 
AAB= (((DAB)/2)^2)* pi;
ABC= (((DBC)/2)^2)* pi;
SAB= (FAS)/(AAB)
SAB = 
SBC= (FCS)/(ABC)
SBC = 
DEFAB= (FAS*LAB)/(E*AAB)
DEFAB = 
DEFBC= (FCS*LBC)/(E*ABC)
DEFBC = 
DEFTOT= DEFAB+DEFBC
DEFTOT = 
%working but output is weird

1 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 10 月 6 日
In addition to @Torsten's answer, you can use vpa().
Also, note that changing display format is only applicable to numeric data types (and line spacing for that matter), whereas the output(s) you have obtained are symbolic numbers.

サインインしてコメントする。

 採用された回答

Torsten
Torsten 2023 年 10 月 6 日

0 投票

Use double(DEFAB) etc. to see the result in the usual notation.

その他の回答 (0 件)

タグ

質問済み:

2023 年 10 月 6 日

コメント済み:

2023 年 10 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by