rb-daspk 0.0.6-x86-mswin32-60 → 0.0.7-x86-mswin32-60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/examples/springmass.rb +1 -1
- data/lib/rb-daspk.rb +7 -3
- metadata +3 -3
data/examples/springmass.rb
CHANGED
@@ -81,7 +81,7 @@ end
|
|
81
81
|
# return code from solveFoeInitialValues
|
82
82
|
# 4 success (see DDASPK for all possible values)
|
83
83
|
#
|
84
|
-
idid = s.
|
84
|
+
idid = s.solve_for_initial_values(0,y,yprime,[0,0])
|
85
85
|
print " ----------------------------------------\n"
|
86
86
|
print " initial conditions\n"
|
87
87
|
print " x = #{y[0]}\n"
|
data/lib/rb-daspk.rb
CHANGED
@@ -32,6 +32,8 @@ require 'rubygems'
|
|
32
32
|
require 'ffi'
|
33
33
|
|
34
34
|
WINDOZE = Config::CONFIG['host_os'] =~ /mswin|mingw/
|
35
|
+
LINUX=RUBY_PLATFORM.downcase.include?("linux")
|
36
|
+
OSX=RUBY_PLATFORM.downcase.include?("darwin")
|
35
37
|
|
36
38
|
module FFI
|
37
39
|
class Pointer
|
@@ -56,10 +58,12 @@ end
|
|
56
58
|
|
57
59
|
module DASPKLIB
|
58
60
|
extend FFI::Library
|
59
|
-
if (
|
61
|
+
if (OSX) then
|
60
62
|
ffi_lib File.dirname(__FILE__) + '/libdaspk.dylib'
|
61
|
-
|
63
|
+
elsif (WINDOZE)
|
62
64
|
ffi_lib File.dirname(__FILE__) + '/daspk.dll'
|
65
|
+
elsif (LINUX)
|
66
|
+
ffi_lib File.dirname(__FILE__) + '/libdaspk.so'
|
63
67
|
end
|
64
68
|
|
65
69
|
callback :jac, [:pointer,:pointer,:pointer,:pointer,:pointer,:pointer,:pointer], :void
|
@@ -183,7 +187,7 @@ module DASPK
|
|
183
187
|
# 0 means it is a state (aka has derivative in the equations)
|
184
188
|
# 1 means it is an algebraic
|
185
189
|
#
|
186
|
-
def
|
190
|
+
def solve_for_initial_values(time,y,yprime,ialgs,init=1,mxnit=5,mxnj=6,mxnh=5,lsoff=0,stptol=0,epinit=0.01)
|
187
191
|
|
188
192
|
@mxnit = mxnit
|
189
193
|
@mxnj = mxnj
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb-daspk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: x86-mswin32-60
|
6
6
|
authors:
|
7
7
|
- Eric Meyers
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-19 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -31,9 +31,9 @@ extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
32
32
|
|
33
33
|
files:
|
34
|
-
- lib/daspk.dll
|
35
34
|
- lib/rb-daspk.rb
|
36
35
|
- examples/springmass.rb
|
36
|
+
- lib/daspk.dll
|
37
37
|
has_rdoc: true
|
38
38
|
homepage: http://rb-daspk.rubyforge.org
|
39
39
|
licenses: []
|