forked from djuber/SciSmalltalk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Beckward Euler Method with prediction made by forward Euler wit…
…h test. Moved some metods from ExplicitSystem to ODESystem.
- Loading branch information
Showing
32 changed files
with
63 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
{ | ||
"class" : { | ||
"block:" : "DanielUber 5/22/2012 10:55" }, | ||
}, | ||
"instance" : { | ||
"block" : "DanielUber 5/22/2012 10:07", | ||
"block:" : "DanielUber 5/22/2012 10:10", | ||
"x:t:" : "DanielUber 5/22/2012 10:07" } } | ||
} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Math-ODE.package/ImplicitStepper.class/instance/doStep.time..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
as yet unclassified | ||
doStep: aState time: t | ||
"This method should take one step from inState at time t of size dt, and modify the state, then answer it. The default implementation here is Backward Euler Method with prediction made by forward Euler." | ||
self stepSize isNil ifTrue: [self error: 'step size required by stepper']. | ||
aState isNumber | ||
ifTrue: [^ (self stepSize * (system x: aState t: t) + aState)] | ||
"a collection" | ||
ifFalse: | ||
[(1 to: aState size) | ||
do: [ :i | | ||
| xi ti | | ||
ti := t + self stepSize. | ||
xi := aState at: i. | ||
aState at: xi + i put: (system x: xi t: ti )* self stepSize ]. | ||
^ aState.] |
5 changes: 5 additions & 0 deletions
5
Math-ODE.package/ImplicitStepper.class/instance/doStep.time.stepSize..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
as yet unclassified | ||
doStep: aState time: t stepSize: timeStep | ||
"This method should take one step from inState at time t of size dt, and modify the state, then answer it. The default implementation here is Beckward Euler Method with prediction made by forward Euler. " | ||
self stepSize: timeStep. | ||
^ self doStep: aState time: t. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
stepSize: timeStep | ||
dt := timeStep. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
stepSize | ||
^ dt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"block:" : "NataliaMoskovchuk 7/3/2013 23:12" }, | ||
"instance" : { | ||
} } | ||
"block" : "NataliaMoskovchuk 7/3/2013 23:12", | ||
"block:" : "NataliaMoskovchuk 7/3/2013 23:12", | ||
"x:t:" : "NataliaMoskovchuk 7/3/2013 23:14" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
], | ||
"commentStamp" : "<historical>", | ||
"instvars" : [ | ||
], | ||
"block" ], | ||
"name" : "ODESystem", | ||
"pools" : [ | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
Math-ODETests.package/ImplicitStepperTest.class/instance/testDoStepTimeStepSize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
as yet unclassified | ||
testDoStepTimeStepSize | ||
| stepper sys dt | | ||
sys := ImplicitSystem block: [:x :t | x * t]. | ||
stepper := ImplicitStepper onSystem: sys. | ||
dt := 0.1. | ||
self should: [(stepper doStep: 0 time: 10 stepSize: dt) = 0.0 ]. | ||
self should: [(stepper doStep: 10 time: 0 stepSize: dt) = 10.0 ]. | ||
self should: [(stepper doStep: 1 time: 1 stepSize: dt) = 1.1]. | ||
self should: [(stepper doStep: 10 time: 1 stepSize: dt) = 11.0]. |
5 changes: 5 additions & 0 deletions
5
Math-ODETests.package/ImplicitStepperTest.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"testDoStepTimeStepSize" : "NataliaMoskovchuk 7/3/2013 23:22" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
Math-ODETests.package/ImplicitSystemTest.class/instance/testXTYieldsAValue.st
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
Math-ODETests.package/ImplicitSystemTest.class/methodProperties.json
This file was deleted.
Oops, something went wrong.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...xplicitSystemTest.class/instance/setUp.st → ...age/ODESystemTest.class/instance/setUp.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
running | ||
setUp | ||
"create a dummy system" | ||
sys := ExplicitSystem new. | ||
sys := ODESystem new. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters