Question: How to get consistent output from dsolve for system of ode's?

 

Consider these two output, both for solving system of 2 first order different equations.

Why is the first result is put in a list, then each solution is in a set inside the list, while the second one is just a set of the two solutions?

My guess is that because the first system is non-linear.  Is this why?

This makes it little harder to parse the result later on, as it can change each time. 

Is there a way to get same output for the first example as in the second example?

Mapkle 2026.1

ode:=diff(x(t),t) = x(t)^2, diff(y(t),t) = exp(t);
sol:=dsolve([ode],[x(t),y(t)])

ode:=diff(x(t),t) = x(t), diff(y(t),t) = t;
sol:=dsolve([ode],[x(t),y(t)])

ps. the ode's are not even coupled in these example. So each can be solved on its own if needed.

And if there is one ode with multiple solutions, now dsolve returns expression sequence. No set, no list.

ode:=2*x*diff(y(x),x)*diff(diff(y(x),x),x) = -1+diff(y(x),x)^2; 
dsolve(ode,y(x));

This whole thing is a mess. 

There should be one consistent way to return solutions for all cases. 

Regadless if it is one ode with one solution, or one ode with mutliple solutions, or coupled systems of odes, linear or not and so on.

The output should be the same form in all cases. A list of lists or list of sets or whatever it is decided on.

But it should not change.

 

 

Please Wait...