8/18/2010 3:07 PM | |
Joined: 10/22/2009 Last visit: 3/13/2023 Posts: 8 Rating:
|
So there is not a "magic" block to fix this issue, have to write a routine to do the averaging, right... |
8/18/2010 6:16 PM | |
Joined: 9/23/2005 Last visit: 12/5/2023 Posts: 4281 Rating:
|
Sorry, but you are right.. |
Denilson Pegaia |
|
3/10/2013 1:51 PM | |
Joined: 1/28/2009 Last visit: 12/5/2023 Posts: 6826 Rating:
|
Hello, This what I propose based on our discussion before in the Forum on solving ODEs. Numeric Methods to Solve ODEs(Ordinary Differential Equations )In the attachment you can find the PDF version of the block.There isone thing to be sure in S71200.If you find out , there is problem with variable "INTERVAL" in TIME,Simply you can consider it as "REAL" and omit part related to "TIME to Real" conversion. [code] //Y 1 //--=------------------------ //F A*S + B #T_INTERNAL := (DINT_TO_REAL(TIME_TO_DINT (#INTERVAL)))/1000.0; IF #REST=1 THEN #YOLD:=0; #YNEW:=0; #Y:=0; // REST:=0; ELSE #DELTA:= (#f - (#B*#YOLD))/#A; #YNEW := #YOLD + ( #DELTA* #T_INTERNAL ); #YOLD:=#YNEW; #Y:=#YNEW; END_IF; [/code] Best regards Hamid Hosseini Attachment1ST.pdf (1221 Downloads) |
This contribution was helpful to
1 thankful Users |
5/10/2013 4:00 PM | |
Posts: 9 Rating:
|
Does anyone have a sample program? please post. |
Follow us on