<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic numerical integration in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/numerical-integration/m-p/1784979#M1209934</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I am getting to use numerical integration within the &lt;U&gt;trapezoidal rule&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;I already have the &lt;STRONG&gt;python function&lt;/STRONG&gt; and would like to converting it to a &lt;STRONG&gt;QlikView macro&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The python function:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;def trapz(f,a,b,N=20):&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;x=np.linspace(a,b,N+1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;y=f(x)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;y_r=y[1:]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;y_l=y[:-1]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dx=(b-a)/N&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;result=(dx/2)*np.sum(y_r+y_l)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;return result&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an example for input parameters: f(x)=exp(x)*x, a=0.1, b=0.8, N=20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2021 23:19:06 GMT</pubDate>
    <dc:creator>AmCh</dc:creator>
    <dc:date>2021-02-22T23:19:06Z</dc:date>
    <item>
      <title>numerical integration</title>
      <link>https://community.qlik.com/t5/QlikView/numerical-integration/m-p/1784979#M1209934</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I am getting to use numerical integration within the &lt;U&gt;trapezoidal rule&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;I already have the &lt;STRONG&gt;python function&lt;/STRONG&gt; and would like to converting it to a &lt;STRONG&gt;QlikView macro&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The python function:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;def trapz(f,a,b,N=20):&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;x=np.linspace(a,b,N+1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;y=f(x)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;y_r=y[1:]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;y_l=y[:-1]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dx=(b-a)/N&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;result=(dx/2)*np.sum(y_r+y_l)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;return result&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an example for input parameters: f(x)=exp(x)*x, a=0.1, b=0.8, N=20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 23:19:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/numerical-integration/m-p/1784979#M1209934</guid>
      <dc:creator>AmCh</dc:creator>
      <dc:date>2021-02-22T23:19:06Z</dc:date>
    </item>
  </channel>
</rss>

