1
$\begingroup$

When I execute the code attached , it says

ReplaceAll::reps: {DSolve[{(x1^[Prime])[t]==x2[t],(x2^[Prime])[t]==0.49 -((Times[<<5>>]+Times[<<5>>]+Times[<<5>>]) Plus[<<2>>]^2)/(4 kappa sqrt Plus[<<3>>]^2),(y1^[Prime])[t]==y2[t],(y2^[Prime])[t]==(0.1 +Power[<<2>>] <<4>> Power[<<2>>]-Plus[<<2>>] Power[<<2>>])/(2 Gamma),x1[0]==0.24 kappa,x2[0]==0,y1[0]==0.2 kappa,y2[0]==0},{x1,x2,y1,y2},t]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.please see the code :

{X1, X2, Y1, Y2} = {x1, x2, y1, y2} /. DSolve[
     {x1'[t] == x2[t],
      x2'[
        t] == (1/
          2 - (x1[t] + (1 - b)*y1[t])^2/(4*(x1[t] - 
               b*y1[t] - (kappa - y1[t])^2/(4*kappa))*
             sqrt ((x1[t] - b*y1[t] - (kappa - y1[t])^2/(4*kappa))*
               kappa))*((1 - ((kappa - y1[t])/(2*kappa)))*
             sqrt (kappa/(x1[t] - 
                  b*y1[t] - (kappa - y1[t])^2/ (4*
                    kappa)))/(1 + (1 - ((kappa - y1[t])/(2*kappa)))^2*
                 kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*
                    kappa))) + (((kappa - y1[t])/(2*kappa))*
              sqrt (kappa/(x1[t] - 
                   b*y1[t] - (kappa - y1[t])^2/(4*
                    kappa)))/(1 + ((kappa - y1[t])/(2*kappa))^2*
                  kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*kappa)))) + 
            atan (sqrt (kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*
                    kappa)))/(1 - ((kappa - y1[t])/ (2*
                    kappa))*(1 - ((kappa - y1[t])/(2*kappa)))*
                   kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*kappa))))) - M*g),
      y1'[t] == y2[t],
      y2'[
        t] == (1/(2*Gamma)*(1/2 - 
           b - (x1[t] + (1 - b)*
                y1[t])^2*(-1/(2*(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*kappa))*
                  kappa)*(1/(1 + (1 - ((kappa - y1[t])/(2*kappa)))^2*
                    kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*kappa)))) - 
              1/(1 + ((kappa - y1[t])/(2*kappa))^2*
                  kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*
                    kappa)))) + (((kappa - y1[t])/(2*kappa)) - 
               b)/(2*(x1[t] - b*y1[t] - (kappa - y1[t])^2/(4*kappa)) ...*
               sqrt ((x1[t] - b*y1[t] - (kappa - y1[t])^2/(4*kappa))*
                 kappa))*((1 - ((kappa - y1[t])/(2*kappa)))*
               sqrt (kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/ (4*
                    kappa)))/(1 + (1 - ((kappa - y1[t])/(2*kappa)))^2*
                   kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*
                    kappa))) + (((kappa - y1[t])/(2*kappa))*
                sqrt (kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/ (4*
                    kappa)))/(1 + ((kappa - y1[t])/(2*kappa))^2*
                    kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*kappa)))) + 
              atan (sqrt (kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*
                    kappa)))/(1 - ((kappa - y1[t])/(2*
                    kappa))*(1 - ((kappa - y1[t])/(2*kappa)))*

                    kappa/(x1[t] - 
                    b*y1[t] - (kappa - y1[t])^2/(4*kappa))))))),
      x1[0] == kappa*b*(1 - b), x2[0] == 0, y1[0] == kappa*(1 - 2 b), 
      y2[0] == 0}, {x1, x2, y1, y2}, t] // FullSimplify // First

Manipulate[
 Plot[Evaluate[{X1[t], Y1[t]} /. {kappa -> a, b -> l, Gamma -> m, 
     M -> s, g -> c}], {t, 0, 10}, PlotRange -> {0, 1}, 
  PlotStyle -> Thick, Filling -> {1 -> {2}}], {{a, 1.3, "\[Kappa]"}, 
  1, 3, Appearance -> "Labeled"},
 {{l, 0.4, "b"}, 0, 1, Appearance -> "Labeled"}, 
 {{m, 0.4, "\[CapitalGamma]"}, 0, 1, Appearance -> "Labeled"},
 {{s, 0.4, "M"}, 0, 10, Appearance -> "Labeled"},
 {{c, 0.4, "g"}, 0, 10, Appearance -> "Labeled"}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.