Skip to content

Commit

Permalink
Update examples.jl (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
mforets authored Jan 18, 2021
1 parent f05ac99 commit 5a4f6ba
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions examples/examples.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
using TaylorModels

include("TaylorModels.jl")
using TaylorModels, IntervalArithmetic
t = TaylorModel1(3, interval(0), -0.5..0.5)

@show texp = exp(t)

t1 = make_Taylor_model(exp, 3, 0, -0.5..0.5)
t2 = make_Taylor_model(sin, 3, 0, -0.5..0.5)
@show tsin = sin(t)

t1 + t2
t1 * t2
s = texp + tsin
p = texp * tsin

t = taylor_var(3, 0, -0.5..0.5)
compute_bound(t)
@show TaylorModels.bound_taylor1(t)
@show TaylorModels.bound_taylor1(p)
@show TaylorModels.bound_taylor1(s)

t = t1 + t2
compute_bound(t)
#= Output
texp = exp(t) = [1, 1] + [1, 1] t + [0.5, 0.5] t² + [0.166666, 0.166667] t³ + [-0, 0.00288794]
tsin = sin(t) = [1, 1] t + [-0.166667, -0.166666] t³ + [-0.00124851, 0.00124851]
TaylorModels.bound_taylor1(t) = [-0.5, 0.5]
TaylorModels.bound_taylor1(p) = [-0.291667, 0.791667]
TaylorModels.bound_taylor1(s) = [0.124999, 2.12501]
[0.124999, 2.12501]
=#

0 comments on commit 5a4f6ba

Please sign in to comment.