Revision 73, 0.7 kB
(checked in by smidl, 16 years ago)
|
presun pmsm dokoncen
|
-
Property svn:eol-style set to
native
|
Rev | Line | |
---|
[54] | 1 | #include <itpp/itbase.h> |
---|
| 2 | #include "../bdm/stat/libBM.h" |
---|
| 3 | |
---|
| 4 | #include "pmsm.h" |
---|
| 5 | |
---|
| 6 | using namespace itpp; |
---|
| 7 | |
---|
| 8 | //These lines are needed for use of cout and endl |
---|
| 9 | using std::cout; |
---|
| 10 | using std::endl; |
---|
| 11 | |
---|
| 12 | int main() |
---|
| 13 | { |
---|
| 14 | vec x0 = "100 120 100 2"; |
---|
| 15 | vec u0 = "1 1"; |
---|
| 16 | double h=1e-6; |
---|
| 17 | |
---|
| 18 | IMpmsm I; |
---|
| 19 | I.set_parameters ( 0.28, 0.003465, h, 0.1989, 1.5 ,4.0, 0.04, 0.0 ); |
---|
| 20 | |
---|
| 21 | vec x(x0); x(0) += h; |
---|
| 22 | cout << (I.eval(x,u0)-I.eval(x0,u0))/h <<endl; |
---|
| 23 | x=x0; x(1) += h; |
---|
| 24 | cout << (I.eval(x,u0)-I.eval(x0,u0))/h <<endl; |
---|
| 25 | x=x0; x(2) += h; |
---|
| 26 | cout << (I.eval(x,u0)-I.eval(x0,u0))/h <<endl; |
---|
| 27 | x=x0; x(3) += h; |
---|
| 28 | cout << (I.eval(x,u0)-I.eval(x0,u0))/h <<endl; |
---|
| 29 | cout << endl; |
---|
| 30 | mat A(4,4); |
---|
| 31 | I.dfdx_cond(x0,u0,A); |
---|
| 32 | |
---|
| 33 | cout <<A.T() << endl; |
---|
| 34 | //Exit program: |
---|
| 35 | return 0; |
---|
| 36 | |
---|
| 37 | } |
---|