curl --request POST \
--url https://api.fincept.in/quantlib/numerical/ode/solve \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"system": "harmonic",
"t_span": [
0,
10
],
"y0": [
1,
0
],
"method": "rk45",
"h": 0.01,
"params": [
1
]
}
'import requests
url = "https://api.fincept.in/quantlib/numerical/ode/solve"
payload = {
"system": "harmonic",
"t_span": [0, 10],
"y0": [1, 0],
"method": "rk45",
"h": 0.01,
"params": [1]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
system: 'harmonic',
t_span: [0, 10],
y0: [1, 0],
method: 'rk45',
h: 0.01,
params: [1]
})
};
fetch('https://api.fincept.in/quantlib/numerical/ode/solve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fincept.in/quantlib/numerical/ode/solve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'system' => 'harmonic',
't_span' => [
0,
10
],
'y0' => [
1,
0
],
'method' => 'rk45',
'h' => 0.01,
'params' => [
1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fincept.in/quantlib/numerical/ode/solve"
payload := strings.NewReader("{\n \"system\": \"harmonic\",\n \"t_span\": [\n 0,\n 10\n ],\n \"y0\": [\n 1,\n 0\n ],\n \"method\": \"rk45\",\n \"h\": 0.01,\n \"params\": [\n 1\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fincept.in/quantlib/numerical/ode/solve")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"system\": \"harmonic\",\n \"t_span\": [\n 0,\n 10\n ],\n \"y0\": [\n 1,\n 0\n ],\n \"method\": \"rk45\",\n \"h\": 0.01,\n \"params\": [\n 1\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/numerical/ode/solve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"system\": \"harmonic\",\n \"t_span\": [\n 0,\n 10\n ],\n \"y0\": [\n 1,\n 0\n ],\n \"method\": \"rk45\",\n \"h\": 0.01,\n \"params\": [\n 1\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"system": "harmonic",
"method": "rk45",
"t": [
0,
0.1,
0.2,
0.3
],
"y": [
[
1,
0
],
[
0.995,
-0.0998
],
[
0.98,
-0.199
],
[
0.955,
-0.296
]
],
"n_steps": 100
}
}{
"detail": "Invalid API key"
}{
"detail": "Endpoint requires Basic tier or higher"
}Solve Ordinary Differential Equation (ODE)
Solve an initial value problem (IVP) for a system of ordinary differential equations: dy/dt = f(t, y) with y(t0) = y0. Supports built-in systems: exponential_decay (population decay, radioactive decay), harmonic (spring oscillations), lotka_volterra (predator-prey dynamics), and van_der_pol (nonlinear oscillator). Methods: euler (simple, first-order), rk4 (Runge-Kutta 4th order, classic), rk45 (adaptive Runge-Kutta with error control). Essential for modeling dynamics, term structure models, and time-dependent processes. [Tier: BASIC, Credits: 1]
curl --request POST \
--url https://api.fincept.in/quantlib/numerical/ode/solve \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"system": "harmonic",
"t_span": [
0,
10
],
"y0": [
1,
0
],
"method": "rk45",
"h": 0.01,
"params": [
1
]
}
'import requests
url = "https://api.fincept.in/quantlib/numerical/ode/solve"
payload = {
"system": "harmonic",
"t_span": [0, 10],
"y0": [1, 0],
"method": "rk45",
"h": 0.01,
"params": [1]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
system: 'harmonic',
t_span: [0, 10],
y0: [1, 0],
method: 'rk45',
h: 0.01,
params: [1]
})
};
fetch('https://api.fincept.in/quantlib/numerical/ode/solve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fincept.in/quantlib/numerical/ode/solve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'system' => 'harmonic',
't_span' => [
0,
10
],
'y0' => [
1,
0
],
'method' => 'rk45',
'h' => 0.01,
'params' => [
1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fincept.in/quantlib/numerical/ode/solve"
payload := strings.NewReader("{\n \"system\": \"harmonic\",\n \"t_span\": [\n 0,\n 10\n ],\n \"y0\": [\n 1,\n 0\n ],\n \"method\": \"rk45\",\n \"h\": 0.01,\n \"params\": [\n 1\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fincept.in/quantlib/numerical/ode/solve")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"system\": \"harmonic\",\n \"t_span\": [\n 0,\n 10\n ],\n \"y0\": [\n 1,\n 0\n ],\n \"method\": \"rk45\",\n \"h\": 0.01,\n \"params\": [\n 1\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/numerical/ode/solve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"system\": \"harmonic\",\n \"t_span\": [\n 0,\n 10\n ],\n \"y0\": [\n 1,\n 0\n ],\n \"method\": \"rk45\",\n \"h\": 0.01,\n \"params\": [\n 1\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"system": "harmonic",
"method": "rk45",
"t": [
0,
0.1,
0.2,
0.3
],
"y": [
[
1,
0
],
[
0.995,
-0.0998
],
[
0.98,
-0.199
],
[
0.955,
-0.296
]
],
"n_steps": 100
}
}{
"detail": "Invalid API key"
}{
"detail": "Endpoint requires Basic tier or higher"
}Authorizations
API key for authentication. Get your key at https://api.fincept.in/auth/register
Body
ODE system to solve
exponential_decay, harmonic, lotka_volterra, van_der_pol "harmonic"
Time span [t0, tf] for integration
2 elements[0, 10]
Initial conditions y(t0) - number of elements depends on system (1 for exponential_decay, 2 for harmonic/van_der_pol/lotka_volterra)
[1, 0]
Integration method
euler, rk4, rk45 "rk45"
Step size (for euler and rk4 methods)
0.01
System-specific parameters: exponential_decay[k], harmonic[omega], lotka_volterra[a,b,c,d], van_der_pol[mu]
[1]
