Solutions for FCUP's Numerical Analysis Assignments

This commit is contained in:
Diogo Cordeiro
2019-08-28 16:44:59 +01:00
commit b7b704b68b
108 changed files with 35323 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,40 @@
/* cyrillic-ext */
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 400;
src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-cSZMZ-Y.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 400;
src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-eCZMZ-Y.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 400;
src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-cyZMZ-Y.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 400;
src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-ciZMZ-Y.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 400;
src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-fCZM.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

View File

@@ -0,0 +1,32 @@
/* cyrillic */
@font-face {
font-family: 'Oswald';
font-style: normal;
font-weight: 400;
src: local('Oswald Regular'), local('Oswald-Regular'), url(https://fonts.gstatic.com/s/oswald/v16/TK3iWkUHHAIjg752HT8Ghe4.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'Oswald';
font-style: normal;
font-weight: 400;
src: local('Oswald Regular'), local('Oswald-Regular'), url(https://fonts.gstatic.com/s/oswald/v16/TK3iWkUHHAIjg752Fj8Ghe4.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Oswald';
font-style: normal;
font-weight: 400;
src: local('Oswald Regular'), local('Oswald-Regular'), url(https://fonts.gstatic.com/s/oswald/v16/TK3iWkUHHAIjg752Fz8Ghe4.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Oswald';
font-style: normal;
font-weight: 400;
src: local('Oswald Regular'), local('Oswald-Regular'), url(https://fonts.gstatic.com/s/oswald/v16/TK3iWkUHHAIjg752GT8G.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

View File

@@ -0,0 +1,48 @@
/* cyrillic-ext */
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 400;
src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(https://fonts.gstatic.com/s/ubuntumono/v8/KFOjCneDtsqEr0keqCMhbCc3CsTKlA.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 400;
src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(https://fonts.gstatic.com/s/ubuntumono/v8/KFOjCneDtsqEr0keqCMhbCc-CsTKlA.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 400;
src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(https://fonts.gstatic.com/s/ubuntumono/v8/KFOjCneDtsqEr0keqCMhbCc2CsTKlA.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 400;
src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(https://fonts.gstatic.com/s/ubuntumono/v8/KFOjCneDtsqEr0keqCMhbCc5CsTKlA.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* latin-ext */
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 400;
src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(https://fonts.gstatic.com/s/ubuntumono/v8/KFOjCneDtsqEr0keqCMhbCc0CsTKlA.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 400;
src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(https://fonts.gstatic.com/s/ubuntumono/v8/KFOjCneDtsqEr0keqCMhbCc6CsQ.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

View File

@@ -0,0 +1,224 @@
/* latin-ext */
@font-face {
font-family: 'Quattrocento';
font-style: normal;
font-weight: 400;
src: local('Quattrocento'), url(https://fonts.gstatic.com/s/quattrocento/v10/OZpEg_xvsDZQL_LKIF7q4jP3zWj6T4g.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Quattrocento';
font-style: normal;
font-weight: 400;
src: local('Quattrocento'), url(https://fonts.gstatic.com/s/quattrocento/v10/OZpEg_xvsDZQL_LKIF7q4jP3w2j6.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Quattrocento';
font-style: normal;
font-weight: 700;
src: local('Quattrocento Bold'), local('Quattrocento-Bold'), url(https://fonts.gstatic.com/s/quattrocento/v10/OZpbg_xvsDZQL_LKIF7q4jP_eE3vfqnYgXc.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Quattrocento';
font-style: normal;
font-weight: 700;
src: local('Quattrocento Bold'), local('Quattrocento-Bold'), url(https://fonts.gstatic.com/s/quattrocento/v10/OZpbg_xvsDZQL_LKIF7q4jP_eE3vcKnY.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Quattrocento Sans';
font-style: italic;
font-weight: 400;
src: local('Quattrocento Sans Italic'), local('QuattrocentoSans-Italic'), url(https://fonts.gstatic.com/s/quattrocentosans/v11/va9a4lja2NVIDdIAAoMR5MfuElaRB0zMh0P2GEHJ.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Quattrocento Sans';
font-style: italic;
font-weight: 400;
src: local('Quattrocento Sans Italic'), local('QuattrocentoSans-Italic'), url(https://fonts.gstatic.com/s/quattrocentosans/v11/va9a4lja2NVIDdIAAoMR5MfuElaRB0zMh032GA.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Quattrocento Sans';
font-style: italic;
font-weight: 700;
src: local('Quattrocento Sans Bold Italic'), local('QuattrocentoSans-BoldItalic'), url(https://fonts.gstatic.com/s/quattrocentosans/v11/va9X4lja2NVIDdIAAoMR5MfuElaRB0zMj_bTDXDojYsJ.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Quattrocento Sans';
font-style: italic;
font-weight: 700;
src: local('Quattrocento Sans Bold Italic'), local('QuattrocentoSans-BoldItalic'), url(https://fonts.gstatic.com/s/quattrocentosans/v11/va9X4lja2NVIDdIAAoMR5MfuElaRB0zMj_bTDX7ojQ.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Quattrocento Sans';
font-style: normal;
font-weight: 400;
src: local('Quattrocento Sans'), local('QuattrocentoSans'), url(https://fonts.gstatic.com/s/quattrocentosans/v11/va9c4lja2NVIDdIAAoMR5MfuElaRB0zHt0_uHA.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Quattrocento Sans';
font-style: normal;
font-weight: 400;
src: local('Quattrocento Sans'), local('QuattrocentoSans'), url(https://fonts.gstatic.com/s/quattrocentosans/v11/va9c4lja2NVIDdIAAoMR5MfuElaRB0zJt08.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Quattrocento Sans';
font-style: normal;
font-weight: 700;
src: local('Quattrocento Sans Bold'), local('QuattrocentoSans-Bold'), url(https://fonts.gstatic.com/s/quattrocentosans/v11/va9Z4lja2NVIDdIAAoMR5MfuElaRB0RyklrfPXzwiQ.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Quattrocento Sans';
font-style: normal;
font-weight: 700;
src: local('Quattrocento Sans Bold'), local('QuattrocentoSans-Bold'), url(https://fonts.gstatic.com/s/quattrocentosans/v11/va9Z4lja2NVIDdIAAoMR5MfuElaRB0RyklrRPXw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
font-family: 'Spectral';
font-style: italic;
font-weight: 400;
src: local('Spectral Italic'), local('Spectral-Italic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCt-xNNww_2s0amA9M8on7mTMuk.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'Spectral';
font-style: italic;
font-weight: 400;
src: local('Spectral Italic'), local('Spectral-Italic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCt-xNNww_2s0amA9M8onXmTMuk.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Spectral';
font-style: italic;
font-weight: 400;
src: local('Spectral Italic'), local('Spectral-Italic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCt-xNNww_2s0amA9M8onTmTMuk.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Spectral';
font-style: italic;
font-weight: 400;
src: local('Spectral Italic'), local('Spectral-Italic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCt-xNNww_2s0amA9M8onrmTA.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
font-family: 'Spectral';
font-style: italic;
font-weight: 700;
src: local('Spectral Bold Italic'), local('Spectral-BoldItalic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCu-xNNww_2s0amA9M8qsHDWfCFXUIJ.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'Spectral';
font-style: italic;
font-weight: 700;
src: local('Spectral Bold Italic'), local('Spectral-BoldItalic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCu-xNNww_2s0amA9M8qsHDWfuFXUIJ.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Spectral';
font-style: italic;
font-weight: 700;
src: local('Spectral Bold Italic'), local('Spectral-BoldItalic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCu-xNNww_2s0amA9M8qsHDWfqFXUIJ.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Spectral';
font-style: italic;
font-weight: 700;
src: local('Spectral Bold Italic'), local('Spectral-BoldItalic'), url(https://fonts.gstatic.com/s/spectral/v5/rnCu-xNNww_2s0amA9M8qsHDWfSFXQ.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
font-family: 'Spectral';
font-style: normal;
font-weight: 400;
src: local('Spectral Regular'), local('Spectral-Regular'), url(https://fonts.gstatic.com/s/spectral/v5/rnCr-xNNww_2s0amA9M9knj-SA.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'Spectral';
font-style: normal;
font-weight: 400;
src: local('Spectral Regular'), local('Spectral-Regular'), url(https://fonts.gstatic.com/s/spectral/v5/rnCr-xNNww_2s0amA9M2knj-SA.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Spectral';
font-style: normal;
font-weight: 400;
src: local('Spectral Regular'), local('Spectral-Regular'), url(https://fonts.gstatic.com/s/spectral/v5/rnCr-xNNww_2s0amA9M3knj-SA.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Spectral';
font-style: normal;
font-weight: 400;
src: local('Spectral Regular'), local('Spectral-Regular'), url(https://fonts.gstatic.com/s/spectral/v5/rnCr-xNNww_2s0amA9M5kng.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
font-family: 'Spectral';
font-style: normal;
font-weight: 700;
src: local('Spectral Bold'), local('Spectral-Bold'), url(https://fonts.gstatic.com/s/spectral/v5/rnCs-xNNww_2s0amA9uCt23FafadWQ.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
font-family: 'Spectral';
font-style: normal;
font-weight: 700;
src: local('Spectral Bold'), local('Spectral-Bold'), url(https://fonts.gstatic.com/s/spectral/v5/rnCs-xNNww_2s0amA9uCt23OafadWQ.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Spectral';
font-style: normal;
font-weight: 700;
src: local('Spectral Bold'), local('Spectral-Bold'), url(https://fonts.gstatic.com/s/spectral/v5/rnCs-xNNww_2s0amA9uCt23PafadWQ.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Spectral';
font-style: normal;
font-weight: 700;
src: local('Spectral Bold'), local('Spectral-Bold'), url(https://fonts.gstatic.com/s/spectral/v5/rnCs-xNNww_2s0amA9uCt23BafY.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html>
<head>
<meta name="robots" content="noindex">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Numerical Analysis - Slides</title>
<link rel="stylesheet" href="css/all.css">
<link href="css/css.css" rel="stylesheet">
<link href="css/css2.css" rel="stylesheet">
<link href="css/css3.css" rel="stylesheet">
<link href="css/css4.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/katex.min.css">
<link rel="icon" href="https://hackersatporto.com/images/favicon.png">
<meta name="description" content="Porto's student computing society. We are a community focused on learning about and building things with technology.">
<script src="js/remark-latest.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/mark.min.js"></script>
<script src="js/MathJax.js"></script>
<script src="js/katex.min.js"></script>
<script src="js/auto-render.min.js"></script>
<script src="js/abcjs_basic_5.6.3-min.js"></script>
<script src="js/story.js"></script>
</head>
<body id="content" class="ma0 bg-white section-slides page-kind-page is-page-true feature-math feature-qrcode feature-nohighlight feature-music">
<script>
var hljs = remark.highlighter.engine;
var slideshow = remark.create({
ratio: "16:9",
countIncrementalSlides: false,
sourceUrl: 'text.md',
slideNumberFormat: '%current%',
highlightLanguage: "xaprb",
placeholder: "dummy value to end the list without a comma"
});
$(".remark-slide-content.fit-h1 h1").each(function(i, e) {
var $e = $(e);
var $p = $e.closest('div.remark-slide-container');
var needsToggle = !$p.hasClass('remark-visible');
if ( needsToggle ) $p.toggleClass('remark-visible');
while (e.scrollHeight > e.clientHeight + 1 && $e.css('font-size') != '1px') {
$e.css('font-size', (parseInt($e.css('font-size')) - 1) + "px");
}
if ( needsToggle ) $p.toggleClass('remark-visible');
});
$( function() {
if ( $( "body.feature-qrcode:not(.feature-noqrcode)" ).length ) {
if ( $( ".qrcode" ).length ) {
new QRCode($(".qrcode")[0], {
"useSVG": true,
"text": window.location.href.replace(/#\d*$/, "")
});
}
}
});
// Setup MathJax
MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
}
});
MathJax.Hub.Configured();
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,146 @@
// Render KaTeX math typesetting, but only if the <body> has the class
// feature-math
$( function() {
if ( $( "body.feature-math:not(.feature-nomath)" ).length ) {
renderMathInElement(document.body);
}
});
// Render abcjs sheet music, but only if the <body> has the class
// feature-music. Do this by removing the <pre><code class="language-abc">
// and replacing it with a <p id="music-X"> which will be used to hold the
// generated sheet music. Remark's code syntax highlighting transforms the
// <code> block into a bunch of
// <div class="remark-code-line">K: Emin</div>
// one per line, so we have to reassemble those to get back linebreaks.
$( function() {
if ( $( "body.feature-music:not(.feature-nomusic)" ).length ) {
$( "code.language-abc, code.abc" ).each(function(i, e){
var $this = $(this);
var abc = $this.text();
if ( $this.hasClass("remark-code") ) {
abc = "";
$this.children().each(function(i, e) {
abc += "\n" + $(this).text();
});
abc = abc.trim();
}
var p = $this.parent().before('<p id="music-' + (i+1) + '">');
$this.parent().hide();
ABCJS.renderAbc("music-" + (i+1), abc, {
paddingtop: 0,
paddingbottom: 0,
paddingright: 0,
paddingleft: 0,
responsive: "resize"
});
});
}
});
// Render tweet-styled blockquotes, if <body> has the class feature-tweetquote and the blockquote ends
// with a twitter permalink URL.
$( function() {
if ( $( "body.feature-tweetquote:not(.feature-notweetquote)" ).length ) {
$("blockquote p:first-child a[href*='twitter.com']").each(function(i, e){
$(this.parentElement.parentElement).addClass("tweet sans-serif mw6");
$(this).addClass("no-underline b");
$(this).prepend('<i class="fl mr2 fab fa-twitter fa-2x pa2 ba br3">');
var m = $(this).attr('href').match(/twitter.com\/([^\/]*)\//);
if (m.length > 1) {
$(this).append('<br><span class="normal gray">@' + m[1] + '</span>');
}
});
}
});
// Render perspective book images, if <body> has the class
// feature-3dbook-covers
$( function() {
$( "body.feature-3dbook-covers article a" ).has( "img[src~='3dbook']" ).each(function(i, e) {
$( this ).addClass("book");
$( this ).parent().addClass("books");
});
});
// Highlight code listings, if <body> has the class
// feature-highlight
$( function() {
if ( $( "body.feature-highlight:not(.feature-nohighlight)" ).length ) {
hljs.initHighlightingOnLoad();
}
});
/* Turn images into figures with captions. Several scenarios are handled, in
* order:
* If the img is followed by an <em>, then transform the <em> into a caption.
* If the img has a title, use that as the caption.
* If the img has an alt, use that.
* The following features have to be enabled:
* - feature-figcaption has to be enabled or the whole thing is disabled
* - feature-figcaption-hidden makes the captions invisible till you hover
* - feature-fignum adds figure numbering
* - feature-figlink adds automatic links of text like "Figure 4"
*/
$( function() {
$("body.feature-figcaption:not(.feature-nofigcaption) article img").each(function(i, e) {
var $this = $(this);
// Don't put captions on images that have URL fragment pseudo-classes.
if ( $this.attr('src').match(/#/) ) return;
var $txt = false;
if ( $this.next().is("em") ) {
$txt = $this.next().html();
$this.next().remove();
} else {
$txt = $this.attr('title') ? $this.attr('title')
: $this.attr('alt') ? $this.attr('alt')
: false;
}
if ( $txt ) {
var $fig = $this.wrap('<figure id="fig-' + (i+1) + '">')
.after('<figcaption class="f5 lh-copy i ph3">' + $txt + '</figcaption>')
.parent();
}
});
if ( $("body.feature-figlink").length ) {
$("article p, article li").each(function(i, e) {
var $old = $(this).html();
var $new = $old.replace(/Figure\s+(\d+)/g, '<a href="#fig-$1">Figure $1</a>');
if ( $old !== $new ) {
$(this).html($new);
}
});
}
});
/* Add captions to tables.
* If the table is followed by a <p><em>, then transform the <em> into a caption.
* The following features have to be enabled:
* - feature-tablecaption has to be enabled or the whole thing is disabled
* - feature-fignum adds table numbering
* - feature-figlink adds automatic links of text like "Table 4"
*/
$( function() {
$("body.feature-tablecaption article table").each(function(i, e) {
var $this = $(this);
var $txt = false;
if ( $this.next().is("p") ) {
if ( $this.next().children().first().is("em:only-child") ) {
$txt = $this.next().children().first().html();
$this.next().remove();
}
}
if ( $txt ) {
$this.prepend('<caption id="tbl-' + (i+1) + '">' + $txt + '</caption>');
}
});
if ( $("body.feature-figlink").length ) {
$("article p, article li").each(function(i, e) {
var $old = $(this).html();
var $new = $old.replace(/Table\s+(\d+)/g, '<a href="#tbl-$1">Table $1</a>');
if ( $old !== $new ) {
$(this).html($new);
}
});
}
});

View File

@@ -0,0 +1,232 @@
class: title, smokescreen, shelf, no-footer
# Análise Numérica - Trabalho Prático 4
### Diogo Cordeiro, Hugo Sales, Pedro Costa, Ricardo Pimenta
---
class: roomy
# Motivação
Pretende-se compreender o funcionamento conceptual bem como os desafios da implementação de dois métodos numéricos: `Regra de Simpson` e `Regra dos Trapézios.`
---
class: img-right
.center[![Quarta derivada da função enunciada](imgs/majorante_erro_1.png)]
# 1
Através da análise do gráfico, verificamos que o majorante, em valor absoluto, da 4ª derivada
da função é menor que 12, este valor é usado para majorar a formula do erro para o calculo de n.
---
class: compact
# Simpson
Função que implementa o método de Simpson
double simpson (Function f, double a, double b, int n)
{
// Intervalo de passo
double h = (b - a)/n;
// Valor de f nos pontos de indice par
double evens = summation(f, 2, n - 2, 2, h, a);
// Valor de f nos pontos de indice impar
double odds = summation(f, 1, n - 1, 2, h, a);
// Aplicação da método de Simpson
value = (h/3)*(f(a) + f(b) + 2 * evens + 4 * odds);
}
---
class: compact
# Summation
Função para calcular o sumatório de F entre os pontos de indice `init` e stop saltando `step` pontos, usando `h` como intervalo de passo
double summation (Function f, int init, int stop, int step, double h, double a)
{
// Acumulador
double total = 0;
for (int i = init; i <= stop; i += step) {
// Adicionamos o valor de f correspondente ao x de indice i
total += f(a + i * h);
}
return total;
}
---
class: compact
# calculateN
Função para calcular o número de pontos necessários para o calculo do integral com erro menor que error
int calculateN (double A, double B, double error) {
int n = ceil( (B - A) / pow((15.0 * error) / 2.0, 1.0 / 4) );
return n + (n % 2);
}
---
class: compact
# main
void main ()
{
Function f(x) = sin(sin(sin(sin(x))));
// com 7 casas decimais correctas
print(simpson(f, 0, 2, calculateN(0, 2, pow(10, -7))));
// com 12 casas decimais correctas
print(simpson(f, 0, 2, calculateN(0, 2, pow(10, -12))));
}
---
class: roomy
<style>
table td {
background: inherit;
border-radius: .5em;
color: #000;
}
</style>
#### Output
Erro | Resultado
---------------|-------------------
$$ 10^{-7} $$ | 1.0548418906594816
$$ 10^{-12} $$ | 1.0548418772492483
---
class: compact
### 2)
// Valor exacto do integral calculado com o WolframAlpha, arredondado
// com 15 algarismos significativos, um a mais do que o erro majorado
// máximo para o caso de 2^20 pontos.
double I = 1.05484187724912;
/* Função para calcular o integral recorrendo ao método do Trapézio */
double trapezio (Function f, double a, double b) {
// Acumulador
double summation = 0;
// Intervalo de passo com n inicial = 2
double h = (b - a)/2;
// Valor constante
double fa_fb = f(a) + f(b);
---
class: compact
### 2)
// Para cada expoente de 1 a 20 (com passo 1)
for (int k = 1; k <= 20; ++k) {
// Guarda sumatorio dos pontos anteriores
double partial_sum = 0;
// Número de intervalos
// Com o left shift fazemos a potência de 2^k
int n = 1 << k;
// Evitamos recalcular pontos da função previamente computados
// guardando o sumatório destes em partial_sum e adicionamos a cada
// iteração os pontos novos, sendo estes de indice impar
for (int i = 1; i < n; i += 2) {
// Adicionamos o valor de f correspondente ao x de indice i
partial_sum += f(a + i * h);
}
summation += partial_sum;
---
class: compact
### 2)
// Aplicação da formula do Trapézio
double value = (h/2)*fa_fb + h * summation;
print(k + "\t| " + value + "\t| " + (I - value));
// Dividimos o intervalo por 2
h /= 2;
}
}
void main () {
Function f(x) = sin(sin(sin(sin(x))));
print(trapezio(f, 0, 2);
}
---
class: compact
<style>
table td {
background: inherit;
border-radius: .5em;
color: #000;
}
</style>
#### Output
k | $$ I_{n_{k}} $$ | $$ \mid I - I_{n_{k}} \mid $$
----|---------------------|--------------------------
1 | 0.9533749638740736 | $$ 1.1 \cdot 10^{-1} $$
2 | 1.0308378382617962 | $$ 2.5 \cdot 10^{-2} $$
3 | 1.0489039934457873 | $$ 6.0 \cdot 10^{-3} $$
4 | 1.053360809734676 | $$ 1.5 \cdot 10^{-3} $$
5 | 1.0544718169560368 | $$ 3.8 \cdot 10^{-4} $$
6 | 1.054749374997165 | $$ 9.3 \cdot 10^{-5} $$
7 | 1.0548187524860693 | $$ 2.4 \cdot 10^{-5} $$
---
class: compact
<style>
table td {
background: inherit;
border-radius: .5em;
color: #000;
}
</style>
#### Output
k | $$ I_{n_{k}} $$ | $$ \mid I - I_{n_{k}} \mid $$
----|---------------------|--------------------------
8 | 1.0548360961083287 | $$ 5.8 \cdot 10^{-6} $$
9 | 1.054840431967042 | $$ 1.5 \cdot 10^{-6} $$
10 | 1.0548415159287925 | $$ 3.6 \cdot 10^{-7} $$
11 | 1.0548417869190467 | $$ 9.1 \cdot 10^{-8} $$
12 | 1.0548418546666 | $$ 2.3 \cdot 10^{-8} $$
13 | 1.054841871603487 | $$ 5.7 \cdot 10^{-9} $$
14 | 1.0548418758377078 | $$ 1.5 \cdot 10^{-9} $$
---
class: compact
<style>
table td {
background: inherit;
border-radius: .5em;
color: #000;
}
</style>
#### Output
k | $$ I_{n_{k}} $$ | $$ \mid I - I_{n_{k}} \mid $$
----|---------------------|--------------------------
15 | 1.0548418768962615 | $$ 3.5 \cdot 10^{-10} $$
16 | 1.0548418771608998 | $$ 8.9 \cdot 10^{-11} $$
17 | 1.0548418772270582 | $$ 2.3 \cdot 10^{-11} $$
18 | 1.0548418772436017 | $$ 5.6 \cdot 10^{-12} $$
19 | 1.0548418772477444 | $$ 1.4 \cdot 10^{-12} $$
20 | 1.0548418772487873 | $$ 3.3 \cdot 10^{-13} $$