second order transfer function response issue

SANJEEV RACHABATHUNI
SANJEEV RACHABATHUNI Altair Community Member
edited November 2022 in Community Q&A

HI

I am using Altair Embed Tool.

In this study, I want to use the 2nd order transfer function in my application.
Embed has a provision to import direct Matlab Simulink .mdl models and it will convert Simulink blocks to embed blocks. First, I created a simple 2nd order transfer function with step input in Matlab/Simulink and imported it to embed. captured both Simulink and embed results, if I plot both, the Results are not matching, there is a small difference.
can you please help me where is the problem and how to fix it?

I am sharing block diagrams, test output data, and screenshots

Please check the attachment

Thank you,

Regards,

R Sanjeev

Answers

  • Sreeram Mohan_20368
    Sreeram Mohan_20368
    Altair Employee
    edited November 2022

    Hi Sanjeev,

    Are you sure on embed side and the other side the solvers and the step time are the same ? Just to be clear . 

    I am guessing it could be that you are trying variable step on one side and fixed step on the embed side. Could you check once please ?

     Also the export block Fixed interval is not matching the step time of the diagram which is 0.001 . This is something to try as well.

    Sreeram

  • SANJEEV RACHABATHUNI
    SANJEEV RACHABATHUNI Altair Community Member
    edited November 2022

    Hi Sir,

     

    Thank you for your response,

    1) I am sure both side Solvers are same, I am using Euler method on both sides and step time also same 

    2) I have checked again as you suggested, Both sides I am using fixed step only 

    3) Sharing screenshots of Export block properties and System properties, in export block also Fixed interval is 0.001 and System properties step size is also 0.001.

     

    If there is any modifications needed please suggest me i will try and update to you,

     

    Thankyou,

    R Sanjeev.

  • Anthony Boon_20414
    Anthony Boon_20414
    Altair Employee
    edited November 2022

    Hi Sanjeev,

    I had a look at your attached diagram and thank you for the clear explanation of your issue.

    Attached you will find a comparison done with the standard filters in the Digital Power Designer (DPD) of Embed, both as a continuous and as a discrete filter. You will see that the response is the same for all three filters, each one done using a different method.

    The diagram also includes calculated results for over-shoot, rise time and settling time. Since your example is of a standard 2nd order filter response, these equations can be analytically determined, or they can be commonly found in the literature in most Control Systems textbooks. You can see that the over-shoot and rise time measurements made are very accurate when compared to the expected calculated values of the 2nd order response. The main inaccuracy is due to the sample rate (which I increased to 100kHz for this measurement), and the crude method used to measure the transient parameters in the diagram. Similarly, the settling time is a little less accurate because of the way it is being measured. If the sample rate is increased (time step is decreased) further, the results for over-shoot and rise time will be even more accurate when compared to the expected calculated values, indicating that the response is correct and as expected.

    I have also attached a diagram without the DPD blocks in case you do not have the DPD addon installed so that you can still view the comparison with the analytical results.

    I hope that helps to find the cause of your issue.

    Anthony