7/13/2012 9:52 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359)
|
Dear friends , This is an expansion to discussion previously made here: Laplace equations in Step7Simply this will provide all data and documents required for solving ODEs with SCL.Hopefully, first reading the document may help to refresh the Euler method. Best regards, Hamid Hosseini AttachmentODE.pdf (1370 Downloads) |
Last edited by: hdhosseini at: 6/28/2013 8:09 AM |
|
This contribution was helpful to6 thankful Users |
7/13/2012 10:31 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359)
|
3- Second order differential equations [code] FUNCTION_BLOCK FB3 //Y 1 //--=------------------------ //F A*S^2 + B*S +C VAR_INPUT // Input Parameters F:REAL; A:REAL:=1.0; B:REAL:=1.0; C:REAL:=1.0; INTERVAL:TIME:=T#1S; END_VAR VAR_IN_OUT REST:BOOL:=FALSE; END_VAR VAR_OUTPUT // Output Parameters Y:REAL; END_VAR VAR_TEMP // Temporary Variables END_VAR VAR // Static Variables // FNEW:REAL:=0.0; X1:REAL:=0.0; X2:REAL:=0.0; X1OLD:REAL:=0.0; X2OLD:REAL:=0.0; DELTA1:REAL:=0.0; DELTA2:REAL:=0.0; T_INTERNAL:REAL:=1.0; END_VAR // Instruction Section T_INTERNAL := (DINT_TO_REAL(TIME_TO_DINT (INTERVAL)))/1000.0; IF REST=1 THEN X1:=0.0; X2:=0.0; X1OLD:=0.0; X2OLD:=0.0; //REST:=0; Y:=0; ELSE DELTA2 :=(F- (C*X1OLD) - (B*X2OLD))/A; X2:= X2OLD + (DELTA2 * T_INTERNAL); DELTA1 :=X2; X1 := X1OLD + (DELTA1 * T_INTERNAL); X2OLD:= X2; X1OLD:=X1; Y:=X1; ; END_IF; ; END_FUNCTION_BLOCK [/code] AttachmentE3.zip (728 Downloads) |
This contribution was helpful to1 thankful Users |
11/18/2014 8:31 PM | |
Posts: 79 Rating: (1) |
you have F as input. what F stands for in your case Hameed? |
11/18/2014 11:03 PM | |
Posts: 79 Rating: (1) |
I am still lost. if possible a flow chart will help how the program works. thaks a lot.
|
11/19/2014 3:07 PM | |
Posts: 79 Rating: (1) |
Hi Hamid I attached simple pictures of how I understood this. Correct me if I am wrong. Thanks Ebrahim
Attachmentpics.zip (460 Downloads) |
11/20/2014 2:54 PM | |
Posts: 79 Rating: (1) |
anyone |
Last edited by: Ebrahim_1 at: 11/20/2014 2:55 PM |
|
8/28/2018 10:43 AM | |
Joined: 6/19/2017 Last visit: 4/19/2024 Posts: 7961 Rating: (162) |
New question published by johnnybtb is split to a separate thread with the subject Numeric Methods to Solve ODEs(Ordinary Differential Equations ) in TIA. Best regards |
My Forum is the place to personalize your profile, |
|
Follow us on