Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
Offline uni  
#1 Posted : 13 July 2013 10:50:08(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
DotNumerics

SMath Studio compatibility SMath Viewer compatibility mono compatibility Extension page Sources


Functions list: dn_AdamsMoulton(5), dn_ExplicitRK45(5), dn_ImplicitRK5(5), dn_GearsBDF(5).


Differential Equations. Initial-value problem for nonstiff and stiff ordinary differential equations ODEs (explicit Runge-Kutta, implicit Runge-Kutta, Gear’s BDF and Adams-Moulton).

Solvers for Non-Stiff Systems:

dn_AdamsMoulton(init, x1, x2, intvls, D) solves an initial-value problem for nonstiff ordinary differential equations using the Adams-Moulton method.

dn_ExplicitRK45(init, x1, x2, intvls, D) solves an initial-value problem for nonstiff ordinary differential equations using the explicit Runge-Kutta method of order (4)5.


Solvers for Stiff Systems:

dn_ImplicitRK5(init, x1, x2, intvls, D) solves an initial-value problem for stiff ordinary differential equations using the implicit Runge-Kutta method of order 5.

dn_GearsBDF(init, x1, x2, intvls, D) solves an initial-value problem for stiff ordinary differential equations using the Gear’s BDF method.


Arguments:

- init is either a vector of n real initial values, where n is the number of unknowns (or a single scalar initial value, in the case of a single ODE).
- x1 and x2 are real, scalar endpoints of the interval over which the solution to the ODE(s) is evaluated. Initial values in init are the values of the ODE function(s) evaluated at x1.
- intvls is the integer number of discretization intervals used to interpolate the solution function. The number of solution points is the number of intervals + 1.
- D is a vector function of the form D(x,y) specifying the right-hand side of the system

Options:

- AbsTol - absolute tolerance parameter, default value 10⁻⁷.
- RelTol - relative tolerance parameter, default value 10⁻⁴.



Links:

1. DotNumerics is a website dedicated to numerical computing for .NET. DotNumerics includes a Numerical Library for .NET. The library is written in pure C# and has more than 100,000 lines of code with the most advanced algorithms for Linear Algebra, Differential Equations and Optimization problems. The Linear Algebra library includes CSLapack, CSBlas and CSEispack, these libraries are the translation from Fortran to C# of LAPACK, BLAS and EISPACK, respectively.

2. Arenstorf orbit. Numerical Analysis: Theory and Applications. Proseminar, 28.03.2011, UIBK [pdf].

3. How to find spatial periodic orbits around the Moon in the TBP.

Books:

1. Solving Ordinary Differential Equations II: Stiff and Differential-Algebraic Problems.



Examples:





dn.ode.kinetic1.sm (9kb) downloaded 50 time(s).
dn.ode.kinetic2.sm (13kb) downloaded 42 time(s).
dn.ode.kinetic3.sm (13kb) downloaded 41 time(s).
dn.ode.test1.sm (20kb) downloaded 46 time(s).
dn.ode.test2.sm (19kb) downloaded 45 time(s).
dn.ode.Amplitude detector.sm (21kb) downloaded 45 time(s).

dn.ode.kinetic1.pdf (78kb) downloaded 44 time(s).
dn.ode.kinetic2.pdf (94kb) downloaded 31 time(s).
dn.ode.kinetic3.pdf (92kb) downloaded 27 time(s).
dn.ode.test1.pdf (116kb) downloaded 28 time(s).
dn.ode.test2.pdf (121kb) downloaded 28 time(s).
dn.ode.Amplitude detector.pdf (149kb) downloaded 31 time(s).

Edited by user 04 December 2020 09:54:02(UTC)  | Reason: Not specified

File Attachment(s):
Arenstorf orbit.pdf (99kb) downloaded 102 time(s).
DotNumerics. ODE. Example 1.sm (10kb) downloaded 113 time(s).
DotNumerics. ODE. Example 2.sm (12kb) downloaded 68 time(s).
DotNumerics. ODE. Example 3.sm (10kb) downloaded 72 time(s).
DorNumerics. ODE. Example 4.sm (9kb) downloaded 77 time(s).
DorNumerics. ODE. Arenstorf orbit.sm (92kb) downloaded 78 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 4 users thanked uni for this useful post.
on 13/07/2013(UTC),  on 13/07/2013(UTC),  on 13/07/2013(UTC),  on 14/07/2013(UTC)
Offline uni  
#2 Posted : 14 July 2013 10:15:34(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Originally Posted by: omorr Go to Quoted Post
Thank you uni, Good

dn_GearsBDF might be the ODE solver of choice for SMath. I would not mind some more solvers as well Good

Regards,
Radovan


Updated. dn_AdamsMoulton(), dn_ExplicitRK45(), dn_ImplicitRK5() added.

In Russia we say: получите, распишитесь.

Edited by user 14 July 2013 12:19:05(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 1 user thanked uni for this useful post.
on 14/07/2013(UTC)
Offline omorr  
#3 Posted : 14 July 2013 12:41:33(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
uni,

If you are by any chance here on Thassos-Greece (I am here with my family on the vacation) just let me know and come for a beer Biggrinrinks:

Regards,
Radovan

Edited by user 14 July 2013 13:28:47(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 14/07/2013(UTC)
Offline uni  
#4 Posted : 14 July 2013 15:55:08(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
You're a lucky man, on Greek island with beer and I'm in Siberia with the bears Crazy
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
Offline omorr  
#5 Posted : 14 July 2013 15:56:35(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
By the way uni,

I am just curious how is the numerical accuracy controlled in all your solvers? There is no any additional parameter about this, or I was wrong about it?.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Davide Carpi  
#6 Posted : 14 July 2013 15:59:20(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,393
Man
Italy
Location: Italy

Was thanked: 1195 time(s) in 787 post(s)
Originally Posted by: uni Go to Quoted Post
You're a lucky man, on Greek island with beer and I'm in Siberia with the bears Crazy


LOL LOL LOL LOL LOL
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline uni  
#7 Posted : 14 July 2013 16:04:02(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Originally Posted by: omorr Go to Quoted Post
By the way uni,

I am just curious how is the numerical accuracy controlled in all your solvers? There is no any additional parameter about this, or I was wrong about it?.

Regards,
Radovan


For all methods the following values​​:

RelTol = 1.0E-4,
AbsTol = 1.0E-7

I will add the ability to change it. I think, using variables in the document: RelTol and AbsTol.
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 1 user thanked uni for this useful post.
on 14/07/2013(UTC)
Offline omorr  
#8 Posted : 14 July 2013 16:08:34(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: w3b5urf3r_reloaded Go to Quoted Post
Originally Posted by: uni Go to Quoted Post
You're a lucky man, on Greek island with beer and I'm in Siberia with the bears Crazy


LOL LOL LOL LOL LOL


Just imagine how different we are?. My "Lord of the ring" bring us here - me and our children, and I am most interested to "chat" here with you about the ODE solvers Biggrinirol: . Someone will say that I am crazy Crazy - my wife a.k.a "Lord of the Ring" would be the first one .

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 14/07/2013(UTC)
Offline omorr  
#9 Posted : 14 July 2013 16:30:28(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: uni Go to Quoted Post
Originally Posted by: omorr Go to Quoted Post
By the way uni,

I am just curious how is the numerical accuracy controlled in all your solvers? There is no any additional parameter about this, or I was wrong about it?.

Regards,
Radovan


For all methods the following values​​:

RelTol = 1.0E-4,
AbsTol = 1.0E-7

I will add the ability to change it. I think, using variables in the document: RelTol and AbsTol.

I must be annoying now Blush , but could you try please try to reduce this numbers just a bit and try my "famous" example with bioreactions. I used recently some ODE stiff solvers from a package inside R. They gave the same results with negative concentration. Then, I reduced the default values for the accuracy and it worked a bit longer, but gave me the expected zero concentration.

Regards,
Radovan

Edited by user 14 July 2013 16:32:23(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline uni  
#10 Posted : 14 July 2013 21:52:57(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Originally Posted by: omorr Go to Quoted Post
Originally Posted by: uni Go to Quoted Post
Originally Posted by: omorr Go to Quoted Post
By the way uni,

I am just curious how is the numerical accuracy controlled in all your solvers? There is no any additional parameter about this, or I was wrong about it?.

Regards,
Radovan


For all methods the following values​​:

RelTol = 1.0E-4,
AbsTol = 1.0E-7

I will add the ability to change it. I think, using variables in the document: RelTol and AbsTol.

I must be annoying now Blush , but could you try please try to reduce this numbers just a bit and try my "famous" example with bioreactions. I used recently some ODE stiff solvers from a package inside R. They gave the same results with negative concentration. Then, I reduced the default values for the accuracy and it worked a bit longer, but gave me the expected zero concentration.

Regards,
Radovan


Updated. I've added support for accuracy (not completely). The library allows to set accuracy for each equation separately. Now for all the equations will be the same accuracy.

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
Offline omorr  
#11 Posted : 14 July 2013 22:57:40(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: uni Go to Quoted Post
Originally Posted by: omorr Go to Quoted Post
Originally Posted by: uni Go to Quoted Post
Originally Posted by: omorr Go to Quoted Post
By the way uni,

I am just curious how is the numerical accuracy controlled in all your solvers? There is no any additional parameter about this, or I was wrong about it?.

Regards,
Radovan


For all methods the following values​​:

RelTol = 1.0E-4,
AbsTol = 1.0E-7

I will add the ability to change it. I think, using variables in the document: RelTol and AbsTol.

I must be annoying now Blush , but could you try please try to reduce this numbers just a bit and try my "famous" example with bioreactions. I used recently some ODE stiff solvers from a package inside R. They gave the same results with negative concentration. Then, I reduced the default values for the accuracy and it worked a bit longer, but gave me the expected zero concentration.

Regards,
Radovan


Updated. I've added support for accuracy (not completely). The library allows to set accuracy for each equation separately. Now for all the equations will be the same accuracy.



Yes ...Biggrinancing: Yahoo This was simply great and a celebration for my eyes and soul Thank you .

Edited by user 14 July 2013 23:01:34(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline uni  
#12 Posted : 15 July 2013 02:34:48(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Amplitude detector.

File Attachment(s):
Amplitude detector.sm (15kb) downloaded 51 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 2 users thanked uni for this useful post.
on 15/07/2013(UTC),  on 16/07/2013(UTC)
Offline Ber7  
#13 Posted : 16 July 2013 11:26:31(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 405
Man
Israel
Location: Beer-Sheva

Was thanked: 487 time(s) in 267 post(s)
Animation of one example of Uni

File Attachment(s):
UniAnimac.sm (15kb) downloaded 53 time(s).
thanks 3 users thanked Ber7 for this useful post.
on 16/07/2013(UTC),  on 16/07/2013(UTC),  on 16/07/2013(UTC)
Offline uni  
#14 Posted : 16 July 2013 18:03:00(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Originally Posted by: ioan92 Go to Quoted Post
Hi Uni,



I've seen you can play the magician and make people's dreams to come true.

I have such a modest dream – ta have available in SMath some others modules from DOTNUMERICS, particularly the EISPACK one.

If my gentle request is not too abusive, please let me know how to address this package.


Please accept my wishes for an agreeable summer.Biggrinrinks:

The same greetings for all the forum members and particularly to Andrey!



Ioan

Well, if that's possible, I'll do it. Thank you.
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 1 user thanked uni for this useful post.
on 17/07/2013(UTC)
Offline uni  
#15 Posted : 19 July 2013 00:44:14(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Updated.

[+]: dn_LinAlgSolve(), dn_LinAlgLLS_COF(), dn_LinAlgLLS_QRorLQ(), dn_LinAlgLLS_SVD(), dn_LinAlgSVD(), dn_LinAlgEigenvalues(), dn_LinAlgEigenvectors(), dn_MatrixInverse().

Quote:
I have such a modest dream – ta have available in SMath some others modules from DOTNUMERICS, particularly the EISPACK one.

What kind of functions do you need?

I'm not sure that dn_LinAlgEigenvalues() works correctly.
File Attachment(s):
DotNumerics. Linear Algebra. Example 1.sm (29kb) downloaded 70 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 2 users thanked uni for this useful post.
on 19/07/2013(UTC),  on 19/07/2013(UTC)
Offline omorr  
#16 Posted : 19 July 2013 08:40:19(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello uni,

I played a bit with your example. It seems to me that eigenvalues and eigenvectors are correct for both matrices A and F. For the matrice F you gave the vector of eigenvalues which should be correct ("must be" vector). It seems that both vectors of eigenvalues - this one and the one found by dn_LinAlgEigenvalues() correspond to the eigenvectors fond by dn_LinAlgEigenvectors(). I am not sure this should be all right then or some numerical "glitch" is involved here. For some simpler matrices it works Ok and we can get the desired result by simple transformations of eigenvectors. I do not know how the AlgLib works and which kind of transformtion uses in order to give one of the many possible solutions for eigenvectors. I might be wrong about all of this, of course.

This time again eval() must be used as well to get the result. Moreover, again the well known annoying thing that sometimes the results with and without eval() are slightly different. See the attached file please.

Regards,
Radovan

Edited by user 19 July 2013 08:50:53(UTC)  | Reason: Not specified

File Attachment(s):
DotNumerics_LinearAlgebra_Example-corr.sm (107kb) downloaded 55 time(s).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 2 users thanked omorr for this useful post.
on 19/07/2013(UTC),  on 19/07/2013(UTC)
Offline uni  
#17 Posted : 19 July 2013 11:02:29(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Yes, this is interesting. And I'm doing it this way.

File Attachment(s):
DotNumerics. Linear Algebra. Example 2.sm (12kb) downloaded 64 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 2 users thanked uni for this useful post.
on 19/07/2013(UTC),  on 19/07/2013(UTC)
Offline uni  
#18 Posted : 19 July 2013 22:17:59(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Updated. Source code refactoring. Source code added.
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 1 user thanked uni for this useful post.
on 20/07/2013(UTC)
Offline omorr  
#19 Posted : 20 July 2013 08:39:05(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: uni Go to Quoted Post
Yes, this is interesting. And I'm doing it this way.



Hmm...If you use eigenvals() instead of Eigenvals(), you will get the roots as on the graph. I do not know what is the difference?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline uni  
#20 Posted : 01 August 2018 18:22:44(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
dn_AdamsMoulton simple test 1.



dn_AdamsMoulton.test1.sm (12kb) downloaded 37 time(s).
dn_AdamsMoulton.test1.pdf (49kb) downloaded 31 time(s).

Edited by user 01 August 2018 19:15:07(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 1 user thanked uni for this useful post.
on 02/08/2018(UTC)
Users browsing this topic
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.