# ParametricNDSolveValue malfunctioning with complex numbers

**URL:** <https://community.wolfram.com/t/parametricndsolvevalue-malfunctioning-with-complex-numbers/6054>\
**Category:** Questions\
**Tags:** mathematica, calculus, numerical-computation\
**Created:** [June 29, 2015, 10:09am UTC](https://community.wolfram.com/t/parametricndsolvevalue-malfunctioning-with-complex-numbers/6054 "2015-06-29T10:09:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![florianleupold](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@florianleupold](https://community.wolfram.com/u/florianleupold)\
**Post date:** [June 29, 2015, 10:09am UTC](https://community.wolfram.com/t/parametricndsolvevalue-malfunctioning-with-complex-numbers/6054/1 "2015-06-29T10:09:21Z")

</div>

`ParametricNDSolveValue` seems to have a problem with a certain combination of matrices and complex numbers. Here is a minimal example (also attached):

```
R[t_] = Through[#[t]] & /@ Table[Subscript[r, i, j], {i, 2}, {j, 2}];
ParametricNDSolveValue[{R'[t] == I R[t], R[0] == DiagonalMatrix[{0, n}]}, Subscript[r, 2, 2], {t, 0, 10}, {n}][1][1]
ParametricNDSolveValue[{R'[t] == I R[t], R[0] == DiagonalMatrix[{0, 1}]}, Subscript[r, 2, 2], {t, 0, 10}, {n}][1][1]
ParametricNDSolveValue[{R'[t] == R[t], R[0] == DiagonalMatrix[{0, n}]}, Subscript[r, 2, 2], {t, 0, 10}, {n}][1][1]

```

The difference between the first and the second evaluation of `ParametricNDSolveValue` is only that the value of `n` is already inserted into the DE in the second case. So the results should be the same. But they are not.

I also noticed that removing the `I` (third evaluation) works when `n` is only assigned afterwards.

Does anybody understand this? Is this a bug? Most importantly, is there a way around it?

Thanks for any input!
