<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-22833</id>
	<title>Nabble - Sundials</title>
	<updated>2008-11-17T11:58:04Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/Sundials-f22833.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Sundials-f22833.html" />
	<subtitle type="html">The &lt;b&gt;&lt;font color=&quot;#ff0000&quot;&gt;SU&lt;/font&gt;ite of &lt;font color=&quot;#ff0000&quot;&gt;N&lt;/font&gt;onlinear and &lt;font color=&quot;#ff0000&quot;&gt;DI&lt;/font&gt;fferential/&lt;font color=&quot;#ff0000&quot;&gt;AL&lt;/font&gt;gebraic equation &lt;font color=&quot;#ff0000&quot;&gt;S&lt;/font&gt;olvers&lt;/b&gt; consists of the following four solvers:
&lt;br&gt;
&lt;table style=&quot;color:  #666666; margin-left:10px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;colgroup width=70&gt;
&lt;colgroup&gt;
&lt;tr&gt;
&lt;td&gt;&lt;B&gt;CVODE&lt;/B&gt;&lt;/td&gt;
&lt;td&gt;solves initial value problems for ordinary differential equation (ODE) systems. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;B&gt;CVODES&lt;/B&gt;&lt;/td&gt;
&lt;td&gt;solves ODE systems and includes sensitivity analysis capabilities (forward and adjoint).&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;&lt;B&gt;IDA&lt;/B&gt;&lt;/td&gt;
&lt;td&gt;solves initial value problems for differential-algebraic equation (DAE) systems.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;B&gt;KINSOL&lt;/B&gt;&lt;/td&gt;
&lt;td&gt;solves nonlinear algebraic systems.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;
In addition, SUNDIALS provides a Matlab interface to CVODES and KINSOL,
&lt;B&gt;sundialsTB&lt;/B&gt;.
&lt;br&gt;&lt;br&gt;
The project webpage is located at &lt;a href=&quot;http://www.llnl.gov/casc/sundials&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.llnl.gov/casc/sundials&lt;/a&gt;

&lt;br&gt;&lt;br&gt;</subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-20547000</id>
	<title>Re: Optimum Factorization Method</title>
	<published>2008-11-17T11:58:04Z</published>
	<updated>2008-11-17T11:58:04Z</updated>
	<author>
		<name>Alan Hindmarsh</name>
	</author>
	<content type="html">Hello Seyed,
&lt;br&gt;&lt;br&gt;Here are a few thoughts:
&lt;br&gt;&lt;br&gt;1. First, since the band matrix is used as a preconditioner to a
&lt;br&gt;Krylov method, it need only be a crude approximation to the true
&lt;br&gt;Jacobian. &amp;nbsp;In particular, there may be an approximate matrix that has
&lt;br&gt;a smaller bandwidth. &amp;nbsp;Since factorization goes as the square of the
&lt;br&gt;bandwidth, it is important to explore that possibility. &amp;nbsp;For example,
&lt;br&gt;in ODE/DAE systems derived from 2D or 3D PDEs, one might ignore (in
&lt;br&gt;the preconditioner) the spatial coupling in one of the directions,
&lt;br&gt;thus getting a much smaller bandwidth. &amp;nbsp;One pays a price of more
&lt;br&gt;Krylov iterations in return for a much cheaper factorization, and it
&lt;br&gt;is impossible to predict in advance whether the tradeoff is worthwhile.
&lt;br&gt;&lt;br&gt;2. Presumably you are using the band matrix solver supplied with
&lt;br&gt;SUNDIALS. &amp;nbsp;You might look for an equivalent vendor-supplied band
&lt;br&gt;solver that is optimized for the machine you are on.
&lt;br&gt;&lt;br&gt;3. The next release of SUNDIALS will include an interface to the
&lt;br&gt;LAPACK band (and dense) matrix solvers. &amp;nbsp;These might be more efficient
&lt;br&gt;for your matrices on your machine. &amp;nbsp;In the mean time, before modifying
&lt;br&gt;SUNDIALS to try LAPACK, you might try a separate test case of a band
&lt;br&gt;factorization alone on a typical instance of your matrix -- first
&lt;br&gt;using our BandGBTRF function, and then using the LAPACK equivalent,
&lt;br&gt;dqgtrf. &amp;nbsp;If this shows a significant speed advantage for LAPACK, we
&lt;br&gt;can help you with modifications to SUNDIALS to use that.
&lt;br&gt;&lt;br&gt;Alan H
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Wed, 12 Nov 2008, Seyed-Abdolreza Seyed-Reihani wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Alan,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am using a Krylov solver with a preconditioner. The preconditioner is a
&lt;br&gt;&amp;gt; banded matrix. Actually, factorization of preconditioner takes really
&lt;br&gt;&amp;gt; long time. Our typical problem size is 30K X 30K.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -Seyed
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Wed, 12 Nov 2008, Alan Hindmarsh wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; The answer is maybe, depending ...
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; What linear solver are you using - dense or banded? &amp;nbsp;Or are you using
&lt;br&gt;&amp;gt; &amp;gt; a Krylov solver with a preconditioner that is factored? &amp;nbsp;What is your
&lt;br&gt;&amp;gt; &amp;gt; typical problem size? &amp;nbsp;If banded, what are your typical half-bandwidths?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; -Alan H
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; On Sun, 9 Nov 2008, Seyed-Abdolreza Seyed-Reihani wrote:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Hi there,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; I am using Sundials to integrate a DAE system. Found out factorization
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; time of Jacobian is always a dominant time. I wonder if there is anyway in
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; solver to optimize factorizing time. Any thoughts/comments would be
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; appreciated.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; -Seyed
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Optimum-Factorization-Method-tp20414056p20547000.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20544529</id>
	<title>Re: second derivates</title>
	<published>2008-11-17T09:51:11Z</published>
	<updated>2008-11-17T09:51:11Z</updated>
	<author>
		<name>Radu Serban-3</name>
	</author>
	<content type="html">tevion2 wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Dear all,
&lt;br&gt;&amp;gt; I use CVODES together with IpOPT an NLP-Solver. By now I use forward
&lt;br&gt;&amp;gt; sensitivity calculations to generate gradient information. Unfortunately I
&lt;br&gt;&amp;gt; have convergence problems with IpOPT, which I think (after research at the
&lt;br&gt;&amp;gt; IpOPT Mailing list) comes from the fact, that I use a second derivative
&lt;br&gt;&amp;gt; approximation (Hessian approximation). Now I try to get first and second
&lt;br&gt;&amp;gt; order derivatives with CVODES. My problem is that I'm not very familiar with
&lt;br&gt;&amp;gt; the backward integration in adjoint mode. 
&lt;br&gt;&amp;gt; So my question is:
&lt;br&gt;&amp;gt; Has someone an example which shows, how to calculate first and second
&lt;br&gt;&amp;gt; derivatives with CVODES (specially how to formulate the adjoint equations
&lt;br&gt;&amp;gt; for sensitivities of the initial values and the parameter values). 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Many thanks in advance
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Dominik
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Hi Dominik,
&lt;br&gt;&lt;br&gt;You should probably start with the following paper:
&lt;br&gt;D.B. Ozyurt and P.I. Barton, &amp;quot;Cheap Second Order Directional Derivatives 
&lt;br&gt;of Stiff ODE Embedded Functionals,&amp;quot; SIAM J. Sci. Comput., Vol. 26(5), 
&lt;br&gt;pp. 1725--1743.
&lt;br&gt;&lt;br&gt;While it is certainly possible to implement the &amp;quot;forward over adjoint&amp;quot; 
&lt;br&gt;method described in this paper even with the currently released version 
&lt;br&gt;of CVODES, a more efficient implementation requires some extra 
&lt;br&gt;infrastructure that is just not in there right now (e.g. allowing an 
&lt;br&gt;adjoint problem to depend on forward sensitivities). The good news is 
&lt;br&gt;that all of it is already implemented in the development version of the 
&lt;br&gt;SUNDIALS solvers and will be available in the next release. The bad news 
&lt;br&gt;is that we're still not quite ready for the release...
&lt;br&gt;&lt;br&gt;Best,
&lt;br&gt;--Radu
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/second-derivates-tp20478179p20544529.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20478179</id>
	<title>second derivates</title>
	<published>2008-11-13T02:27:57Z</published>
	<updated>2008-11-13T02:27:57Z</updated>
	<author>
		<name>tevion2</name>
	</author>
	<content type="html">Dear all,
&lt;br&gt;I use CVODES together with IpOPT an NLP-Solver. By now I use forward sensitivity calculations to generate gradient information. Unfortunately I have convergence problems with IpOPT, which I think (after research at the IpOPT Mailing list) comes from the fact, that I use a second derivative approximation (Hessian approximation). Now I try to get first and second order derivatives with CVODES. My problem is that I'm not very familiar with the backward integration in adjoint mode. 
&lt;br&gt;So my question is:
&lt;br&gt;Has someone an example which shows, how to calculate first and second derivatives with CVODES (specially how to formulate the adjoint equations for sensitivities of the initial values and the parameter values). 
&lt;br&gt;&lt;br&gt;Many thanks in advance
&lt;br&gt;&lt;br&gt;Dominik&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/second-derivates-tp20478179p20478179.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20471072</id>
	<title>Re: Optimum Factorization Method</title>
	<published>2008-11-12T14:36:06Z</published>
	<updated>2008-11-12T14:36:06Z</updated>
	<author>
		<name>Alan Hindmarsh</name>
	</author>
	<content type="html">&lt;br&gt;The answer is maybe, depending ...
&lt;br&gt;&lt;br&gt;What linear solver are you using - dense or banded? &amp;nbsp;Or are you using
&lt;br&gt;a Krylov solver with a preconditioner that is factored? &amp;nbsp;What is your
&lt;br&gt;typical problem size? &amp;nbsp;If banded, what are your typical half-bandwidths?
&lt;br&gt;&lt;br&gt;-Alan H
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Sun, 9 Nov 2008, Seyed-Abdolreza Seyed-Reihani wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi there,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am using Sundials to integrate a DAE system. Found out factorization
&lt;br&gt;&amp;gt; time of Jacobian is always a dominant time. I wonder if there is anyway in
&lt;br&gt;&amp;gt; solver to optimize factorizing time. Any thoughts/comments would be
&lt;br&gt;&amp;gt; appreciated.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -Seyed
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Optimum-Factorization-Method-tp20414056p20471072.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20466167</id>
	<title>Re: parallel implementation</title>
	<published>2008-11-12T10:13:27Z</published>
	<updated>2008-11-12T10:13:27Z</updated>
	<author>
		<name>Radu Serban-3</name>
	</author>
	<content type="html">monirajg wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; hi all,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; is a parallel implementation possible through Sundials TB in matlab? are
&lt;br&gt;&amp;gt; there any examples provided?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; thanks
&lt;br&gt;&amp;gt; Moni
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Hi Moni,
&lt;br&gt;Yes, sundialsTB does provide parallel support, but that was more of an 
&lt;br&gt;experiment than anything else... In any case, for it to be enabled when 
&lt;br&gt;the toolbox is installed, you must have the MPITB toolbox installed and 
&lt;br&gt;LAM MPI (the scripts under sundialsTB/putils are LAM-specific). Parallel 
&lt;br&gt;examples for sundialsTB are provided for CVODES and KINSOL. For more 
&lt;br&gt;details, including links to MPITB and LAM, see &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;https:// computation.llnl.gov/casc/sundials/documentation/stb_guide/sundialsTB.html.
&lt;br&gt;--Radu
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/parallel-implementation-tp20454325p20466167.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20465237</id>
	<title>difficulty running examples</title>
	<published>2008-11-12T09:31:44Z</published>
	<updated>2008-11-12T09:31:44Z</updated>
	<author>
		<name>deequeue</name>
	</author>
	<content type="html">Hello out there,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I compiled with the examples enabled and things seemed as though they worked (at least the result was the same on two different installs for two different computers). &amp;nbsp;Unfortunately, when I try to run cvsdenx.exe, for example, I get an error that it can't find cygsundials_cvodes-1.exe. &amp;nbsp;Subsequently, I've run ldd on cvsdenx.exe and it returns the following:
&lt;br&gt;&amp;quot;
&lt;br&gt;Error: could not find cygsundials_cvodes-1.exe
&lt;br&gt;Error: could not find cygsundials_nvecserial-0.exe
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\cygwin\bin\cygwin1.dll
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C:\WINDOWS\system32\ADVAPI32.DLL
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\WINDOWS\system32\KERNEL32.dll
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C:\WINDOWS\system32\ntdll.dll
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\WINDOWS\system32\RPCRT4.dll
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C:\WINDOWS\system32\Secur32.dll
&lt;br&gt;&amp;quot;
&lt;br&gt;So, obviously there was something in the make install step that went awry. &amp;nbsp;Does anyone have any suggestions? &amp;nbsp;Thank you ahead of time for your help.
&lt;br&gt;&lt;br&gt;David Q. &amp;nbsp;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/difficulty-running-examples-tp20465237p20465237.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20454325</id>
	<title>parallel implementation</title>
	<published>2008-11-11T21:05:23Z</published>
	<updated>2008-11-11T21:05:23Z</updated>
	<author>
		<name>monirajg</name>
	</author>
	<content type="html">hi all,
&lt;br&gt;&lt;br&gt;is a parallel implementation possible through Sundials TB in matlab? are there any examples provided?
&lt;br&gt;&lt;br&gt;thanks
&lt;br&gt;Moni
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/parallel-implementation-tp20454325p20454325.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20453166</id>
	<title>Re: large ODE systems - 4 byte integer problem</title>
	<published>2008-11-11T18:56:54Z</published>
	<updated>2008-11-11T18:56:54Z</updated>
	<author>
		<name>Radu Serban-3</name>
	</author>
	<content type="html">Stefan,
&lt;br&gt;&lt;br&gt;I sent you a personal email regarding this issue literally 2 minutes 
&lt;br&gt;before I received your post...
&lt;br&gt;&lt;br&gt;Here are the changes that need to be made to nvector_parallel.{h,c} in 
&lt;br&gt;order to change the global vector length to &amp;quot;long long int&amp;quot; (I sent the 
&lt;br&gt;modified files to Stefan. If anyone else needs them, please let me know):
&lt;br&gt;- there's a sanity check done in the constructor function 
&lt;br&gt;N_VNewEmpty_Parallel to verify that the sum of all local lengths is 
&lt;br&gt;equal to the global length (this test could have been simply commented 
&lt;br&gt;out, but I left it in there and used MPI_LONG_LONG_INT for the 
&lt;br&gt;corresponding MPI type.)
&lt;br&gt;- global_length is actually needed only in calculating the WRMS norm of 
&lt;br&gt;the global vector (functions N_VWrmsNorm_Parallel and 
&lt;br&gt;N_VWrmsNormMask_Parallel) and all that's required is a change in the 
&lt;br&gt;type of the appropriate local variable.
&lt;br&gt;- as Stefan noted below, the global length is reported back through 
&lt;br&gt;N_VSpace as the &amp;quot;long int&amp;quot; argument lrw1. I opted to simply set lrw1 = 1 
&lt;br&gt;and therefore one should just ignore any workspace usage reports from a 
&lt;br&gt;solver when using this nvector module (the manner in which memory usage 
&lt;br&gt;is reported back from the Sundials solvers needs to be changed anyway at 
&lt;br&gt;some point).
&lt;br&gt;&lt;br&gt;Best,
&lt;br&gt;-Radu
&lt;br&gt;&lt;br&gt;stefanke wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I am still struggeling to change the global system size to long long int (my
&lt;br&gt;&amp;gt; global ODE size exceeds the default &amp;nbsp;long int).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I started to modify the nvec_par module to account for long long int
&lt;br&gt;&amp;gt; global_length.
&lt;br&gt;&amp;gt; But in addition I realized that calls like:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; N_VSpace(y0, &amp;lrw1, &amp;liw1);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; in cvode.c will effect (due to lrw and lrw1) the cvode routines as well. 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So a simple change of nvec_par is not enough!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I think it's in general a good idea to switch the global_length from long
&lt;br&gt;&amp;gt; int to long long int.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Can somebody which has a deep understanding of CVODE &amp;nbsp;help me out with that
&lt;br&gt;&amp;gt; problem. I don't know all the internals of CVODE well enough to make the
&lt;br&gt;&amp;gt; change.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I would really appreciate any help of the CVODE developers.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Best,
&lt;br&gt;&amp;gt; Stefan
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; radu wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; --- On Tue, 6/10/08, Stefan Kerkemeier &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20453166&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stefanke@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; From: Stefan Kerkemeier &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20453166&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stefanke@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Subject: [sundials-users] large ODE systems - 4 byte integer problem
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; To: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20453166&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sundials-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Date: Tuesday, June 10, 2008, 5:10 AM
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I need to integrate really large system on a bunch of 32bit
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; machines (in parallel) but the global size of the ODE is
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; larger than the maximum number of a 4 byte integer.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The problem is that the global size of an ODE in CVODE is
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; declared as INT which is on a 32bit machine typically 4
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; bytes while on a 64-bit machine it's a LONGINT (8
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; bytes).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Is there any reason why we shouldn't switch to 8 bytes
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; for the global size variable?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Thx for your input
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Stefan
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Hi Stefan,
&lt;br&gt;&amp;gt;&amp;gt; CVODE itself doesn't know anything about the global problem size. That
&lt;br&gt;&amp;gt;&amp;gt; value only appears in the parallel nvector module where it is declared as
&lt;br&gt;&amp;gt;&amp;gt; a long int which indeed is usually of equal size as an int (4 bytes on a
&lt;br&gt;&amp;gt;&amp;gt; 32-bit machine). If you indeed have to solve a problem of global size
&lt;br&gt;&amp;gt;&amp;gt; larger that 2.7 billion you could simply change the type in
&lt;br&gt;&amp;gt;&amp;gt; nvector_parallel.h to long long int.
&lt;br&gt;&amp;gt;&amp;gt; --Radu
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/large-ODE-systems---4-byte-integer-problem-tp17753914p20453166.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20452709</id>
	<title>Re: large ODE systems - 4 byte integer problem</title>
	<published>2008-11-11T18:19:17Z</published>
	<updated>2008-11-11T18:19:17Z</updated>
	<author>
		<name>stefanke</name>
	</author>
	<content type="html">I am still struggeling to change the global system size to long long int (my global ODE size exceeds the default &amp;nbsp;long int).
&lt;br&gt;&lt;br&gt;I started to modify the nvec_par module to account for long long int global_length.
&lt;br&gt;But in addition I realized that calls like:
&lt;br&gt;&lt;br&gt;N_VSpace(y0, &amp;lrw1, &amp;liw1);
&lt;br&gt;&lt;br&gt;in cvode.c will effect (due to lrw and lrw1) the cvode routines as well. 
&lt;br&gt;&lt;br&gt;So a simple change of nvec_par is not enough!
&lt;br&gt;&lt;br&gt;&lt;br&gt;I think it's in general a good idea to switch the global_length from long int to long long int.
&lt;br&gt;&lt;br&gt;Can somebody which has a deep understanding of CVODE &amp;nbsp;help me out with that problem. I don't know all the internals of CVODE well enough to make the change.
&lt;br&gt;&lt;br&gt;I would really appreciate any help of the CVODE developers.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Best,
&lt;br&gt;Stefan
&lt;br&gt;&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;radu wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;--- On Tue, 6/10/08, Stefan Kerkemeier &amp;lt;stefanke@micodat.com&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; From: Stefan Kerkemeier &amp;lt;stefanke@micodat.com&amp;gt;
&lt;br&gt;&amp;gt; Subject: [sundials-users] large ODE systems - 4 byte integer problem
&lt;br&gt;&amp;gt; To: sundials-users@llnl.gov
&lt;br&gt;&amp;gt; Date: Tuesday, June 10, 2008, 5:10 AM
&lt;br&gt;&amp;gt; I need to integrate really large system on a bunch of 32bit
&lt;br&gt;&amp;gt; machines (in parallel) but the global size of the ODE is
&lt;br&gt;&amp;gt; larger than the maximum number of a 4 byte integer.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The problem is that the global size of an ODE in CVODE is
&lt;br&gt;&amp;gt; declared as INT which is on a 32bit machine typically 4
&lt;br&gt;&amp;gt; bytes while on a 64-bit machine it's a LONGINT (8
&lt;br&gt;&amp;gt; bytes).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is there any reason why we shouldn't switch to 8 bytes
&lt;br&gt;&amp;gt; for the global size variable?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thx for your input
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Stefan
&lt;br&gt;&lt;br&gt;Hi Stefan,
&lt;br&gt;CVODE itself doesn't know anything about the global problem size. That value only appears in the parallel nvector module where it is declared as a long int which indeed is usually of equal size as an int (4 bytes on a 32-bit machine). If you indeed have to solve a problem of global size larger that 2.7 billion you could simply change the type in nvector_parallel.h to long long int.
&lt;br&gt;--Radu
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/large-ODE-systems---4-byte-integer-problem-tp17753914p20452709.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20416159</id>
	<title>Re: memory allocation and switching between two differential equations</title>
	<published>2008-11-10T00:34:02Z</published>
	<updated>2008-11-10T00:34:02Z</updated>
	<author>
		<name>Masoud-NAJAFI</name>
	</author>
	<content type="html">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;meta content=&quot;text/html;charset=iso-8859-1&quot; http-equiv=&quot;Content-Type&quot;&gt;
&lt;/head&gt;
&lt;body bgcolor=&quot;#ffffff&quot; text=&quot;#000000&quot;&gt;
Hello,&lt;br&gt;
Thank you for your reply. In fact, since the size of two DEs are big,
I'm looking for a trick to use the minimum amount of memory, i.e.,
using the same cvode_mem for two differential equations. I wonder if
there is a way to communicate the new size of the DE without
reallocating the whole cvode_mem.&lt;br&gt;
Best&lt;br&gt;
Masoud&lt;br&gt;
INRIA, France&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Andrey Romanenko a &amp;eacute;crit&amp;nbsp;:
&lt;blockquote cite=&quot;mid200811071034.57810.andrey@ciengis.com&quot; type=&quot;cite&quot;&gt;
  &lt;pre wrap=&quot;&quot;&gt;Hello,

How about this

cvodes_mem0 = CVodeCreate();
...
// other initializations related to problem 0 (cvodes_mem0)
....
cvodes_mem1 = CVodeCreate();
....
// other initializations related to problem 1 (cvodes_mem1)
....

while(1) {
   
  // Integrate system 0
  flag = CVodeReInit(solver_mem0, tinit, x0_init);
  flag = CVode(cvodes_mem0, ... );

  // Integrate system 1
  flag = CVodeReInit(solver_mem1, tinit, x1_init);
  flag = CVode(cvodes_mem1, ... );

  // make the necessary changes in ICs

}

This way you do not re-create CVODES memory objects, just reset the ICs.


Hope this helps.

Best Regards,
Andrey Romanenko


On Friday 07 November 2008 10:18:56 Masoud-NAJAFI wrote:
  &lt;/pre&gt;
  &lt;blockquote type=&quot;cite&quot;&gt;
    &lt;pre wrap=&quot;&quot;&gt;Hi,
I'm trying to integrate two differential equations with different sizes
consecutively in a loop. My code is something like this

start:
   Initialize CVODE (Allocate memory for size N1 and for DE1)
   Call CVODE to integrate DE1
   -
   Initialize CVODE (Allocate memory for size N2 and for DE2)
   Call CVODE to integrate DE2
   goto start;

The initialization is time consuming, so I need to minimize the
initializations. Is it possible to initialize CVODE only one time with
size N=max(N1,N2) and then just before switching between differential
equations to communicate the new size and the new DE routine?

Thank you
Masoud
    &lt;/pre&gt;
  &lt;/blockquote&gt;
  &lt;pre wrap=&quot;&quot;&gt;&lt;!----&gt;


  &lt;/pre&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/help-for-the-path-tp20352817p20416159.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20414056</id>
	<title>Optimum Factorization Method</title>
	<published>2008-11-09T19:56:48Z</published>
	<updated>2008-11-09T19:56:48Z</updated>
	<author>
		<name>Seyed-Abdolreza Seyed-Reihani</name>
	</author>
	<content type="html">&lt;br&gt;Hi there,
&lt;br&gt;&lt;br&gt;I am using Sundials to integrate a DAE system. Found out factorization 
&lt;br&gt;time of Jacobian is always a dominant time. I wonder if there is anyway in 
&lt;br&gt;solver to optimize factorizing time. Any thoughts/comments would be 
&lt;br&gt;appreciated.
&lt;br&gt;&lt;br&gt;-Seyed
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Optimum-Factorization-Method-tp20414056p20414056.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20378152</id>
	<title>Re: memory allocation and switching between two differential equations</title>
	<published>2008-11-07T02:34:57Z</published>
	<updated>2008-11-07T02:34:57Z</updated>
	<author>
		<name>Andrey Romanenko-4</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;How about this
&lt;br&gt;&lt;br&gt;cvodes_mem0 = CVodeCreate();
&lt;br&gt;...
&lt;br&gt;// other initializations related to problem 0 (cvodes_mem0)
&lt;br&gt;....
&lt;br&gt;cvodes_mem1 = CVodeCreate();
&lt;br&gt;....
&lt;br&gt;// other initializations related to problem 1 (cvodes_mem1)
&lt;br&gt;....
&lt;br&gt;&lt;br&gt;while(1) {
&lt;br&gt;&amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; // Integrate system 0
&lt;br&gt;&amp;nbsp; flag = CVodeReInit(solver_mem0, tinit, x0_init);
&lt;br&gt;&amp;nbsp; flag = CVode(cvodes_mem0, ... );
&lt;br&gt;&lt;br&gt;&amp;nbsp; // Integrate system 1
&lt;br&gt;&amp;nbsp; flag = CVodeReInit(solver_mem1, tinit, x1_init);
&lt;br&gt;&amp;nbsp; flag = CVode(cvodes_mem1, ... );
&lt;br&gt;&lt;br&gt;&amp;nbsp; // make the necessary changes in ICs
&lt;br&gt;&lt;br&gt;}
&lt;br&gt;&lt;br&gt;This way you do not re-create CVODES memory objects, just reset the ICs.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Hope this helps.
&lt;br&gt;&lt;br&gt;Best Regards,
&lt;br&gt;Andrey Romanenko
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Friday 07 November 2008 10:18:56 Masoud-NAJAFI wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; I'm trying to integrate two differential equations with different sizes
&lt;br&gt;&amp;gt; consecutively in a loop. My code is something like this
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; start:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Initialize CVODE (Allocate memory for size N1 and for DE1)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Call CVODE to integrate DE1
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;-
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Initialize CVODE (Allocate memory for size N2 and for DE2)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Call CVODE to integrate DE2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;goto start;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The initialization is time consuming, so I need to minimize the
&lt;br&gt;&amp;gt; initializations. Is it possible to initialize CVODE only one time with
&lt;br&gt;&amp;gt; size N=max(N1,N2) and then just before switching between differential
&lt;br&gt;&amp;gt; equations to communicate the new size and the new DE routine?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thank you
&lt;br&gt;&amp;gt; Masoud
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/help-for-the-path-tp20352817p20378152.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20377970</id>
	<title>memory allocation and switching between two differential equations</title>
	<published>2008-11-07T02:18:56Z</published>
	<updated>2008-11-07T02:18:56Z</updated>
	<author>
		<name>Masoud-NAJAFI</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;I'm trying to integrate two differential equations with different sizes 
&lt;br&gt;consecutively in a loop. My code is something like this
&lt;br&gt;&lt;br&gt;start:
&lt;br&gt;&amp;nbsp; &amp;nbsp;Initialize CVODE (Allocate memory for size N1 and for DE1)
&lt;br&gt;&amp;nbsp; &amp;nbsp;Call CVODE to integrate DE1
&lt;br&gt;&amp;nbsp; &amp;nbsp;-
&lt;br&gt;&amp;nbsp; &amp;nbsp;Initialize CVODE (Allocate memory for size N2 and for DE2)
&lt;br&gt;&amp;nbsp; &amp;nbsp;Call CVODE to integrate DE2
&lt;br&gt;&amp;nbsp; &amp;nbsp;goto start;
&lt;br&gt;&lt;br&gt;The initialization is time consuming, so I need to minimize the 
&lt;br&gt;initializations. Is it possible to initialize CVODE only one time with 
&lt;br&gt;size N=max(N1,N2) and then just before switching between differential 
&lt;br&gt;equations to communicate the new size and the new DE routine?
&lt;br&gt;&lt;br&gt;Thank you
&lt;br&gt;Masoud
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/help-for-the-path-tp20352817p20377970.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20358995</id>
	<title>Re: help for the path</title>
	<published>2008-11-06T02:54:31Z</published>
	<updated>2008-11-06T02:54:31Z</updated>
	<author>
		<name>Heng Chen</name>
	</author>
	<content type="html">thanks a lot &lt;font color=&quot;#888888&quot;&gt;Warren !!!&lt;br&gt;&lt;br&gt;best&lt;br&gt;&lt;br&gt;heng&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Nov 6, 2008 at 5:35 AM, Warren Weckesser &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20358995&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;warren.weckesser@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;You must use the -l option with appropriate library names for gcc to link them.&amp;nbsp; -L tells&lt;br&gt;
gcc which directory to look in, but it doesn&amp;#39;t say which files to look for.&lt;br&gt;&lt;br&gt;You can see an example in the file Makefile-pendulum_cvdemo here:&lt;br&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http:// +www. +warrenweckesser.net/vfgen/menu_cvode.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://  www.  warrenweckesser.net/vfgen/menu_cvode.html&lt;/a&gt;&lt;br&gt;(scroll down to the example).&amp;nbsp; In that file, the gcc command that builds the executable&lt;br&gt;
uses the options &amp;quot;-lsundials_cvode -lsundials_nvecserial&amp;quot;. &lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;
&lt;br&gt;Warren&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;Wj3C7c&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 5, 2008 at 6:11 PM, Heng Chen &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20358995&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;heng.chen.07@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Dear all, &lt;br&gt;&lt;br&gt;I just installed the package, following the instruction and it all went well. I tried to run some of those examples and found that I could compile perfectly&amp;nbsp; but complier (gcc) can&amp;#39;t correctly link it with those *.a in /usr/local/lib.&lt;br&gt;


&lt;br&gt;1) I found it strange that /usr/local/lib is indeed a default search path for gcc but why it doesn&amp;#39;t recognize the path?&lt;br&gt;2) I tried to link it with the command&amp;nbsp; :&lt;br&gt;gcc -Wall kinkryx.c -L /usr/local/lib/&amp;nbsp;&amp;nbsp; -o test&lt;br&gt;


it still complains the same thing which is even more strange&lt;br&gt;3) I tried to add the /usr/local/lib as a new environment path and tried again, still it doesn&amp;#39;t work.&lt;br&gt;4) I tired :gcc -Wall kinkryx.c /usr/local/lib/*.a -lm&amp;nbsp; -o test&lt;br&gt;


and it works finally. But I don&amp;#39;t want to type those command in a terminal, instead I want to use IDE like eclipse and have no clue how it is gonna work. PLUS, i want to figure out why the first three standard methods does&amp;#39;t work at all.&amp;nbsp; Could it be a problem with gcc itself? Is reinstallation of gcc recommanded? &lt;br&gt;


&lt;br&gt;thanks a lot in advance &lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;Heng&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/help-for-the-path-tp20352817p20358995.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20355082</id>
	<title>Re: help for the path</title>
	<published>2008-11-05T20:35:32Z</published>
	<updated>2008-11-05T20:35:32Z</updated>
	<author>
		<name>Warren Weckesser-2</name>
	</author>
	<content type="html">You must use the -l option with appropriate library names for gcc to link them.&amp;nbsp; -L tells&lt;br&gt;gcc which directory to look in, but it doesn&amp;#39;t say which files to look for.&lt;br&gt;&lt;br&gt;You can see an example in the file Makefile-pendulum_cvdemo here:&lt;br&gt;
&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http:// www. warrenweckesser.net/vfgen/menu_cvode.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http:// www. warrenweckesser.net/vfgen/menu_cvode.html&lt;/a&gt;&lt;br&gt;(scroll down to the example).&amp;nbsp; In that file, the gcc command that builds the executable&lt;br&gt;uses the options &amp;quot;-lsundials_cvode -lsundials_nvecserial&amp;quot;. &lt;br&gt;
&lt;br&gt;Warren&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 5, 2008 at 6:11 PM, Heng Chen &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20355082&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;heng.chen.07@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Dear all, &lt;br&gt;&lt;br&gt;I just installed the package, following the instruction and it all went well. I tried to run some of those examples and found that I could compile perfectly&amp;nbsp; but complier (gcc) can&amp;#39;t correctly link it with those *.a in /usr/local/lib.&lt;br&gt;

&lt;br&gt;1) I found it strange that /usr/local/lib is indeed a default search path for gcc but why it doesn&amp;#39;t recognize the path?&lt;br&gt;2) I tried to link it with the command&amp;nbsp; :&lt;br&gt;gcc -Wall kinkryx.c -L /usr/local/lib/&amp;nbsp;&amp;nbsp; -o test&lt;br&gt;

it still complains the same thing which is even more strange&lt;br&gt;3) I tried to add the /usr/local/lib as a new environment path and tried again, still it doesn&amp;#39;t work.&lt;br&gt;4) I tired :gcc -Wall kinkryx.c /usr/local/lib/*.a -lm&amp;nbsp; -o test&lt;br&gt;

and it works finally. But I don&amp;#39;t want to type those command in a terminal, instead I want to use IDE like eclipse and have no clue how it is gonna work. PLUS, i want to figure out why the first three standard methods does&amp;#39;t work at all.&amp;nbsp; Could it be a problem with gcc itself? Is reinstallation of gcc recommanded? &lt;br&gt;

&lt;br&gt;thanks a lot in advance &lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;Heng&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/help-for-the-path-tp20352817p20355082.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20352817</id>
	<title>help for the path</title>
	<published>2008-11-05T16:11:19Z</published>
	<updated>2008-11-05T16:11:19Z</updated>
	<author>
		<name>Heng Chen</name>
	</author>
	<content type="html">Dear all, &lt;br&gt;&lt;br&gt;I just installed the package, following the instruction and it all went well. I tried to run some of those examples and found that I could compile perfectly&amp;nbsp; but complier (gcc) can&amp;#39;t correctly link it with those *.a in /usr/local/lib.&lt;br&gt;
&lt;br&gt;1) I found it strange that /usr/local/lib is indeed a default search path for gcc but why it doesn&amp;#39;t recognize the path?&lt;br&gt;2) I tried to link it with the command&amp;nbsp; :&lt;br&gt;gcc -Wall kinkryx.c -L /usr/local/lib/&amp;nbsp;&amp;nbsp; -o test&lt;br&gt;
it still complains the same thing which is even more strange&lt;br&gt;3) I tried to add the /usr/local/lib as a new environment path and tried again, still it doesn&amp;#39;t work.&lt;br&gt;4) I tired :gcc -Wall kinkryx.c /usr/local/lib/*.a -lm&amp;nbsp; -o test&lt;br&gt;
and it works finally. But I don&amp;#39;t want to type those command in a terminal, instead I want to use IDE like eclipse and have no clue how it is gonna work. PLUS, i want to figure out why the first three standard methods does&amp;#39;t work at all.&amp;nbsp; Could it be a problem with gcc itself? Is reinstallation of gcc recommanded? &lt;br&gt;
&lt;br&gt;thanks a lot in advance &lt;br&gt;&lt;br&gt;Heng&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/help-for-the-path-tp20352817p20352817.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20352769</id>
	<title>I tried to unsubscribe...</title>
	<published>2008-11-05T16:05:30Z</published>
	<updated>2008-11-05T16:05:30Z</updated>
	<author>
		<name>John Weeks</name>
	</author>
	<content type="html">I tried to unsubscribe through the SUNDIALS web page. But I keep getting
&lt;br&gt;the e-mail from the list. Is there something that can be done?
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;John Weeks
&lt;br&gt;&lt;br&gt;WaveMetrics, Inc.
&lt;br&gt;Phone (503) 620-3001
&lt;br&gt;Fax &amp;nbsp; (503) 620-6754
&lt;br&gt;email &amp;nbsp; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352769&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;support@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Fw%3A-Re%3A-help-for-CVODE-tp20352272p20352769.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20352272</id>
	<title>Fw: Re: help for CVODE</title>
	<published>2008-11-05T15:23:04Z</published>
	<updated>2008-11-05T15:23:04Z</updated>
	<author>
		<name>monirajg</name>
	</author>
	<content type="html">&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot;&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; style=&quot;font: inherit;&quot;&gt;&lt;br&gt;&lt;br&gt;--- On &lt;b&gt;Thu, 11/6/08, moniraj ghosh &lt;i&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352272&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;monirajg@...&lt;/a&gt;&amp;gt;&lt;/i&gt;&lt;/b&gt; wrote:&lt;br&gt;&lt;blockquote style=&quot;border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;&quot;&gt;From: moniraj ghosh &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352272&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;monirajg@...&lt;/a&gt;&amp;gt;&lt;br&gt;Subject: Re: [sundials-users] help for CVODE&lt;br&gt;To: &quot;Alan Hindmarsh&quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352272&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alanh@...&lt;/a&gt;&amp;gt;&lt;br&gt;Date: Thursday, November 6, 2008, 4:52 AM&lt;br&gt;&lt;br&gt;&lt;div id=&quot;yiv901763508&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;&quot; valign=&quot;top&quot;&gt;Hi Alan,&lt;br&gt;&lt;br&gt;i eagerly look&amp;nbsp; forward to your suggesitons to get out from being totally stuck . thanks very much for the clarification.&lt;br&gt;&lt;br&gt;i am using Choice 1. apart
 from the reasons u mentioned, my HDot is also&amp;nbsp; function of hDot ( not h directly). so i use the kind of relation u mentioned &lt;br&gt;&lt;pre&gt;Hdot = (hdot - H Rdot)/R.&lt;br&gt;&lt;br&gt;to get the next H from current values of hDot and RDot.&lt;br&gt;&lt;br&gt;i am not clear about Choice 3. i still need to integrate&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt; HDot. as my H (t + del t) is not just h(t+delt)/R(t + del t).&lt;br&gt;isn't that correct?&lt;br&gt;&lt;br&gt;One more thing. i am having unphysical negative values of h ( or H). h is my (drop) height, so cannot be negative.from the website i learnt that one way to deal with it is to tighten&lt;br&gt;the tolerances. however it is also said that small negative values (&lt;br&gt; compared to the abstol) are harmless. but in my case after a certain time the small negative h values blow up&lt;br&gt;my hDot. and then everything falls apart. on the contrary if i artificially make those negative values equal to zero ( which is strongly discouraged in the
 website) the method remains stable. &lt;br&gt;i understand that making the negative vaues positive is not the proper solution , but do you have any suggestions regarding what to do, apart from tightening the tolerances.&lt;br&gt;&lt;br&gt;thanks very much for your time.&lt;br&gt;&lt;br&gt;Moni&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&lt;br&gt;&lt;/pre&gt;&lt;br&gt;--- On &lt;b&gt;Thu, 11/6/08, Alan Hindmarsh &lt;i&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352272&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alanh@...&lt;/a&gt;&amp;gt;&lt;/i&gt;&lt;/b&gt; wrote:&lt;br&gt;&lt;blockquote style=&quot;border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;&quot;&gt;From: Alan Hindmarsh &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352272&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alanh@...&lt;/a&gt;&amp;gt;&lt;br&gt;Subject: Re: [sundials-users] help for CVODE&lt;br&gt;To: &quot;monirajg&quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352272&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;monirajg@...&lt;/a&gt;&amp;gt;&lt;br&gt;Cc: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352272&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sundials-users@...&lt;/a&gt;, &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20352272&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alanh@...&lt;/a&gt;&lt;br&gt;Date: Thursday,
 November 6, 2008, 4:22 AM&lt;br&gt;&lt;br&gt;&lt;pre&gt;Hello Moni,&lt;br&gt;&lt;br&gt;That is a good question.  Let me rephrase the 2 choices:&lt;br&gt;&lt;br&gt;Choice 1 is to use CVODE on y = (R, H) and use h = H*R where needed.&lt;br&gt;I take it that hdot = dh/dt is a known function of (R,h,H) directly,&lt;br&gt;and so is Rdot.  Then you would use Hdot = (hdot - H Rdot)/R.&lt;br&gt;&lt;br&gt;Choice 2 is to use y = (R, h, H) with all 3 ODEs, including the above Hdot.&lt;br&gt;&lt;br&gt;Both are valid, but they are not the same, and Choice 1 is better.  The&lt;br&gt;reason is that in 2, the relation h = H*R is not guaranteed.  The ODEs&lt;br&gt;say that (d/dt)(h - H*R) = 0, but the value of h - H*R can drift away&lt;br&gt;from 0 over the course of the integration.  It is better to have the&lt;br&gt;relation built into the system directly.&lt;br&gt;&lt;br&gt;I wonder why you don't make the more natural Choice 3: Use y = (R,h),&lt;br&gt;with H = h/R as needed.  Then you never have to compute Hdot.&lt;br&gt;&lt;br&gt;-Alan H&lt;br&gt;&lt;br&gt;&lt;br&gt;On Mon, 3 Nov 2008, monirajg&lt;br&gt;
 wrote:&lt;br&gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Hi,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; i have a system of equations for R, h and H. however, H = h/R at each time&lt;br&gt;&amp;gt; step, so i only solve for R and H using CVODE in Sundials TB. also, HDot &lt;br&gt;is&lt;br&gt;&amp;gt; a function of H, RDot and hDot, besides the independent variable X ( =&lt;br&gt;x/R,&lt;br&gt;&amp;gt; i.e. i also rescale x at each timestep). i need to rescale to keep my&lt;br&gt;domain&lt;br&gt;&amp;gt; between 0 to 1.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; at each time step ( in the RHS function):&lt;br&gt;&amp;gt; i calculate RDot ( function of current H), rescale h with ( R * H) ,&lt;br&gt;compute&lt;br&gt;&amp;gt; hDot, then compute HDot. i apply the BCs in both h and H while&lt;br&gt;discretizing&lt;br&gt;&amp;gt; the ODEs for h and H. i collect RDot and HDot in my fDot_CVODE.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; however, i think i can also solve for all R, h and H. in that case, at&lt;br&gt;each&lt;br&gt;&amp;gt; time step ( in the RHS function)&lt;br&gt;&amp;gt; i calculate RDot, calculate hDot, rescale H ( = h/R) and then compute&lt;br&gt;HDot.&lt;br&gt;&amp;gt; I apply
 the&lt;br&gt; BCs as before. i collect RDot, hDot and HDot in my fDot_CVODE.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; are these 2 cases same or just one if them is correct? if they are both&lt;br&gt;&amp;gt; wrong, then how do i do it, in particular the rescaling of my H and X at&lt;br&gt;&amp;gt; each time step?&lt;br&gt;&amp;gt; thanks,&lt;br&gt;&amp;gt; Moni&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; View this message in context: http://  www. &lt;br&gt;nabble.com/help-for-CVODE-tp20313697p20313697.html&lt;br&gt;&amp;gt; Sent from the Sundials - Users mailing list archive at Nabble.com.&lt;br&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;

      &lt;/div&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;

      &lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Fw%3A-Re%3A-help-for-CVODE-tp20352272p20352272.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20351823</id>
	<title>Re: help for CVODE</title>
	<published>2008-11-05T14:52:04Z</published>
	<updated>2008-11-05T14:52:04Z</updated>
	<author>
		<name>Alan Hindmarsh</name>
	</author>
	<content type="html">Hello Moni,
&lt;br&gt;&lt;br&gt;That is a good question. &amp;nbsp;Let me rephrase the 2 choices:
&lt;br&gt;&lt;br&gt;Choice 1 is to use CVODE on y = (R, H) and use h = H*R where needed.
&lt;br&gt;I take it that hdot = dh/dt is a known function of (R,h,H) directly,
&lt;br&gt;and so is Rdot. &amp;nbsp;Then you would use Hdot = (hdot - H Rdot)/R.
&lt;br&gt;&lt;br&gt;Choice 2 is to use y = (R, h, H) with all 3 ODEs, including the above Hdot.
&lt;br&gt;&lt;br&gt;Both are valid, but they are not the same, and Choice 1 is better. &amp;nbsp;The
&lt;br&gt;reason is that in 2, the relation h = H*R is not guaranteed. &amp;nbsp;The ODEs
&lt;br&gt;say that (d/dt)(h - H*R) = 0, but the value of h - H*R can drift away
&lt;br&gt;from 0 over the course of the integration. &amp;nbsp;It is better to have the
&lt;br&gt;relation built into the system directly.
&lt;br&gt;&lt;br&gt;I wonder why you don't make the more natural Choice 3: Use y = (R,h),
&lt;br&gt;with H = h/R as needed. &amp;nbsp;Then you never have to compute Hdot.
&lt;br&gt;&lt;br&gt;-Alan H
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Mon, 3 Nov 2008, monirajg wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; i have a system of equations for R, h and H. however, H = h/R at each time
&lt;br&gt;&amp;gt; step, so i only solve for R and H using CVODE in Sundials TB. also, HDot &amp;nbsp;is
&lt;br&gt;&amp;gt; a function of H, RDot and hDot, besides the independent variable X ( = x/R,
&lt;br&gt;&amp;gt; i.e. i also rescale x at each timestep). i need to rescale to keep my domain
&lt;br&gt;&amp;gt; between 0 to 1.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; at each time step ( in the RHS function):
&lt;br&gt;&amp;gt; i calculate RDot ( function of current H), rescale h with ( R * H) , compute
&lt;br&gt;&amp;gt; hDot, then compute HDot. i apply the BCs in both h and H while discretizing
&lt;br&gt;&amp;gt; the ODEs for h and H. i collect RDot and HDot in my fDot_CVODE.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; however, i think i can also solve for all R, h and H. in that case, at each
&lt;br&gt;&amp;gt; time step ( in the RHS function)
&lt;br&gt;&amp;gt; i calculate RDot, calculate hDot, rescale H ( = h/R) and then compute HDot.
&lt;br&gt;&amp;gt; I apply the BCs as before. i collect RDot, hDot and HDot in my fDot_CVODE.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; are these 2 cases same or just one if them is correct? if they are both
&lt;br&gt;&amp;gt; wrong, then how do i do it, in particular the rescaling of my H and X at
&lt;br&gt;&amp;gt; each time step?
&lt;br&gt;&amp;gt; thanks,
&lt;br&gt;&amp;gt; Moni
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; View this message in context: http:// www. nabble.com/help-for-CVODE-tp20313697p20313697.html
&lt;br&gt;&amp;gt; Sent from the Sundials - Users mailing list archive at Nabble.com.
&lt;br&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/help-for-CVODE-tp20313697p20351823.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20313697</id>
	<title>help for CVODE</title>
	<published>2008-11-03T16:02:55Z</published>
	<updated>2008-11-03T16:02:55Z</updated>
	<author>
		<name>monirajg</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;i have a system of equations for R, h and H. however, H = h/R at each time step, so i only solve for R and H using CVODE in Sundials TB. also, HDot &amp;nbsp;is a function of H, RDot and hDot, besides the independednt variable X ( = x/R, i.e. i also rescale x at each timestep). i need to rescale to keep my domain between 0 to 1.
&lt;br&gt;&lt;br&gt;at each time step ( in the RHS function):
&lt;br&gt;i calculate RDot ( function of current H), rescale h with ( R * H) , compute hDot, then compute HDot. i apply the BCs in both h and H while discretizing the ODEs for h and H. i collect RDot and HDot in my fDot_CVODE.
&lt;br&gt;&lt;br&gt;&lt;br&gt;however, i think i can also solve for all R, h and H. in that case, at each time step ( in the RHS function)
&lt;br&gt;i calculate RDot, calculate hDot, rescale H ( = h/R) and then compute HDot. I apply the BCs as before. i collect RDot, hDot and HDot in my fDot_CVODE.
&lt;br&gt;&lt;br&gt;are these 2 cases same or just one if them is correct? if they are both wrong, then how do i do it, in particular the rescaling of my H and X at each time step?
&lt;br&gt;thanks,
&lt;br&gt;Moni&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/help-for-CVODE-tp20313697p20313697.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20309480</id>
	<title>Re: WRMS norm versus monitoring residuals</title>
	<published>2008-11-03T11:48:46Z</published>
	<updated>2008-11-03T11:48:46Z</updated>
	<author>
		<name>Alan Hindmarsh</name>
	</author>
	<content type="html">Hello Andreas,
&lt;br&gt;&lt;br&gt;You asked about the choice of norm in convergence tests.
&lt;br&gt;The answer depends on which tests you mean.
&lt;br&gt;&lt;br&gt;In general, the choice of WRMS norm is somewhat arbitrary, and a
&lt;br&gt;weigted max-norm would do just as well. &amp;nbsp;Historically, the WRMS norm
&lt;br&gt;had an advantage in efficiency, in that summing squares and taking a
&lt;br&gt;square root was (on some machines at least) faster than finding the
&lt;br&gt;maximum absolute value. &amp;nbsp;I doubt if this is true now.
&lt;br&gt;&lt;br&gt;Of course any choice of norm would have to be weighted. &amp;nbsp;In general,
&lt;br&gt;there is no guarantee that the various components of y (and hence
&lt;br&gt;estimated errors in y) are commensurate, or that they even have the
&lt;br&gt;same physical dimensions. &amp;nbsp;(You can't compare cm with grams.) &amp;nbsp;They
&lt;br&gt;must be weighted by suitable factors to make them commensurate.
&lt;br&gt;&lt;br&gt;In the case of the convergence test in the SPGMR (Generalized Minimal
&lt;br&gt;Residual method) algorithm, the WRMS choice is dictated by the
&lt;br&gt;algorithm. &amp;nbsp;An important feature of GMRES is that the L2 norm of the
&lt;br&gt;linear system residual is available essentially free. &amp;nbsp;(By applying
&lt;br&gt;GMRES to a scaled problem [scaled by the weights and sqrt(N)], we make
&lt;br&gt;the L2 norm become a WRMS norm.)
&lt;br&gt;&lt;br&gt;-Alan H
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Mon, 3 Nov 2008, Andreas Nicolai wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello everyone,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have a question about the conversion test. What are the 'objective'
&lt;br&gt;&amp;gt; benefits of using a weighted root-mean-square convergence criterion in
&lt;br&gt;&amp;gt; CVODE versus a direct residual test for all G(y) equations?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The direct residual test could look like:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; maxnorm|G(y)| &amp;lt; limit
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; My understanding is that by checking the residuals we ensure that the
&lt;br&gt;&amp;gt; solution satisfies the balance equations completely. Whereas the WRMS norm
&lt;br&gt;&amp;gt; only guaranties that the iterative solution doesn't change/improve further
&lt;br&gt;&amp;gt; with respect to the given limits even though the balance equation COULD
&lt;br&gt;&amp;gt; NOT be completely satisfied.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks for explanations!
&lt;br&gt;&amp;gt; Andreas
&lt;br&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/WRMS-norm-versus-monitoring-residuals-tp20301961p20309480.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20301961</id>
	<title>WRMS norm versus monitoring residuals</title>
	<published>2008-11-03T04:35:33Z</published>
	<updated>2008-11-03T04:35:33Z</updated>
	<author>
		<name>Andreas Nicolai</name>
	</author>
	<content type="html">Hello everyone,
&lt;br&gt;&lt;br&gt;I have a question about the conversion test. What are the 'objective' &amp;nbsp;
&lt;br&gt;benefits of using a weighted root-mean-square convergence criterion in &amp;nbsp;
&lt;br&gt;CVODE versus a direct residual test for all G(y) equations?
&lt;br&gt;&lt;br&gt;The direct residual test could look like:
&lt;br&gt;&lt;br&gt;maxnorm|G(y)| &amp;lt; limit
&lt;br&gt;&lt;br&gt;My understanding is that by checking the residuals we ensure that the &amp;nbsp;
&lt;br&gt;solution satisfies the balance equations completely. Whereas the WRMS norm &amp;nbsp;
&lt;br&gt;only guaranties that the iterative solution doesn't change/improve further &amp;nbsp;
&lt;br&gt;with respect to the given limits even though the balance equation COULD &amp;nbsp;
&lt;br&gt;NOT be completely satisfied.
&lt;br&gt;&lt;br&gt;Thanks for explanations!
&lt;br&gt;Andreas
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/WRMS-norm-versus-monitoring-residuals-tp20301961p20301961.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20236351</id>
	<title>Re: one more question</title>
	<published>2008-10-29T14:31:44Z</published>
	<updated>2008-10-29T14:31:44Z</updated>
	<author>
		<name>monirajg</name>
	</author>
	<content type="html">&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot;&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; style=&quot;font: inherit;&quot;&gt;&lt;DIV&gt;Hi&amp;nbsp; Alan,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;thanks for your reply. &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;sorry for not replying to your earlier question, but i modified my problem a bit and ended up using periodic boundary conditions. so I adjusted my nodes so that ( conceptually) the first and the last nodes overlapped. it worked and we got results and currently seeing if they make sense.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;currently, we are trying a different flavor of the same equation, but in this case we cannot use periodic BCs. however, as u correctly said, that i mentioned 3 BCs for a 4th order equation. i read in the literature that for diff equations where the coefficient of the highest order derivative is zero at a boundary, ( which is precisely the case in our problem) , one less BC is needed for a bounded solution. i will go ahead and try to see if that works. if not i will probably make h_xxxx = 0.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Moni&lt;BR&gt;&lt;BR&gt;--- On &lt;B&gt;Thu, 10/30/08, Alan Hindmarsh &lt;I&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20236351&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alanh@...&lt;/a&gt;&amp;gt;&lt;/I&gt;&lt;/B&gt; wrote:&lt;BR&gt;&lt;/DIV&gt;
&lt;BLOCKQUOTE style=&quot;PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid&quot;&gt;From: Alan Hindmarsh &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20236351&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alanh@...&lt;/a&gt;&amp;gt;&lt;BR&gt;Subject: Re: [sundials-users] one more question&lt;BR&gt;To: &quot;monirajg&quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20236351&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;monirajg@...&lt;/a&gt;&amp;gt;&lt;BR&gt;Cc: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20236351&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sundials-users@...&lt;/a&gt;, &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20236351&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alanh@...&lt;/a&gt;&lt;BR&gt;Date: Thursday, October 30, 2008, 2:11 AM&lt;BR&gt;&lt;BR&gt;&lt;PRE&gt;Hi Moni,

Yes, you can do exactly that sort of thing, and that is the usual way
to treat these problems, at least for diffusion-type problems.  With
higher order derivatives, it gets more involved, but the same idea applies.

However, you have another fundamental problem.  With a PDE that is 4th
order in space, you need 4 BCs to make the problem well-posed.  You
only mention 3.  What is the 4th?  Are you prescribing the (nonzero)
value of h_xx(x=0)?  (I raised this question earlier, but did not get
an answer.)

-Alan H



On Tue, 28 Oct 2008, monirajg wrote:

&amp;gt;
&amp;gt; hi,
&amp;gt; for the following eqn,
&amp;gt;
&amp;gt; h_t = (1/3) [ h^3 ( -h_xxx + B * h_x)]_x
&amp;gt;
&amp;gt; B is a constant
&amp;gt;
&amp;gt; if i want to implement the BCs , h_x (x = 0) = h_xxx (x = 0) = 0 ( but
h_xx
&amp;gt; (x = 0) is not = 0) and h(N) = 0,
&amp;gt; can i do this in the RHS function. i.e., in the discretized ODEs, can i
&amp;gt; replace some h values with the relations that i get from discretizing the
&amp;gt; BCs? e.g. h_x = 0 implies h_1 = h_2. so can i replace h_2 with h_1 in the
&amp;gt; discretixzed ODEs and so on?
&amp;gt;
&amp;gt; thanks for your time,
&amp;gt; Moni
&amp;gt; --
&amp;gt; View this message in context: http://  www. 
nabble.com/one-more-question-tp20210781p20210781.html
&amp;gt; Sent from the Sundials - Users mailing list archive at Nabble.com.
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;

      &lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/one-more-question-tp20210781p20236351.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20235527</id>
	<title>Re: one more question</title>
	<published>2008-10-29T13:41:23Z</published>
	<updated>2008-10-29T13:41:23Z</updated>
	<author>
		<name>Alan Hindmarsh</name>
	</author>
	<content type="html">Hi Moni,
&lt;br&gt;&lt;br&gt;Yes, you can do exactly that sort of thing, and that is the usual way
&lt;br&gt;to treat these problems, at least for diffusion-type problems. &amp;nbsp;With
&lt;br&gt;higher order derivatives, it gets more involved, but the same idea applies.
&lt;br&gt;&lt;br&gt;However, you have another fundamental problem. &amp;nbsp;With a PDE that is 4th
&lt;br&gt;order in space, you need 4 BCs to make the problem well-posed. &amp;nbsp;You
&lt;br&gt;only mention 3. &amp;nbsp;What is the 4th? &amp;nbsp;Are you prescribing the (nonzero)
&lt;br&gt;value of h_xx(x=0)? &amp;nbsp;(I raised this question earlier, but did not get
&lt;br&gt;an answer.)
&lt;br&gt;&lt;br&gt;-Alan H
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On Tue, 28 Oct 2008, monirajg wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; hi,
&lt;br&gt;&amp;gt; for the following eqn,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; h_t = (1/3) [ h^3 ( -h_xxx + B * h_x)]_x
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; B is a constant
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; if i want to implement the BCs , h_x (x = 0) = h_xxx (x = 0) = 0 ( but h_xx
&lt;br&gt;&amp;gt; (x = 0) is not = 0) and h(N) = 0,
&lt;br&gt;&amp;gt; can i do this in the RHS function. i.e., in the discretized ODEs, can i
&lt;br&gt;&amp;gt; replace some h values with the relations that i get from discretizing the
&lt;br&gt;&amp;gt; BCs? e.g. h_x = 0 implies h_1 = h_2. so can i replace h_2 with h_1 in the
&lt;br&gt;&amp;gt; discretixzed ODEs and so on?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; thanks for your time,
&lt;br&gt;&amp;gt; Moni
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; View this message in context: http:// www. nabble.com/one-more-question-tp20210781p20210781.html
&lt;br&gt;&amp;gt; Sent from the Sundials - Users mailing list archive at Nabble.com.
&lt;br&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/one-more-question-tp20210781p20235527.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20210781</id>
	<title>one more question</title>
	<published>2008-10-28T09:29:26Z</published>
	<updated>2008-10-28T09:29:26Z</updated>
	<author>
		<name>monirajg</name>
	</author>
	<content type="html">hi,
&lt;br&gt;for the following eqn, 
&lt;br&gt;&lt;br&gt;h_t = (1/3) [ h^3 ( -h_xxx + B * h_x)]_x 
&lt;br&gt;&lt;br&gt;B is a constant
&lt;br&gt;&lt;br&gt;if i want to implement the BCs , h_x (x = 0) = h_xxx (x = 0) = 0 ( but h_xx (x = 0) is not = 0) and h(N) = 0, 
&lt;br&gt;can i do this in the RHS function. i.e., in the discretized ODEs, can i replace some h values with the relations that i get from discretizing the BCs? e.g. h_x = 0 implies h_1 = h_2. so can i replace h_2 with h_1 in the discretixzed ODEs and so on? 
&lt;br&gt;&lt;br&gt;thanks for your time,
&lt;br&gt;Moni&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/one-more-question-tp20210781p20210781.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20201426</id>
	<title>preallocating the rhs for CVODE in sundials TB</title>
	<published>2008-10-27T21:59:36Z</published>
	<updated>2008-10-27T21:59:36Z</updated>
	<author>
		<name>monirajg</name>
	</author>
	<content type="html">this might be very trivial. still let me ask :-)
&lt;br&gt;&lt;br&gt;in matab, it is recommended that i pre allocate a variable ( as opposed to dynamic allocation) to increase speed. so can i pre allocate &amp;nbsp;f_dot &amp;nbsp;( i.e specify the size and assign zeros) at the beginning of the RHS function, before allocating the individual elements using central differencing through for loops? i think that the RHS function is called several times within a timestep ( for estimating initial timestep, the DQ jacobian). will that mess up the RHS if i assign zero to f_dot evry time RHS function is evoked?
&lt;br&gt;&lt;br&gt;thanks
&lt;br&gt;Moni
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/preallocating-the-rhs-for-CVODE-in-sundials-TB-tp20201426p20201426.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20190154</id>
	<title>Re: Forward Sensitivities taking too long</title>
	<published>2008-10-27T08:33:09Z</published>
	<updated>2008-10-27T08:33:09Z</updated>
	<author>
		<name>Radu Serban-3</name>
	</author>
	<content type="html">Sree Rama Raju V wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi all,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am using CVODES to evaluate direct sensitivities for my model in which
&lt;br&gt;&amp;gt; IC's are also parameters. I have calculated the sensitivities using the
&lt;br&gt;&amp;gt; staggered-corrector option in CVODES. Here, I am using Automatic
&lt;br&gt;&amp;gt; differentiation to provide the RHS of the sensitivity eqns and also the
&lt;br&gt;&amp;gt; integrator of the Jacobian. 
&lt;br&gt;&amp;gt; My model has 300 states and a total of 328 parameters (including IC's).
&lt;br&gt;&amp;gt; The sensitivities of all the states w.r.t the first IC just took 20
&lt;br&gt;&amp;gt; secs. But, when the sentivities of all states w.r.t all the 328
&lt;br&gt;&amp;gt; parameters are computed it took 4hrs. I initially thought it would take
&lt;br&gt;&amp;gt; less than (328*20 secs ~ 2hrs). What would be the reason it is taking
&lt;br&gt;&amp;gt; that long?
&lt;br&gt;&amp;gt; I also tried to compute the sensitivities by reducing the number of
&lt;br&gt;&amp;gt; states in my model to 100 (and 128 parameters). In this case, it took
&lt;br&gt;&amp;gt; just 10 minutes.
&lt;br&gt;&amp;gt; So, is it better to compute the sensitivity of all states w.r.t to each
&lt;br&gt;&amp;gt; parameter(or a few parameters) at a time by using a for loop? OR is
&lt;br&gt;&amp;gt; there any way I could speed up my calculations? Adjoint Sensitivities
&lt;br&gt;&amp;gt; wouldn't help in my case because I will end up solving the same number
&lt;br&gt;&amp;gt; of equations as in direct sensitivities i.e. I need to form 300 adjoint
&lt;br&gt;&amp;gt; sensitivites and also there is an additional cost because of
&lt;br&gt;&amp;gt; check-pointing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Sreeram
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Sreeram,
&lt;br&gt;There are several reasons why the solution time does not vary linearly 
&lt;br&gt;with the number of sensitivity parameters, including the possibility 
&lt;br&gt;that one (or more) of the sensitivities controls the integration 
&lt;br&gt;stepsize. You will need to look closer at the reported solver statistics 
&lt;br&gt;and experiment with different tolerances for the sensitivity variables 
&lt;br&gt;(do you let CVODES select those?) as well as with including/excluding 
&lt;br&gt;the sensitivity variables from the error control (recall that even if 
&lt;br&gt;those are excluded from the error control test, you still have to 
&lt;br&gt;provide tolerances for them for use in the nonlinear solver).
&lt;br&gt;A second possible explanation for the timings you observe has to do with 
&lt;br&gt;memory caching which could explain why the smaller model was 
&lt;br&gt;(relatively) faster.
&lt;br&gt;It is difficult to say what is going on, especially not knowing what 
&lt;br&gt;your model is exactly (for example, does it come from a PDE 
&lt;br&gt;semi-discretization and does the smaller one simply correspond to a 
&lt;br&gt;coarser discretization?).
&lt;br&gt;Regarding the ASA option, if you *do* need all state sensitivities at 
&lt;br&gt;all times then yes, ASA is not an option (even if you can get away 
&lt;br&gt;without the need for checkpoints).
&lt;br&gt;--Radu
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Forward-Sensitivities-taking-too-long-tp20156351p20190154.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20189817</id>
	<title>Re: CVODE in SUNDIALSTB</title>
	<published>2008-10-27T08:15:40Z</published>
	<updated>2008-10-27T08:15:40Z</updated>
	<author>
		<name>Radu Serban-3</name>
	</author>
	<content type="html">monirajg wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; hi, 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; i am studying the motion of a spherical drop of liquid that is beading up. 
&lt;br&gt;&amp;gt; in 1 D, i have a x domain ( the radius of the base of the drop) &amp;nbsp;which
&lt;br&gt;&amp;gt; decreases with time. so i need to solve for the height of the drop only in
&lt;br&gt;&amp;gt; that current x domain as i know that beyond that domain ( i.e the radius)
&lt;br&gt;&amp;gt; the height is zero.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; can i update the x domain between &amp;nbsp;calls to CVODE? or do i have to &amp;nbsp;take
&lt;br&gt;&amp;gt; care of that inside the RHS function? Any suggestions?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; thanks
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Moni
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Hi Moni,
&lt;br&gt;If I understand it correctly, you effectively suggest changing the 
&lt;br&gt;number of equations during the integration, which is not possible. You 
&lt;br&gt;could either continue integrating the states that you know should be 
&lt;br&gt;zero after a certain time (assuming your model will keep them at or 
&lt;br&gt;close to zero) or else, within the RHS function, set to zero the 
&lt;br&gt;derivatives for those states that correspond to x values outside the 
&lt;br&gt;support of the drop (keeping in mind that, again depending on your 
&lt;br&gt;model, this may introduce discontinuities).
&lt;br&gt;--Radu
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/CVODE-in-SUNDIALSTB-tp20153586p20189817.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20189651</id>
	<title>Re: CVodeMallocB failing</title>
	<published>2008-10-27T08:06:39Z</published>
	<updated>2008-10-27T08:06:39Z</updated>
	<author>
		<name>Radu Serban-3</name>
	</author>
	<content type="html">Rishi Amrit wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;I am doing an adjoint calculation using the sundials toolbox in octave.
&lt;br&gt;&amp;gt; It works fine if my absolute tolerance for the backward integration is a
&lt;br&gt;&amp;gt; scalar. The moment I set it to a vector, the code crashes when CVodeMallocB
&lt;br&gt;&amp;gt; is called with the options setting Abs &amp;nbsp;Tol to a vector. Here is the piece
&lt;br&gt;&amp;gt; of code:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; ## Initial condition for the backward quadrature.
&lt;br&gt;&amp;gt; &amp;nbsp; w = zeros (np,1)';
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; lambda1 = zeros(nx,1);
&lt;br&gt;&amp;gt; &amp;nbsp; ## Set options for the backward integration of the adjoint equation and
&lt;br&gt;&amp;gt; &amp;nbsp; ## quadrature.
&lt;br&gt;&amp;gt; &amp;nbsp; optionsb = CVodeSetOptions (&amp;quot;RelTol&amp;quot;, sqrt(eps),
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;AbsTol&amp;quot;, sqrt(eps)*ones(nx,1),
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;MaxNumSteps&amp;quot;,1e8,
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Quadratures&amp;quot;, &amp;quot;off&amp;quot;,
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadRhsFn&amp;quot;, @fqb,
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadInitcond&amp;quot;, w,
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadErrControl&amp;quot;, &amp;quot;on&amp;quot;,
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadRelTol&amp;quot;, sqrt(eps),
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadAbsTol&amp;quot;, sqrt(eps));
&lt;br&gt;&amp;gt; 			 &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; ## Allocate storage and set initial conditions for integrator.
&lt;br&gt;&amp;gt; &amp;nbsp; CVodeMallocB (@fb, pvecT(end), lambda1, optionsb);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Octave crashes on this last line with the following output:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; panic: Segmentation fault -- stopping myself...
&lt;br&gt;&amp;gt; attempting to save variables to `octave-core'...
&lt;br&gt;&amp;gt; warning: unable to open `octave-core' for writing...
&lt;br&gt;&amp;gt; Segmentation fault
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Not sure what might be going wrong. For simple integration and forward
&lt;br&gt;&amp;gt; sensitivity calculation, passing AbsTol as a vector works fine. I would
&lt;br&gt;&amp;gt; expect to be able to do it with backward integration step too. Any ideas ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Best,
&lt;br&gt;&amp;gt; Rishi 
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Hi Rishi,
&lt;br&gt;I can confirm what appears to be a bug in the released version of the 
&lt;br&gt;toolbox (it works fine in the development version, but that one is quite 
&lt;br&gt;a bit different, especially in the ASA portion). I'll look for a fix 
&lt;br&gt;when I get a chance.
&lt;br&gt;--Radu
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/CVodeMallocB-failing-tp20072345p20189651.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20156351</id>
	<title>Forward Sensitivities taking too long</title>
	<published>2008-10-24T12:19:00Z</published>
	<updated>2008-10-24T12:19:00Z</updated>
	<author>
		<name>sreerama</name>
	</author>
	<content type="html">Hi all,
&lt;br&gt;&lt;br&gt;I am using CVODES to evaluate direct sensitivities for my model in which
&lt;br&gt;IC's are also parameters. I have calculated the sensitivities using the
&lt;br&gt;staggered-corrector option in CVODES. Here, I am using Automatic
&lt;br&gt;differentiation to provide the RHS of the sensitivity eqns and also the
&lt;br&gt;integrator of the Jacobian. 
&lt;br&gt;My model has 300 states and a total of 328 parameters (including IC's).
&lt;br&gt;The sensitivities of all the states w.r.t the first IC just took 20
&lt;br&gt;secs. But, when the sentivities of all states w.r.t all the 328
&lt;br&gt;parameters are computed it took 4hrs. I initially thought it would take
&lt;br&gt;less than (328*20 secs ~ 2hrs). What would be the reason it is taking
&lt;br&gt;that long?
&lt;br&gt;I also tried to compute the sensitivities by reducing the number of
&lt;br&gt;states in my model to 100 (and 128 parameters). In this case, it took
&lt;br&gt;just 10 minutes.
&lt;br&gt;So, is it better to compute the sensitivity of all states w.r.t to each
&lt;br&gt;parameter(or a few parameters) at a time by using a for loop? OR is
&lt;br&gt;there any way I could speed up my calculations? Adjoint Sensitivities
&lt;br&gt;wouldn't help in my case because I will end up solving the same number
&lt;br&gt;of equations as in direct sensitivities i.e. I need to form 300 adjoint
&lt;br&gt;sensitivites and also there is an additional cost because of
&lt;br&gt;check-pointing.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Sreeram
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Forward-Sensitivities-taking-too-long-tp20156351p20156351.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20153586</id>
	<title>CVODE in SUNDIALSTB</title>
	<published>2008-10-24T09:41:21Z</published>
	<updated>2008-10-24T09:41:21Z</updated>
	<author>
		<name>monirajg</name>
	</author>
	<content type="html">hi, 
&lt;br&gt;&lt;br&gt;i am studying the motion of a spherical drop of liquid that is beading up. 
&lt;br&gt;in 1 D, i have a x domain ( the radius of the base of the drop) &amp;nbsp;which decreases with time. so i need to solve for the height of the drop only in that current x domain as i know that beyond that domain ( i.e the radius) the height is zero.
&lt;br&gt;&lt;br&gt;can i update the x domain between &amp;nbsp;calls to CVODE? or do i have to &amp;nbsp;take care of that inside the RHS function? Any suggestions?
&lt;br&gt;&lt;br&gt;thanks
&lt;br&gt;&lt;br&gt;Moni&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/CVODE-in-SUNDIALSTB-tp20153586p20153586.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20072345</id>
	<title>CVodeMallocB failing</title>
	<published>2008-10-20T08:19:32Z</published>
	<updated>2008-10-20T08:19:32Z</updated>
	<author>
		<name>Rishi Amrit</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;Hi,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; I am doing an adjoint&amp;nbsp;calculation&amp;nbsp;using the sundials toolbox in octave. It works fine if my&amp;nbsp;absolute&amp;nbsp;tolerance for the backward&amp;nbsp;integration&amp;nbsp;is a scalar. The moment I set it to a vector, the code crashes when CVodeMallocB is called with the options setting Abs &amp;nbsp;Tol to a vector. Here is the piece of code:&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;## Initial condition for the backward quadrature.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;w = zeros (np,1)&amp;#39;;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;lambda1 = zeros(nx,1);&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;## Set options for the backward integration of the adjoint equation and&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;## quadrature.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;optionsb = CVodeSetOptions (&amp;quot;RelTol&amp;quot;, sqrt(eps),&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;AbsTol&amp;quot;, sqrt(eps)*ones(nx,1),&lt;/div&gt;&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;MaxNumSteps&amp;quot;,1e8,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Quadratures&amp;quot;, &amp;quot;off&amp;quot;,&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadRhsFn&amp;quot;, @fqb,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadInitcond&amp;quot;, w,&lt;/div&gt;&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadErrControl&amp;quot;, &amp;quot;on&amp;quot;,&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadRelTol&amp;quot;, sqrt(eps),&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;QuadAbsTol&amp;quot;, sqrt(eps));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;## Allocate storage and set initial conditions for integrator.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;CVodeMallocB (@fb, pvecT(end), lambda1, optionsb);&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Octave crashes on this last line with the following output:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;panic: Segmentation fault -- stopping myself...&lt;/div&gt;
&lt;div&gt;attempting to save variables to `octave-core&amp;#39;...&lt;br&gt;&lt;/div&gt;&lt;div&gt;warning: unable to open `octave-core&amp;#39; for writing...&lt;br&gt;&lt;/div&gt;&lt;div&gt;Segmentation fault&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Not sure what might be going wrong. For simple integration and forward sensitivity calculation, passing AbsTol as a vector works fine. I would expect to be able to do it with backward&amp;nbsp;integration&amp;nbsp;step too. Any ideas ?&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Best,&lt;/div&gt;&lt;div&gt;Rishi&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/CVodeMallocB-failing-tp20072345p20072345.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20016961</id>
	<title>RE: Implementing ODE's with delay</title>
	<published>2008-10-16T08:42:59Z</published>
	<updated>2008-10-16T08:42:59Z</updated>
	<author>
		<name>Sharon_A</name>
	</author>
	<content type="html">Thanks for all the replies. My case is a simple fixed delay, so I may try
&lt;br&gt;to use CVODE afer all and check for different intervals as suggested.
&lt;br&gt;&lt;br&gt;Sharon
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What about issues with delays that are not fixed, but are dependent on
&lt;br&gt;&amp;gt; state
&lt;br&gt;&amp;gt; variables and t? &amp;nbsp;Also, it is possible in state dependent situations that
&lt;br&gt;&amp;gt; the delays vary to the point where they are sometimes smaller than the
&lt;br&gt;&amp;gt; current integration step size. &amp;nbsp;These are some of the issues mentioned in
&lt;br&gt;&amp;gt; papers on DDE methods, e.g. Shampine, L.F, &amp;quot;Solving ODEs and DDEs with
&lt;br&gt;&amp;gt; residual control&amp;quot;, Applied Numerical Mathematics
&lt;br&gt;&amp;gt; Volume 52, Issue 1, January 2005, Pages 113-127.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If they are simply fixed offsets then the above are not issues.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Randall
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt;&amp;gt; From: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20016961&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;owner-sundials-users@...&lt;/a&gt; [mailto:owner-sundials-
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20016961&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;users@...&lt;/a&gt;] On Behalf Of Andreas Nicolai
&lt;br&gt;&amp;gt;&amp;gt; Sent: Thursday, 16 October 2008 8:49 p.m.
&lt;br&gt;&amp;gt;&amp;gt; To: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20016961&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sundials-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; Subject: Re: [sundials-users] Implementing ODE's with delay
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi Sharon,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; if I may add my recommendations as well: try using the SUNDIALS solvers,
&lt;br&gt;&amp;gt;&amp;gt; you will have a hard time finding better ones. Plus, I successfully
&lt;br&gt;&amp;gt;&amp;gt; stored
&lt;br&gt;&amp;gt;&amp;gt; results from previous time points and used interpolated values in my RHS
&lt;br&gt;&amp;gt;&amp;gt; function. In my experience, the accuracy concerns that Alan was talking
&lt;br&gt;&amp;gt;&amp;gt; about are not so important, because typically larger errors stem from
&lt;br&gt;&amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt;&amp;gt; spatial discretization of your problem or the input data in general. So,
&lt;br&gt;&amp;gt;&amp;gt; 1st or 2nd order interpolation should do.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Here's an algorithm I used that worked fairly well:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; - after each successful call to for instance CVODE, append the y-values
&lt;br&gt;&amp;gt;&amp;gt; to
&lt;br&gt;&amp;gt;&amp;gt; some history array (can be a queue, where you remove no longer needed
&lt;br&gt;&amp;gt;&amp;gt; history data from the front and add to the back)
&lt;br&gt;&amp;gt;&amp;gt; - create an interpolation function like the one inside CVODE, and call
&lt;br&gt;&amp;gt;&amp;gt; this first thing in your right hand side to get the y(t-toffset) values,
&lt;br&gt;&amp;gt;&amp;gt; this interpolation function should search the history array for the
&lt;br&gt;&amp;gt;&amp;gt; correct intervals (use some kind of binary tree with the indices) and
&lt;br&gt;&amp;gt;&amp;gt; then
&lt;br&gt;&amp;gt;&amp;gt; do a simple first order or second order interpolation.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If you keep the return step sizes for CVODE small enough, you can limit
&lt;br&gt;&amp;gt;&amp;gt; the error somewhat. For accuracy-critical problems I typically ran CVODE
&lt;br&gt;&amp;gt;&amp;gt; with large calculation steps first, then again with smaller and check
&lt;br&gt;&amp;gt;&amp;gt; how
&lt;br&gt;&amp;gt;&amp;gt; strong the solution varies. Then you have an idea of what error you may
&lt;br&gt;&amp;gt;&amp;gt; get as a result of &amp;quot;incorrect interpolation&amp;quot; versus potential errors
&lt;br&gt;&amp;gt;&amp;gt; from
&lt;br&gt;&amp;gt;&amp;gt; input data.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Andreas
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Implementing-ODE%27s-with-delay-tp19985237p20016961.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20009974</id>
	<title>RE: Implementing ODE's with delay</title>
	<published>2008-10-16T02:10:20Z</published>
	<updated>2008-10-16T02:10:20Z</updated>
	<author>
		<name>Randall Britten</name>
	</author>
	<content type="html">Hi
&lt;br&gt;&lt;br&gt;What about issues with delays that are not fixed, but are dependent on state
&lt;br&gt;variables and t? &amp;nbsp;Also, it is possible in state dependent situations that
&lt;br&gt;the delays vary to the point where they are sometimes smaller than the
&lt;br&gt;current integration step size. &amp;nbsp;These are some of the issues mentioned in
&lt;br&gt;papers on DDE methods, e.g. Shampine, L.F, &amp;quot;Solving ODEs and DDEs with
&lt;br&gt;residual control&amp;quot;, Applied Numerical Mathematics
&lt;br&gt;Volume 52, Issue 1, January 2005, Pages 113-127.
&lt;br&gt;&lt;br&gt;If they are simply fixed offsets then the above are not issues.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Randall
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20009974&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;owner-sundials-users@...&lt;/a&gt; [mailto:owner-sundials-
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20009974&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;users@...&lt;/a&gt;] On Behalf Of Andreas Nicolai
&lt;br&gt;&amp;gt; Sent: Thursday, 16 October 2008 8:49 p.m.
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=20009974&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sundials-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Subject: Re: [sundials-users] Implementing ODE's with delay
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hi Sharon,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; if I may add my recommendations as well: try using the SUNDIALS solvers,
&lt;br&gt;&amp;gt; you will have a hard time finding better ones. Plus, I successfully
&lt;br&gt;&amp;gt; stored
&lt;br&gt;&amp;gt; results from previous time points and used interpolated values in my RHS
&lt;br&gt;&amp;gt; function. In my experience, the accuracy concerns that Alan was talking
&lt;br&gt;&amp;gt; about are not so important, because typically larger errors stem from
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; spatial discretization of your problem or the input data in general. So,
&lt;br&gt;&amp;gt; 1st or 2nd order interpolation should do.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Here's an algorithm I used that worked fairly well:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - after each successful call to for instance CVODE, append the y-values
&lt;br&gt;&amp;gt; to
&lt;br&gt;&amp;gt; some history array (can be a queue, where you remove no longer needed
&lt;br&gt;&amp;gt; history data from the front and add to the back)
&lt;br&gt;&amp;gt; - create an interpolation function like the one inside CVODE, and call
&lt;br&gt;&amp;gt; this first thing in your right hand side to get the y(t-toffset) values,
&lt;br&gt;&amp;gt; this interpolation function should search the history array for the
&lt;br&gt;&amp;gt; correct intervals (use some kind of binary tree with the indices) and
&lt;br&gt;&amp;gt; then
&lt;br&gt;&amp;gt; do a simple first order or second order interpolation.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; If you keep the return step sizes for CVODE small enough, you can limit
&lt;br&gt;&amp;gt; the error somewhat. For accuracy-critical problems I typically ran CVODE
&lt;br&gt;&amp;gt; with large calculation steps first, then again with smaller and check
&lt;br&gt;&amp;gt; how
&lt;br&gt;&amp;gt; strong the solution varies. Then you have an idea of what error you may
&lt;br&gt;&amp;gt; get as a result of &amp;quot;incorrect interpolation&amp;quot; versus potential errors
&lt;br&gt;&amp;gt; from
&lt;br&gt;&amp;gt; input data.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Andreas
&lt;/div&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Implementing-ODE%27s-with-delay-tp19985237p20009974.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-20008851</id>
	<title>Re: Implementing ODE's with delay</title>
	<published>2008-10-16T00:49:09Z</published>
	<updated>2008-10-16T00:49:09Z</updated>
	<author>
		<name>Andreas Nicolai</name>
	</author>
	<content type="html">Hi Sharon,
&lt;br&gt;&lt;br&gt;if I may add my recommendations as well: try using the SUNDIALS solvers, &amp;nbsp;
&lt;br&gt;you will have a hard time finding better ones. Plus, I successfully stored &amp;nbsp;
&lt;br&gt;results from previous time points and used interpolated values in my RHS &amp;nbsp;
&lt;br&gt;function. In my experience, the accuracy concerns that Alan was talking &amp;nbsp;
&lt;br&gt;about are not so important, because typically larger errors stem from the &amp;nbsp;
&lt;br&gt;spatial discretization of your problem or the input data in general. So, &amp;nbsp;
&lt;br&gt;1st or 2nd order interpolation should do.
&lt;br&gt;&lt;br&gt;Here's an algorithm I used that worked fairly well:
&lt;br&gt;&lt;br&gt;- after each successful call to for instance CVODE, append the y-values to &amp;nbsp;
&lt;br&gt;some history array (can be a queue, where you remove no longer needed &amp;nbsp;
&lt;br&gt;history data from the front and add to the back)
&lt;br&gt;- create an interpolation function like the one inside CVODE, and call &amp;nbsp;
&lt;br&gt;this first thing in your right hand side to get the y(t-toffset) values, &amp;nbsp;
&lt;br&gt;this interpolation function should search the history array for the &amp;nbsp;
&lt;br&gt;correct intervals (use some kind of binary tree with the indices) and then &amp;nbsp;
&lt;br&gt;do a simple first order or second order interpolation.
&lt;br&gt;&lt;br&gt;If you keep the return step sizes for CVODE small enough, you can limit &amp;nbsp;
&lt;br&gt;the error somewhat. For accuracy-critical problems I typically ran CVODE &amp;nbsp;
&lt;br&gt;with large calculation steps first, then again with smaller and check how &amp;nbsp;
&lt;br&gt;strong the solution varies. Then you have an idea of what error you may &amp;nbsp;
&lt;br&gt;get as a result of &amp;quot;incorrect interpolation&amp;quot; versus potential errors from &amp;nbsp;
&lt;br&gt;input data.
&lt;br&gt;&lt;br&gt;Andreas
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/Sundials---Users-f22834.html&quot; embed=&quot;fixTarget[22834]&quot; target=&quot;_top&quot; &gt;Sundials - Users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Implementing-ODE%27s-with-delay-tp19985237p20008851.html" />
</entry>

</feed>
