How do I force a zero value in Simscape language
이전 댓글 표시
I have the following equation inside my custom Simscape block.
Mloc == sqrt( (Pratio^(gm1/-A.gam) * (1+(gm1/2)*Minf^2) - 1) * (2/gm1) );
I am encountering an issue where Pratio is near 1.0 and Minf is near zero, however rounding errors are causing the value inside the sqrt to become negative. How do I force the value inside the sqrt to remain non-negative? Here are some example numbers showing this situation.
sqrt(((14.715780533017/14.715780064774)^(0.4/-1.4) * (1+(0.4/2)*0.0001079^2) - 1) * (2/0.4))
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Brakes and Detents에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!