I am using Jupyter Notebook. And I have a grid interploation function. Which gives me the value of a variable based upon the data of other two. But the problem is when I try to run reachability analysis, it starts throwing an error.
MethodError: MethodError: no method matching isless(::Float64, ::TaylorModel1{TaylorN{Float64}, Float64})
But when I tried to put the constant terms into the function It did not run and gave an error that the function is not defined.
``
using Interpolations
function interpol(x,y)
local TSR = [3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10] # Add your TSR values here
local B = -30:1:30 # This creates a range, convert it to an array if needed
#Define the Cp values (this is the lookup table)
#The rows correspond to TSR values and the columns to B values
local Cp = […] #15x61 matrix. You may take any rand values
convert Cp to a matrix (make sure it has correct dimensions)
Cp = reshape(Cp, length(TSR), length(B))
#Create an interpolation object
itp = interpolate((x, y), Cp, Gridded(Linear()))
return itp
end
using ReachabilityAnalysis
@taylorize function mymodel!(du, u, p, t)
local j,R,wr,V=3410432,35,2.582,12
b,w,bd = u
du[1] = bd - b
du[2] = (0.5* 3.14* R^3* V^2* 1.225* interpol(wR/V,b)-615139)/j
du[3] = 21.43(0.5* 3.14* R^3* V^2* 1.225* interpol(wR/V,b)-615139)/j+5.87(w-wr)
return du
end
X0 = Hyperrectangle(; low=[2,2.58,2], high=[2,2.58,2])
prob = @ivp(x’ = mymodel!(x), dim:3, x(0) ∈ X0);
alg = TMJets(; abstol=1e-20, orderT=10, orderQ=2, maxsteps=500_000)
sol = solve(prob; T=200.0, alg=alg)
solz = overapproximate(sol, Zonotope);
``