derivatives of state variables
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear,
I want to find the derivative of this
α*x_1+b*x_2+q*abs(x_2)*x_2+r*x_3. Where x_1,x_2,x_3 are state variables from aircraft
How can I do in Matlab?
댓글 수: 0
답변 (1개)
Ameer Hamza
2020년 4월 26일
Use symbolic toolbox. First define the equation
syms alpha b q r x_1 x_2 x_3
eq = alpha*x_1 + b*x_2 + q*abs(x_2)*x_2 + r*x_3;
and take derivative w.r.t to different variables
>> diff(eq, x_1) % derivative w.r.t x_1
ans =
alpha
>> diff(eq, x_2) % derivative w.r.t x_2
ans =
b + q*abs(x_2) + q*x_2*sign(x_2)
>> diff(eq, x_3) % derivative w.r.t x_3
ans =
r
댓글 수: 4
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!