CVodeGet

View: New views
3 Messages — Rating Filter:   Alert me  

CVodeGet

by monirajg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all.
I have a quick question.
How does CVodeGet compute the derivatives ( higher order) of the solution , say, y ? In particular, is it any better  (or worse) to get the solution and compute the derivatives using matlab for example. A reason ( at least in my problems) is that the solution is noisy and higher derivatives are more affected by the noise, so an intermediate smoothing of the solution ( as can be done in matlab) is helpful.

Thanks
Moni

Re: CVodeGet

by Alan Hindmarsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Moni,

I would think the two numerical derivatives would be of about equal
quality.  The ones from CVodeGetDky are essentially difference
approximations based on the most recent values of the computed
solution values.  I would guess that the ones you'll get from Matlab
are the done the same way.  Also, remember that as CVode adjusts its
step sizes to make the computed local errors smaller than the
tolerances, this also insures that the highest numerical derivatives
are also not too large.

You say your solution is noisy.  Do you mean the CVode computed
solution has short-term oscillations or spikes?  In that case, CVode
will choose small steps to resolve that behavior, and the derivative
values will (or should) accurately reflect that.  But if you want
the derivatives of a curve that is an artificially smoothed version
of the CVode solution, you will certainly get different values; they
will NOT be derivatives of the ODE solution, though.

-Alan



On Wed, 26 Aug 2009, monirajg wrote:

>
> Hi all.
> I have a quick question.
> How does CVodeGet compute the derivatives ( higher order) of the solution ,
> say, y ? In particular, is it any better  (or worse) to get the solution and
> compute the derivatives using matlab for example. A reason ( at least in my
> problems) is that the solution is noisy and higher derivatives are more
> affected by the noise, so an intermediate smoothing of the solution ( as can
> be done in matlab) is helpful.
>
> Thanks
> Moni
> --
> View this message in context: http://*www.*nabble.com/CVodeGet-tp25156982p25156982.html
> Sent from the Sundials - Users mailing list archive at Nabble.com.
>
>
>

Re: CVodeGet

by monirajg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


HI Alan,

thanks for your reply. let me explain.

The y vs x data for different times as i get from CVode  is fine, not noisy
 
However i need to calculate pressure which  requires me to calculate  derivatives upto d3y/dx3 for each time step.  i have been doing it in matlab and i find the results of the numerical derivative to be progressively noisy. That is why i  needed to smooth, say the d2y/dx2 before calculating the d3y/dx3.

the question is whether this noise ( probably has something to do with the mesh size , i.e. delx) will be there too if i use CVodeGetDky to get the higher derivatives? I guess from your reply you mean they will be similarly noisy. right?

Moni





--- On Thu, 8/27/09, Alan Hindmarsh <alanh@...> wrote:

From: Alan Hindmarsh <alanh@...>
Subject: Re: [sundials-users] CVodeGet
To: "monirajg" <monirajg@...>
Cc: sundials-users@..., alanh@...
Date: Thursday, August 27, 2009, 2:31 AM

Hello Moni,

I would think the two numerical derivatives would be of about equal
quality.  The ones from CVodeGetDky are essentially difference
approximations based on the most recent values of the computed
solution values.  I would guess that the ones you'll get from Matlab
are the done the same way.  Also, remember that as CVode adjusts its
step sizes to make the computed local errors smaller than the
tolerances, this also insures that the highest numerical derivatives
are also not too large.

You say your solution is noisy.  Do you mean the CVode computed
solution has short-term oscillations or spikes?  In that case, CVode
will choose small steps to resolve that behavior, and the derivative
values will (or should) accurately reflect that.  But if you want
the derivatives of a curve that is an artificially smoothed version
of the CVode solution, you will certainly get different values; they
will NOT be derivatives of the ODE solution, though.

-Alan



On Wed, 26 Aug 2009, monirajg wrote:

>
> Hi all.
> I have a quick question.
> How does CVodeGet compute the derivatives ( higher order) of the solution ,
> say, y ? In particular, is it any better  (or worse) to get the solution and
> compute the derivatives using matlab for example. A reason ( at least in my
> problems) is that the solution is noisy and higher derivatives are more
> affected by the noise, so an intermediate smoothing of the solution ( as can
> be done in matlab) is helpful.
>
> Thanks
> Moni
> --
> View this message in context: http://**www.**nabble.com/CVodeGet-tp25156982p25156982.html
> Sent from the Sundials - Users mailing list archive at Nabble.com.
>
>
>