Demandes associées au chapitre-notebook: "Systèmes différentiels "

Pour accéder au code relatif à un exemple, double-cliquer sur le triangle du crochet icônique à droite.

Exemple 1

DSolve[{2 x'[t]==6 Exp[t],3 y'[t]==-3 y[t],2 z'[t]+x[t]==9},{x[t], y[t], z[t]},t]

{x[t], y[t], z[t]} /. %

x[t] /. %%

% /. t -> 3

{x[t], y[t], z[t]} = 
Flatten [
		{x[t], y[t], z[t]}/.DSolve[{2 x'[t]==6 Exp[t],3 y'[t]==-3 y[t],2 z'[t]+x[t]==9},{x[t], y[t], z[t]},t]]

Clear [x,  y ,  z ]

x [t]

DSolve[{2 x'[t]==6 Exp[t],3 y'[t]==-3 y[t],2 z'[t]+x[t]==9},{x, y, z},t]

Plot[x[t] /. % /. C[1] -> -2, {t, 0, 2}];

%% /. {C[1] -> -2, C[3] -> 5, C[2] -> ((-1)/3)}

{x, y, z} /. %

{x ,  y,  z} = Flatten[%]

ParametricPlot3D[{x[t], y[t], z[t]}, {t, 0, 3/2}];

{2 x'[t]==6 Exp[t],3 y'[t]==-3 y[t],2 z'[t]+x[t]==9}

Clear [x,  y,  z]

Exemple 2

DSolve[{2 x'[t]==6 Exp[t],3 y'[t]==-3 y[t],2 z'[t]+ x [t]==9, x[0] == 0,y[1] == 1,z[2] == 2},{x, y, z},t]

{x, y, z} /. Flatten[%]

{x, y, z}  =  %

g1 = 
      Plot[x [t],  {t, 0, 3}, DisplayFunction -> Identity, 
        PlotLabel -> "x(t)"];

g2 = 
      Plot[y [t], {t, 0, 3}, DisplayFunction -> Identity, 
        PlotLabel -> "y(t)"];

g3 = 
      Plot[z [t], {t, 0, 3}, DisplayFunction -> Identity, 
        PlotLabel -> "z(t)"];

Show[GraphicsArray[{g1, g2, g3}], 
      DisplayFunction -> $DisplayFunction];

Clear [x,  y,  z]

Exemple 3

DSolve[{2 x'[t]+z'[t]+2 y[t]+z[t]==6 Cos[t] - 2 Sin[t],3 y'[t]+2 x[t]-2 y[t]+3 z[t]==-3 Cos[t] + 7 Sin[t],x'[t]+2 z'[t]+x[t]+3 y[t]-z[t]==9 Cos[t] - 5 Sin[t]},{x, y, z},t]

{x[t], y[t], z[t]} /. %

Expand  [%]

(1/3) (E^(-t)) C[1] + (2/3) (E^t) C[1] + (1/3) (E^(-t)) C[2] - 
      (2/3) (E^t) C[2] + (1/3) (E^(2 t)) C[2] + (1/3) (E^(-t)) C[3] - 
      (1/3) (E^(2 t)) C[3] + Cos[t] + Sin[t]

Factor [
      (1/3) (E^(-t)) C[1] + (1/3) (E^(-t)) C[2] + (1/3) (E^(-t)) C[3] ]

Factor [(2/3) (E^t) C[1] - (2/3) (E^t) C[2]]

Factor [(1/3) (E^(2 t)) C[2] - (1/3) (E^(2 t)) C[3]]

Factor [
      (1/3) (E^(-t)) C[1] + (1/3) (E^(-t)) C[2] + (1/3) (E^(-t)) C[3]]

Factor [-(1/3) (E^t) C[1] + (1/3) (E^t) C[2]]

Factor [(1/3) (E^(2 t)) C[2] - (1/3) (E^(2 t)) C[3]]

\(Factor\ [	
      1\/3\ E\^\(-t\)\ C[1] + \ 1\/3\ E\^\(-t\)\ C[2] + 1\/3\ E\^\(-t\)\ C[3]]
      \)

Factor [-(1/3) (E^t) C[1] + (1/3) (E^t) C[2]]

Factor [-(2/3) (E^(2 t)) C[2] + (2/3) (E^(2 t)) C[3]]

Exemple 4

x(0) = α - 2 β + γ + 1;

y(0) = α + β + γ + 1;

z(0) = -2 α + β + γ;

x[0] = α - 2 β + γ + 1;

y[0] = α + β + γ + 1;

z[0] = -2 α + β + γ;

règlesAllerPremierMembre
       = {(dx/dt) -> -x[0] + p X[p], 
        (dy/dt) -> -y[0] + p Y[p], 
        (dz/dt) -> -z[0] + p Z[p], x -> X[p], y -> Y[p], 
        z -> Z[p]};

règlesAllerSecondMembre
       = {sin t -> (1/(1 + (p^2))), cos t -> (p/(1 + (p^2)))};

((2 dx)/dt) + (dz/dt) + 2 y + z /. règlesAllerPremierMembre

equation1 = %;

((3 dy)/dt) + 2 x - 2 y + 3 z /. règlesAllerPremierMembre

equation2 = %;

(dx/dt) + ((2 dz)/dt) + x + 3 y - z /. 
      règlesAllerPremierMembre

Simplify [%]

equation3 = %;

secondMembre1 = 
      6 cos t - 2 sin t /. règlesAllerSecondMembre

secondMembre2 = 
      -3 cos t + 7 sin t /. règlesAllerSecondMembre

secondMembre3 = 
      9 cos t - 5 sin t /. règlesAllerSecondMembre

DSolve[{equation1 == secondMembre1, equation2 == secondMembre2, 
        equation3 == secondMembre3}, {X[p], Y[p], Z[p]},  p]

Simplify[%]

solutions = %;

Simplify [X[p] /. solutions]

Apart[%]

Apart [
      (2 - p - 2 (p^2) + (p^3) - α + p α - (p^2) α + 
            (p^3) α + 4 β - 2 p β + 4 (p^2) β - 
            2 (p^3) β)/
        ((-2 + p) (-1 + p) (1 + (p^2)))]

Apart[
      ((-2 - p + (p^2) + α + (p^2) α)/((-2 + p) 
          (1 + (p^2))))]

Apart[Y[p] /. solutions]

Apart[
      (-2 + 5 p - 4 (p^2) + (p^3) - α + p α - 
            (p^2) α + (p^3) α - 2 β + p β - 
            2 (p^2) β + (p^3) β)/
        ((-2 + p) (-1 + p) (1 + (p^2)))]

Apart[
      ((2 - 3 p + (p^2) + α + (p^2) α)/((-2 + p) 
          (1 + (p^2))))]

Apart[Z[p] /. solutions]

Apart[
      (4 - 6 p + 2 (p^2) + 2 α - 2 p α + 
            2 (p^2) α - 2 (p^3) α - 2 β + p β - 
            2 (p^2) β + (p^3) β)/
        ((-2 + p) (-1 + p) (1 + (p^2)))]

Apart[
      -((2 (2 - p + α + (p^2) α))/((-2 + p)
                 (1 + (p^2))))]

\(\(règlesRetour
       = {b_\/\(a_ + p\) -> b\ Exp[\(-a\)\ t], 
        1\/\(1 + p\^2\) -> Sin[t], p\/\(1 + p\^2\) -> Cos[t]}; 
    \)\)

{(α/(p - 2)) - ((2 β)/(p - 1)) + 
          (γ/(p + 1)) + Expand[((p + 1)/((p^2) + 1))]} /. 
      règlesRetour

{
              α/(p - 2) + β/(p - 1) + 
                γ/(p + 1) - Expand[(1 - p)/(p^2 + 1)]}/.règlesRetour

{-(2 α)/(-2 + p) + 
          β/(-1 + p) + γ/(1 + p) + 2/(1 + p^2)}
         /. règlesRetour

{x[t], y[t], z[t]} = 
      Flatten[{{
            (1/3) (E^(-t)) 
              (C[1] + 2 (E^(2 t)) C[1] + C[2] - 2 (E^(2 t)) C[2] + 
                  (E^(3 t)) C[2] + C[3] - (E^(3 t)) C[3] + 
                  3 (E^t) Cos[t] + 3 (E^t) Sin[t]), 
            (1/3) (E^(-t)) 
              (C[1] - (E^(2 t)) C[1] + C[2] + (E^(2 t)) C[2] + 
                  (E^(3 t)) C[2] + C[3] - (E^(3 t)) C[3] + 
                  3 (E^t) Cos[t] - 3 (E^t) Sin[t]), 
            (1/3) (E^(-t)) 
              (C[1] - (E^(2 t)) C[1] + C[2] + (E^(2 t)) C[2] - 
                  2 (E^(3 t)) C[2] + C[3] + 2 (E^(3 t)) C[3] + 
                  6 (E^t) Sin[t])}}];

Solve[{x[t] == α - 2 β + γ + 1 /. t -> 0, 
        y[t] == α + β + γ + 1 /. t -> 0, 
        z[t] == -2 α + β + γ /. t -> 0}, {
        α, β, γ}]

règlesDesConstantes = %;

{(E^(2 t)) α - 2 (E^t) β + (E^(-t)) γ + 
          Cos[t] + Sin[t]} /. règlesDesConstantes

{β (E^t) + α (E^(2 t)) + (γ/(E^t)) + Cos[t] - 
          Sin[t]} /. règlesDesConstantes

{β (E^t) - 2 α (E^(2 t)) + (γ/(E^t)) + 2 Sin[t]}
         /. règlesDesConstantes

Clear[courbesSolution, g1, g2, g3, x, y, z, 
      règlesAllerPremierMembre, 
      règlesAllerSecondMembre equation1, equation2, equation3, 
      secondMembre1, secondMembre2, secondMembre3, solutions, 
      règlesRetour, règlesDesConstantes]

NDSolve[{x'[t]==x[t] (1 - x[t]/10 - y[t]/5),
		y'[t]==y[t] (1 - x[t]/7 - y[t]/7),
		x[0] == 4,y[0] == 6},
	{x, y},{t, 0, 10}]

Sol = %

Plot[Evaluate [x[t] /.Sol], {t, 0, 10}];

Plot[Evaluate [y[t] /.Sol], {t, 0, 10}];