Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uva
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
uva
Commits
806d63aa
Commit
806d63aa
authored
14 years ago
by
Sander Mathijs van Veen
Browse files
Options
Downloads
Patches
Plain Diff
ModSim: Finished assignment 2.5
parent
9b3a2865
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modsim/ass2/q5.c
+1
-1
1 addition, 1 deletion
modsim/ass2/q5.c
modsim/ass2/report.tex
+15
-3
15 additions, 3 deletions
modsim/ass2/report.tex
with
16 additions
and
4 deletions
modsim/ass2/q5.c
+
1
−
1
View file @
806d63aa
...
...
@@ -28,7 +28,7 @@ double f2(double x) {
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
2
)
{
printf
(
"Usage: %s S
TEP
S
\n
"
,
argv
[
0
]);
printf
(
"Usage: %s S
LICE
S
\n
"
,
argv
[
0
]);
return
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
modsim/ass2/report.tex
+
15
−
3
View file @
806d63aa
...
...
@@ -130,7 +130,9 @@ aantal stappen is afgerond op een geheel getal.
\section
{
Newton-Raphson
}
% {{{
\label
{
sec:Newton-Raphson
}
% TODO: alleen voor snijlijnen en niet voor raaklijnen op de x-as (bisection,
% regula falsi). Starting values: plotten. En voeg output van q4 toe en
% vergelijk het aantal benodigde stappen.
% }}}
...
...
@@ -178,8 +180,10 @@ double f2(x):
double sin(x);
\end{verbatim}
\noindent
Dit heeft het volgende resultaat gegeven als we het programma met
1.000.000 steps uitvoeren:
\noindent
We hebben de exacte resultaten van de integralen berekend en die van
vergeleken met de benaderingen. Dit heeft het volgende resultaat gegeven toen we
het programma met 1.000.000 ``slices'' (het aantal stukjes waarin het interval
$
[
a, b
]
$
wordt verdeeld) hebben uitgevoerd:
\begin{table}
[H]
\begin{tabular}
{
llllrr
}
\toprule
...
...
@@ -213,6 +217,14 @@ sin & 0 & $8\pi$ & gauss & $-1.797258919631 \cdot 10^{-14}$ & $1.797258919
\end{tabular}
\end{table}
De benaderingsfuncties in de tabel hebben elk hetzelfde aantal slices gebruikt.
Toch zien we verschillen in de afwijking van de exacte resultaten. De simpson's
rule en two-point gauss integration hebben een kleinere afwijking dan de
rectangle rule en trapezoidal rule methoden. We zien slechts nihile verschillen
tussen simpson's rule en two-point gauss integration. Echter zijn er (mits goed
ge
\"
implementeerd) minder cycles nodig voor de gauss integration. Daarom heeft
deze methode de voorkeur.
\\
\\
We kunnen de integraal
$
\int
_
0
^
2
{
x
^{
-
0
.
5
}
dx
}$
als volgt exact berekenen:
$$
\int
_
0
^
2
{
x
^{
-
0
.
5
}
dx
}
=
\left
[
2
\sqrt
{
x
}
\right
]
_
0
^
2
=
2
\sqrt
{
2
}
$$
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment