Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
6e8b5ad9
Commit
6e8b5ad9
authored
Mar 01, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed GCC incompatiblity.
parent
66f10d33
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
modsim/ass2/q3.c
modsim/ass2/q3.c
+7
-4
modsim/ass2/q5.c
modsim/ass2/q5.c
+4
-4
modsim/ass2/report.tex
modsim/ass2/report.tex
+5
-3
No files found.
modsim/ass2/q3.c
View file @
6e8b5ad9
...
...
@@ -16,16 +16,19 @@ double df(double x) {
}
int
main
(
void
)
{
unsigned
int
steps
;
unsigned
int
steps
=
0
;
double
tmp
=
bisec
(
&
f
,
1
,
2
,
EPSILON
,
&
steps
);
printf
(
"Square root of 2 using bisection method: %.20f (%d steps)
\n
"
,
bisec
(
&
f
,
1
,
2
,
EPSILON
,
&
steps
)
,
steps
);
tmp
,
steps
);
tmp
=
newton_raphson
(
&
f
,
&
df
,
1
.
4
,
EPSILON
,
&
steps
,
100000
);
printf
(
"Square root of 2 using Newton-Raphson method: %.20f (%d steps)
\n
"
,
newton_raphson
(
&
f
,
&
df
,
1
.
4
,
EPSILON
,
&
steps
,
100000
)
,
steps
);
tmp
,
steps
);
tmp
=
regula_falsi
(
&
f
,
1
,
2
,
EPSILON
,
&
steps
,
100000
);
printf
(
"Square root of 2 using the Regula Falsi method: %.20f (%d steps)
\n
"
,
regula_falsi
(
&
f
,
1
,
2
,
EPSILON
,
&
steps
,
100000
)
,
steps
);
tmp
,
steps
);
return
0
;
}
modsim/ass2/q5.c
View file @
6e8b5ad9
...
...
@@ -28,17 +28,17 @@ double f2(double x) {
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
2
)
{
printf
(
"Usage: %s STEPS"
,
argv
[
0
]);
printf
(
"Usage: %s STEPS
\n
"
,
argv
[
0
]);
return
-
1
;
}
PRINT_INTEGRALS
(
f1
,
0
,
1
,
(
M_E
-
1
)
/
M_E
);
puts
(
""
);
PRINT_INTEGRALS
(
f2
,
0
,
2
,
1
-
3
/
pow
(
M_E
,
2
));
PRINT_INTEGRALS
(
f2
,
0
,
2
,
1
-
3
/
pow
(
M_E
,
2
));
puts
(
""
);
PRINT_INTEGRALS
(
f2
,
0
,
20
,
1
-
21
/
pow
(
M_E
,
20
));
PRINT_INTEGRALS
(
f2
,
0
,
20
,
1
-
21
/
pow
(
M_E
,
20
));
puts
(
""
);
PRINT_INTEGRALS
(
f2
,
0
,
200
,
1
-
201
/
pow
(
M_E
,
200
));
PRINT_INTEGRALS
(
f2
,
0
,
200
,
1
-
201
/
pow
(
M_E
,
200
));
puts
(
""
);
PRINT_INTEGRALS
(
sin
,
0
,
8
*
M_PI
,
0
.
0
);
...
...
modsim/ass2/report.tex
View file @
6e8b5ad9
\documentclass
[10pt,a4paper]
{
article
}
\usepackage
{
float,url,graphicx,booktabs
}
\documentclass
[10pt,a4paper]
{
article
}
% {{{
\usepackage
{
float,url,graphicx,booktabs
}
\usepackage
[dutch]
{
babel
}
% }}}
\title
{
Modelleren, Simuleren
\&
Contin
\"
ue Wiskunde
\\
Assignment 2: Differentiation, roots and Integration
}
\author
{
Tadde
\"
us Kroes (6054129)
\and
Sander van Veen (6167969)
}
...
...
@@ -96,7 +98,6 @@ beoogde nauwkeurigheid.
% }}}
\section
{
Newton-Raphson
}
% {{{
\label
{
sec:Newton-Raphson
}
...
...
@@ -203,3 +204,4 @@ t/m 10 jaar).}
% }}}
\end{document}
% vim: foldmethod=marker:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment