# ParametricNDSolve not working with my system

**URL:** <https://community.wolfram.com/t/parametricndsolve-not-working-with-my-system/21856>\
**Category:** Questions\
**Tags:** calculus, equation-solving, numerical-computation\
**Created:** [April 7, 2023, 1:53pm UTC](https://community.wolfram.com/t/parametricndsolve-not-working-with-my-system/21856 "2023-04-07T13:53:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![s6emrosa](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@s6emrosa](https://community.wolfram.com/u/s6emrosa)\
**Post date:** [April 7, 2023, 1:53pm UTC](https://community.wolfram.com/t/parametricndsolve-not-working-with-my-system/21856/1 "2023-04-07T13:53:35Z")

</div>

Hi experts,  
I want to solve the Bloch equations numerically with one parameter. Thus I tried to use ParametricNDSolve, but this does not give me any result, even though there is no mistake. However, when I use NDSolve and just type in a value for the parameter, there is a solution. Therefor I suspect a mistake in my understanding of the ParametricNDSolve. My code looks like this:

```
\[Delta] = 0
\[Gamma] = 0.1
\[Omega] = 1
s = ParametricNDSolve[{Subscript[\[Rho], 22]'[
     t] == -\[Gamma]*
      Subscript[\[Rho], 22][
       t] - (I/2*\[Omega]*Subscript[\[Rho], 21][t] - 
       I/2*Conjugate[\[Omega]]*Subscript[\[Rho], 12][t]), 
   Subscript[\[Rho], 11]'[
     t] == \[Gamma]*
      Subscript[\[Rho], 22][
       t] + (I/2*\[Omega]*Subscript[\[Rho], 21][t] - 
       I/2*Conjugate[\[Omega]]*Subscript[\[Rho], 12][t]), 
   Subscript[\[Rho], 21]'[
     t] == -(I*\[Delta] + g)*Subscript[\[Rho], 21][t] - 
     I/2*\[Omega]*(Subscript[\[Rho], 22][t] - 
        Subscript[\[Rho], 11][t]), 
   Subscript[\[Rho], 21]'[t] == Conjugate[Subscript[\[Rho], 12]'[t]], 
   Subscript[\[Rho], 11][0] == 1, Subscript[\[Rho], 22][0] == 0, 
   Subscript[\[Rho], 12][0] == 0, 
   Subscript[\[Rho], 21][0] == 0}, {Subscript[\[Rho], 11][t], 
   Subscript[\[Rho], 12][t], Subscript[\[Rho], 21][t], 
   Subscript[\[Rho], 22][t]}, {t, 0, 100}, {g}]
Plot[Evaluate[
  Table[{Subscript[\[Rho], 22][g][t]} /. s, {g, 1, 2, 0.1}]], {t, 0, 
  100}, PlotRange -> All]

```

Does anyone see my mistake?  
Thanks,  
Emil

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [April 7, 2023, 3:50pm UTC](https://community.wolfram.com/t/parametricndsolve-not-working-with-my-system/21856/2 "2023-04-07T15:50:48Z")

</div>

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/0957746b-d12f-4a1d-b911-2026fc6a87e4)
