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

Fix plot recipe for FODESystemSolution #45

Merged
merged 1 commit into from
Jul 17, 2022
Merged

Fix plot recipe for FODESystemSolution #45

merged 1 commit into from
Jul 17, 2022

Conversation

ErikQQY
Copy link
Member

@ErikQQY ErikQQY commented Jul 16, 2022

I investigated the plot recipe today, and make our own recipe for FODESystemSolutoin, I think it's working very well, let's take fractional order Chua system as an example here:

using FractionalDiffEq, Plots
function chua!(du, x, p, t)
    a, b, c, m0, m1 = p
    du[1] = a*(x[2]-x[1]-(m1*x[1]+0.5*(m0-m1)*(abs(x[1]+1)-abs(x[1]-1))))
    du[2] = x[1]-x[2]+x[3]
    du[3] = -b*x[2]-c*x[3]
end
α = [0.93, 0.99, 0.92]
x0 = [0.2; -0.1; 0.1]
h = 0.001; tspan = (0, 50)
p = [10.725, 10.593, 0.268, -1.1726, -0.7872]
prob = FODESystem(chua!, α, x0, tspan, p)
sol = solve(prob, h, NonLinearAlg())

p=plot(sol);
p01=plot(sol, vars=(0, 1));
p02=plot(sol, vars=(0, 2));
p012=plot(sol, vars=(0, 1, 2));
p12=plot(sol, vars=(1, 2));
p23=plot(sol, vars=(2, 3));
p13=plot(sol, vars=(1, 3));
p123=plot(sol, vars=(1, 2, 3));
plot(p, p01, p02, p012, p12, p23, p13, p123, layout=8)

newchua

@jClugstor Please review this when you are available😉

Signed-off-by: ErikQQY <2283984853@qq.com>
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2022

Codecov Report

Merging #45 (456b24a) into master (1665ae7) will decrease coverage by 0.57%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #45      +/-   ##
==========================================
- Coverage   74.76%   74.18%   -0.58%     
==========================================
  Files          48       48              
  Lines        3634     3665      +31     
==========================================
+ Hits         2717     2719       +2     
- Misses        917      946      +29     
Impacted Files Coverage Δ
src/utils.jl 57.52% <ø> (-19.86%) ⬇️
src/fodesystem/NonLinear.jl 83.01% <100.00%> (+0.32%) ⬆️
src/singletermfode/PECE.jl 88.88% <100.00%> (+0.17%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@ErikQQY
Copy link
Member Author

ErikQQY commented Jul 16, 2022

If the plot recipe for FODESystemSolution is OK, we can use the similar recipe for FDDESystemSolution, FractionalDifferenceSolution and FFODESystemSolution, then all the plot issues are fixed🎉

@ErikQQY ErikQQY linked an issue Jul 16, 2022 that may be closed by this pull request
@ErikQQY
Copy link
Member Author

ErikQQY commented Jul 17, 2022

I think this PR plot recipe is ready to get merged. Coming PRs for FDDESystemSolution 🚀🚀

@ErikQQY ErikQQY merged commit 347ab75 into master Jul 17, 2022
@ErikQQY ErikQQY deleted the varsplot branch July 17, 2022 13:14
@jClugstor
Copy link
Contributor

Sorry, I've been moving the last couple of days. The plot recipe looks awesome!

@ErikQQY
Copy link
Member Author

ErikQQY commented Jul 18, 2022

Hahaha, that’s OK, take care.😉 Next we will add more details for our recipes, axis labels, legends, or whatever comes to mind!

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

Successfully merging this pull request may close these issues.

Solution objects for FODESystem, etc. ?
3 participants