Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDDESystem with multiple lags #77

Open
finmod opened this issue May 14, 2023 · 4 comments
Open

FDDESystem with multiple lags #77

finmod opened this issue May 14, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@finmod
Copy link

finmod commented May 14, 2023

The delayChen is running fine whereas the delaySolow gives the following error:

#using FractionalDiffEq, Plots
#α=[0.94, 0.94, 0.94]; ϕ=[0.2, 0, 0.5]; τ=0.009; T=1.4; h=0.001
#function delaychen!(dy, y, ϕ, t)
#	a=35; b=3; c=27
#	dy[1] = a*(y[2]-ϕ[1])
#	dy[2] = (c-a)*ϕ[1]-y[1]*y[3]+c*y[2]
#	dy[3] = y[1]*y[2]-b*ϕ[3]
#end
#prob = FDDESystem(delaychen!, ϕ, α, τ, T)
#sol=solve(prob, h, DelayABM())

# Solow model with time delay FDDESystem
using FractionalDiffEq, Plots
q = [0.7, 0.7, 0.7]           # order 
ϕ = [4.0152, 0.1383, 1.7788]  # initial value of delayed variable
τ = [0., 2.0, 0.]             # delays
tspan = (0., 150)              # final time
h = 0.01                      # step length

function delaysolow!(dy, y, ϕ, t)
	α = 0.6; p = 0.06; w = 0.
	dy[1] = 0.05*(1.0 - ϕ[1]/8.)*ϕ[1]
	dy[2] = 0.4*y[3]*y[2]^(α)*y[1]^(1-α) - 0.2*ϕ[2]
	dy[3] = p*ϕ[3] + w*ϕ[1] + h*ϕ[2]
end
prob = FDDESystem(delaysolow!, ϕ, q, τ, tspan)

image

@finmod
Copy link
Author

finmod commented May 14, 2023

This example is from: https://www.mdpi.com/2504-3110/5/3/74

@ErikQQY
Copy link
Member

ErikQQY commented May 14, 2023

Hi there! Thanks for pointing this out!

I think this error is caused by the multiple delays. Currently, FractionalDiffEq.jl doesn't support solving FDDE system with multiple lags, it only supports FDDEProblem with multiple lags or FDDESystem with one lag.

Very sorry for the error, I will add this feature in the future.

@ErikQQY ErikQQY added the enhancement New feature or request label May 14, 2023
@ErikQQY ErikQQY changed the title T or tspan requires Int64 instead of Float FDDESystem with multiple lags May 14, 2023
@finmod
Copy link
Author

finmod commented May 14, 2023

Ok.

For this particular example, one delay would be good enough for the second variable y[2]. I was not quite sure how to frame this so I put three delays with two of them set to zero. Showing that FDDE works on this example with one delay would be perfect for now. In short, this example is multiple order system with one delay. Next will be multiple order with multiple delays.

@ErikQQY
Copy link
Member

ErikQQY commented May 15, 2023

Yeah, multiple order with multiple delays FDDE solving would greatly enrich FractionalDiffEq.jl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants