8/18/2010 3:07 PM | |
Joined: 10/22/2009 Last visit: 3/7/2024 Posts: 8 Rating: (0) |
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: 10/4/2024 Posts: 4349 Rating: (1446)
|
Sorry, but you are right.. |
Denilson Pegaia |
|
3/10/2013 1:51 PM | |
Joined: 1/28/2009 Last visit: 9/10/2024 Posts: 6849 Rating: (1365) |
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 (1423 Downloads) |
This contribution was helpful to1 thankful Users |
5/10/2013 4:00 PM | |
Posts: 9 Rating: (1) |
Does anyone have a sample program? please post. |
Follow us on