calculate the integral of sin of x
조회 수: 3 (최근 30일)
이전 댓글 표시
When I use a integrator in simulink to determine the integral of a sine function that should give to me a -cos(x), instead, it gives me -cos(x) with a bias of +1, why of this?
댓글 수: 0
채택된 답변
A Jenkins
2014년 1월 30일
No, the integral of sin(x) is -cos(x)+C. Now you must solve for C.
If you double click your integrator you will see that you have set your initial condition, y(0) by default to be 0. That is, y(0)=0=-cos(0)+C, so C=1.
If you would like the offset, C, to be zero, then you need to change your equation so that y(0)=-cos(0)+0, therefore y(0)=-1. Double click your integrator block and enter -1 instead of zero for the intial condition.
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Oil, Gas & Petrochemical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!