# dsolve very slow for system of 2 second order ODEs

조회 수: 15(최근 30일)
e_frog 2020년 11월 2일
답변: Priysha LNU 2021년 1월 4일
Hi,
I have to solve a system of 2 second order ODEs with 4 initial conditions. They are also coupled (state variables: and ). The solution must absolutely be analytic, because there are 3 unknown variables in the equation which are later (after the computation with dsolve) to be defined in a linear system of equations made out of 3 boundary conditions.
To solve the system of ODEs i use dsolve in its simple form:
[sol1(x),sol2(x)] = dsolve([ODE1 ODE2],initial_conditions)
The problem is, that dsolve just does not compute an analytical solution in a reasonable time frame. I aborted the computation after 12 hours with no solution. I dont even know if the results would be plausible, because the calculations have always taken far too long.
After simplifying my ODEs (just deleting the half of each equation), I found out, that dsolve is capable of solving coupled ODEs the way I intend it to do, so my method is working. It just takes far too long for the actual (and realistic) ODEs to produce solutions.
Is there any to decrease the computational time to at most 1-2 hours? Is there any other way to analytically solve a system of ODEs (maybe with another function than dsolve)?
##### 댓글 수: 3표시숨기기 이전 댓글 수: 2
Bjorn Gustavsson 2020년 11월 5일
Your question is too vague. What's your ODEs? Are they too complicated for dsolve to handle? Do they in principal have analytical solutions?

댓글을 달려면 로그인하십시오.

### 채택된 답변

Priysha LNU 2021년 1월 4일
Hi,
One way to speed-up the execution is to add a limit on the maximum degree of radicals. The following shows you an example,
S = dsolve(..,'MaxDegree',2);
This will force dsolve to assume implicit formulas for polynomials of degree greater than the specified value.
If the exact solution for the input set of ordinary differential equations is relatively complex, then this might be another reason the DSOLVE function takes long time.
Hope this helps!
Thanks!
DISCLAIMER: These are my own views and in no way depict those of MathWorks.

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!