Why is their an offset when I intergrate a simple sin(1*x) in simulink using the (1/s) block?

Their seems to be a -1 offset when I intergrate a sin(x) signal using a 1/s block. the sin(x) goes from -1 to 1 and the resulting intergation goes from 0 to 2? Is their a paramater i'm missing?

답변 (1개)

Ryan G
Ryan G 2013년 9월 10일
You need to set the initial condition of the integrator. I believe I cover this a bit in the intro to simulink webinar. This should help you ramp up if you're just getting started.

댓글 수: 2

I dont think this is the problem. The integral of sin(x) is -cos(x) as for the intial condition at t=0, sin(0)=0. In the 1/s block i set the itial condtion to be internal =0 and the result is still a cos(x) going from 0 to 2. My set up is simple I have a sin(x) going into a 1/s bock and I plot the two vs each other.
You're thinking of the solution analytically instead of numerically. The integral block only receives a value. It doesn't know if the value came from a sin , cos or a constant.
For example: At time t= 0 that value is into the integrator 0, time t=0.1 that value is sin(0.1)=0.0998 and the previous state (t=0) is 0. It will then integrate between those inputs using deltaT=0.1 with an IC of 0.
The time step changes dynamically based on the ODE45 (solver) algorithm tolerances.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 General Applications에 대해 자세히 알아보기

제품

태그

질문:

2013년 9월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by