# Solve large linear systems with ParametricNDSolve?

**URL:** <https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948>\
**Category:** Questions\
**Tags:** control-systems, equation-solving, numerical-computation\
**Created:** [July 24, 2016, 5:22pm UTC](https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948 "2016-07-24T17:22:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/jerico/32/18224_2.png) [@jerico](https://community.wolfram.com/u/jerico)\
**Post date:** [July 24, 2016, 5:22pm UTC](https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948/1 "2016-07-24T17:22:07Z")

</div>

Dear Community Members,

I have trying to obtained parameterised solutions of linear systems of considerable large dimensions. For example the one I have attached to this post.  
I have tried (naively) with Solve but the processes does not seem to end. Then I tried ParametricNDSolve having only on parameter (script d); it seems that the process terminates well but when trying to plot solutions for specific values of “script d” say 0.5, none numerical value will be obtained.

I wonder what am I doing wrong.  
Is it because parameter script d appears nonlinearly?  
Is it because of the dimensions of the system?  
Does any of you have tried to solve symbolically systems of similar dimensions with DSolve?

Parametric solutions of this kind of systems could be efficiently used in Model Predictive Control

Any suggestion/comment will be appreciated!

Jesus Rico-Melgoza

---

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [July 24, 2016, 6:50pm UTC](https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948/2 "2016-07-24T18:50:50Z")

</div>

Hi Jesus,

In your note book you try to plot with

```
Plot[iL[0.5][t] /. solPar, {t, 0, 0.0001}, PlotRange -> All]

```

But really iL[t] is the returned parametric function, so you should plot

```
Plot[iL[t][0.5] /. solPar, {t, 0, 0.0001}, PlotRange -> All]

```

Best regards,

David

---

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [July 24, 2016, 7:03pm UTC](https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948/3 "2016-07-24T19:03:03Z")

</div>

Also, you might find ParametricNDSolveValue useful:

```
solPar2 = 
  ParametricNDSolveValue[Flatten@{Eqns1, init1}, 
   vars, {t, 0, 0.0001}, {\[ScriptD]}];

Plot[solPar2[.5] // Evaluate, {t, 0, .0001}, PlotRange -> All, 
 PlotLegends -> vars]

```

 ![LargeSys-1.png](https://global.discourse-cdn.com/wolfram/original/3X/0/a/0ae845ffa2cdba70e57c8728cb3d2f3f8ab55636.png)

---

<div class="post-metadata">

**Author:** ![jerico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/jerico/32/18224_2.png) [@jerico](https://community.wolfram.com/u/jerico)\
**Post date:** [July 25, 2016, 1:06am UTC](https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948/4 "2016-07-25T01:06:40Z")

</div>

Thank you David

Silly mistake I had!

I am quite impressed to see that in this parametric solutions the specified parameters seems to be almost open. I mean, is there any way to see if parametric solutions are restricted to intervals of the parameters?

Regards  
Jesus

---

<div class="post-metadata">

**Author:** ![jerico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/jerico/32/18224_2.png) [@jerico](https://community.wolfram.com/u/jerico)\
**Post date:** [July 26, 2016, 2:31am UTC](https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948/5 "2016-07-26T02:31:09Z")

</div>

David

I have found ParametricNDSolve and ParametricNDSolveValue very useful that I want to ask which is the theory behind functions like these. Do you happen to know this? The Mathematica Details and Options are rather plain. I like to know more about it to give some theoretical support to my applications.

Jesus

---

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [July 26, 2016, 10:27pm UTC](https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948/6 "2016-07-26T22:27:48Z")

</div>

Hello, Jesus.

I don’t know how the parametric feature works. And I also find it puzzling. I find it strange that we are not required to provide a range for the parameters. When we don’t, I wonder what the implied range is, since it seems unreasonable to expect a parameter in such cases to be valid over the extent of R or C. I do see that we can provide a range in the form a {p, pmin, pmax}. That may be a safer alternative than just p.

It would be good for someone from Wolfram to comment! Maybe we can wake up the Moderators.

Kind regards,  
David

---

<div class="post-metadata">

**Author:** ![jerico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/jerico/32/18224_2.png) [@jerico](https://community.wolfram.com/u/jerico)\
**Post date:** [July 27, 2016, 12:41am UTC](https://community.wolfram.com/t/solve-large-linear-systems-with-parametricndsolve/8948/7 "2016-07-27T00:41:03Z")

</div>

David

Thanks for your reply.  
I can only speculate about it. However I would appreciate the help of the Wolfram experts to better understand ParametricNDSolve and ParametricNDSolveValue; They really are pretty useful.

Thanks in advance.

Jesus
