MBS Symbolic Toolbox Alternative

조회 수: 4 (최근 30일)
Tiago Carvalho
Tiago Carvalho 2022년 6월 13일
댓글: Steven Lord 2022년 6월 13일
Good Afternoon,
I am currently developing my Master Thesis project, which consists of developing a general-porpused multi-body simulation program. Currently, I have a good basis for the program that is able to solve the simulations that I ask of it.
However, I have been using the symbolic Toolbox to allow the user to define input functions that define the position,velocity and acceleration of the driving links. The functions are usual polynomial or sinusoidal and are defined in an excel, that serves as a GUI, as the following: '@(t) 6,28*t^2 (for example), and this is costing me a lot of computation effort, when I introduce a driving input the simulations are taking hours and using the profile I have identified that the definition of the variable sym t for my input functions is the one that consumes me the most computation time.
Does anyone has an alternative for the symbolic toolbox that is more effienct? I have already maxed out the efficiency in terms of numerical methods algorithms and there isn't much more I can do on that department.
Thank you for your attention.
Tiago Carvalho

채택된 답변

Steven Lord
Steven Lord 2022년 6월 13일
What operations do you need to do on these functions? If all you need to do is define and evaluate them, just define them as anonymous functions.
s = '@(x) x.^2+2*x-1';
f = str2func(s);
x = 1:10;
y1 = f(1:10)
y1 = 1×10
2 7 14 23 34 47 62 79 98 119
y2 = x.^2+2*x-1 % Check that the output of f matches the explicit computations
y2 = 1×10
2 7 14 23 34 47 62 79 98 119
  댓글 수: 2
Tiago Carvalho
Tiago Carvalho 2022년 6월 13일
Hello,
If the inputs are only defined as acceleration I can use anonymous functions and I think that can help! However, for a specific set of problems I will have to differentiate them and then evaluate them, I will try to simplify the Excel GUI and to force the user to input the first and second derivative of each function before the program runs which will allow me to do what you suggested.
Thank you a lot for your help!
Tiago
Steven Lord
Steven Lord 2022년 6월 13일
If the functions are "nice" approximating the derivative using numerical differentiation techniques may be sufficient for your needs.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by