how to speed up calculation
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (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
댓글 수: 0
John D'Errico
2011년 4월 5일
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!