The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Differentiate Gadget Questions

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
cdrozdowski111 Posted - 05/26/2014 : 05:59:47 AM
OriginPro 9.1 SR2 64-bit/32-bit, Win7 Pro 64-bit, running in VMware Fusion 5.0.4

I some questions about the Differentiate Gadget. I looked in the docs but didn't see the answer and wasn't able to 100% determine the answers myself.

Setup:

In the Differentiate Gadget dialog, specify 1st order derivative and S-G smoothing. Then in the flyout menu, you check "Show 2nd Derivative".

Questions:

1) Does the gadget use the smoothed 1st-order derivative data to calculate the 2nd-order derivative data?
2) Is the 2nd-order derivative data smoothed itself?


Also (without regard to smoothing), is there any true difference in outcome between:

1) Setting 1st order derivative in the dialog and "Show 2nd Derivative" in the flyout.
and
2) Setting 2nd order derivative in the dialog and "Show 1st Derivative" in the flyout.
2   L A T E S T    R E P L I E S    (Newest First)
cdrozdowski111 Posted - 05/26/2014 : 3:07:05 PM
Thanks for taking the time to dig that code out.

You answered my questions quite well!
Castiel Posted - 05/26/2014 : 1:10:18 PM
quote:
Originally posted by cdrozdowski111

OriginPro 9.1 SR2 64-bit/32-bit, Win7 Pro 64-bit, running in VMware Fusion 5.0.4

I some questions about the Differentiate Gadget. I looked in the docs but didn't see the answer and wasn't able to 100% determine the answers myself.

Setup:

In the Differentiate Gadget dialog, specify 1st order derivative and S-G smoothing. Then in the flyout menu, you check "Show 2nd Derivative".

Questions:

1) Does the gadget use the smoothed 1st-order derivative data to calculate the 2nd-order derivative data?
2) Is the 2nd-order derivative data smoothed itself?


Also (without regard to smoothing), is there any true difference in outcome between:

1) Setting 1st order derivative in the dialog and "Show 2nd Derivative" in the flyout.
and
2) Setting 2nd order derivative in the dialog and "Show 1st Derivative" in the flyout.



Just checked the XFC file quickly....

For the first two:

m_vDerivY = m_vY;
m_v1stDerivY = m_v2ndDerivY = m_vY;
//..
ocmath_savitsky_golay_derivative(m_vX, m_vY, m_vDerivY, m_vX.GetSize(), nPts/2, -1, nPolyOrder, nOrder);
ocmath_savitsky_golay_derivative(m_vX, m_vY, m_v1stDerivY, m_vX.GetSize(), nPts/2, -1, nPolyOrder, 1);
ocmath_savitsky_golay_derivative(m_vX, m_vY, m_v2ndDerivY, m_vX.GetSize(), nPts/2, -1, nPolyOrder, 2);

Well, few documentation on this function, except:
OCMATH_API int ocmath_savitsky_golay_derivative(double *px, double *py, double *pSmooth, UINT nSize, int nLeftpts, int nRightpts = -1, UINT nPolydeg = 2, UINT nDervOrder = 1, bool bSmoothPeakPoint = false);



For the latter two:

m_vDerivY = m_vY;
//...
for ( int iOrder = 1; iOrder <= nOrder; iOrder++ )
{
    if ( OE_NOERROR != ocmath_derivative(m_vX, m_vDerivY, m_vX.GetSize()) )
    {
        return error_report("Differentiate fail.");
    }
    if ( 1 == iOrder )
        m_v1stDerivY = m_vDerivY;
    else if ( 2 == iOrder )
        m_v2ndDerivY = m_vDerivY;
}
if ( nOrder < 2 )
{
    m_v2ndDerivY = m_v1stDerivY;
    if ( OE_NOERROR != ocmath_derivative(m_vX, m_v2ndDerivY, m_vX.GetSize()) )
    {
        return error_report("Differentiate fail.");
    }
}

later on, m_v1stDerivY and m_v2ndDerivY are used in updatePreviewGraphs(), being stored in workbook "wDerivative". In a word, no difference.

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000