1
$\begingroup$

enter image description hereI am looking to find oscillations for my work and I'm wondering if there is a specific technique to finding it? Currently I am moving the parameters to find some sort of oscillation, however I'm not finding consistent steady oscillation. If anyone is able to help point me in the correct direction that would help. Below is what I am working on in the answers area, my code works but I'm not sure what I should look to move specifically to find the stable oscillation. Thanks in advance.

sol=ParametricNDSolveValue[{x'[t] ==c1+ (g1*((y[t]^3)/(a+y[t]^3))*(b/(b+x[t]^3)))-k1*x[t],y'[t]==c2+(g2*(d/(d+x[t]^3)))-k2* y[t]  ,x[0] == y[0] ==0},{x, y},{t, 0,500},{g1,g2,a,b,c1,c2,k1,k2,d}] Manipulate[Plot[Evaluate[#[t]&/@sol[g1,g2,a,b,c1,c2,k1,k2,d]],{t,0,100},PlotLegends->{x,y}],{{g1,20},0,50},{{g2,20.1},0,50}, {{a,3},0,20},{{b,0.3},0,50},{{c1,0.21},0,5},{{c2,0.3},0,5},{{k1,1.46},0,5},{{k2,0.5},0,5},{{d,0.19},0,50}]

When you copy in the code, you just need to press enter in front of the word "Manipulate" to drop it down onto a separate line (as shown in the picture), and then it will run.

$\endgroup$
5
  • $\begingroup$ Note, you have a typo in your code, a space is missing: "k1x[t]" should read: "k1 x[t]" $\endgroup$ Nov 23, 2022 at 19:51
  • $\begingroup$ What code? Please include a working example. $\endgroup$
    – Michael E2
    Nov 23, 2022 at 20:43
  • $\begingroup$ I have attached an image to explain, sorry. $\endgroup$
    – Joe Daykin
    Nov 23, 2022 at 20:50
  • $\begingroup$ Please directly post the Mathematica code which can be copy and run,not the picture. $\endgroup$
    – cvgmt
    Nov 23, 2022 at 23:08
  • $\begingroup$ Thanks for letting me know, I have added the code. I'm new to using the program so wasn't too sure how to do it initially $\endgroup$
    – Joe Daykin
    Nov 24, 2022 at 10:00

1 Answer 1

3
$\begingroup$

Runnable Code!

sol = ParametricNDSolveValue[{x'[t] == 
    c1 + (g1*((y[t]^3)/(a + y[t]^3)) (b/(b + x[t]^3))) - k1*x[t], 
   y'[t] == c2 + (g2*(d/(d + x[t]^3))) - k2*y[t], 
   x[0] == y[0] == 0}, {x, y}, {t, 0, 500}, {g1, g2, a, b, c1, c2, k1,
    k2, d}] 

Manipulate[
 Plot[Evaluate[#[t] & /@ sol[g1, g2, a, b, c1, c2, k1, k2, d]], {t, 0,
    50}, PlotLegends -> {x, y}], {{g1, 20}, 0, 50}, {{g2, 20.1}, 0, 
  50}, {{a, 3}, 0, 20}, {{b, 0.3}, 0, 50}, {{c1, 0.21}, 0, 
  5}, {{c2, 0.3}, 0, 5}, {{k1, 1.46}, 0, 5}, {{k2, 0.5}, 0, 
  5}, {{d, 0.19}, 0, 50}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.