how to speed up calculation
이전 댓글 표시
I have two pig matrices of size 18 x 18,D and C with so long symbolic elements. they are used as the coeffiecient of a differential equation of the form D(q)qdotdot+C(q,qdot)qdot+G(q)=tau; q is of size 18x1 variables the problem that i have is each time step of ode45 for solving this ODE takes more than one minutes (some elements of D and C sre so huge). can any body please give me a solution to reduce the time. the ode is actually useless with so much taking time thank you
답변 (2개)
Jarrod Rivituso
2011년 4월 5일
Have you tried another solver besides ode45? For instance, ode15s is helpful for stiff systems, and according to the documentation can be used "If ode45 is slow because the problem is stiff".
Check out the table in the documentation:
>> doc ode45
John D'Errico
2011년 4월 5일
0 개 추천
So, don't make them symbolic matrices! If you are simply substituting numbers into them anyway to drive an ODE solver, making them symbolic seems silly. And if you need them in symbolic form for other things, then create a non-symbolic form for the matrices.
카테고리
도움말 센터 및 File Exchange에서 Code Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!