Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
cantaro86
GitHub Repository: cantaro86/Financial-Models-Numerical-Methods
Path: blob/master/src/C/BS_SOR_main.c
1700 views
1
#include <stdio.h>
2
#include <string.h>
3
#include <stdlib.h>
4
#include "SOR.h"
5
#include "PDE_solver.h"
6
#include <math.h>
7
8
9
10
11
int main()
12
{
13
14
double r = 0.1;
15
double sig = 0.2;
16
double S = 100.0;
17
double K = 100.0;
18
double T = 1.;
19
20
int Nspace = 3000; // space steps
21
int Ntime = 2000; // time steps
22
23
double w = 1.68; // relaxation parameter
24
25
printf("The price is: %f \n ", PDE_SOR(Nspace,Ntime,S,K,T,sig,r,w) );
26
27
return 0;
28
}
29
30
31
32