필터 지우기
필터 지우기

Constraints other than nonnegativity on ode solver?

조회 수: 4 (최근 30일)
Iris
Iris 2014년 12월 13일
댓글: Iris 2014년 12월 15일
I'm using ode45 to solve the equations of motion of some robot arm. I know I can use the odeset option 'NonNegative' to tell the solver that certain states must be nonnegative, but what if I want certain states to be bounded by different numbers? So say, I have a state q: q = [q1 q2 q3] and I want q1 to be in between -pi/2 and pi/2 and I want q3 to be in between 0 and 1... Is there any way to do this?
Thanks in advance

답변 (1개)

Matt J
Matt J 2014년 12월 13일
편집: Matt J 2014년 12월 15일
You could try transforming the state variable like
q3=sin(y)/2+1/2
where y is the transformed state variable. The derivatives in the state equation also have to rewritten in terms of y
dq3/dt= (cos(y)/2)*dy/dt
but it looks like the cos(y)/2 part can be accounted for using a mass matrix.
  댓글 수: 5
Matt J
Matt J 2014년 12월 15일
편집: Matt J 2014년 12월 15일
Doesn't the floor exert a force on the arm? And don't your equations of motion account for that force together with any others? If so, why do you need to add separate constraints in the first place? Why don't the applied forces alone (and hence the equations of motion) enforce the constraints?
In any case, did you test the final state trajectory q3(y(t)) that my approach gives you? Does it not satisfy both the equations of motion and the constraints? If so, and yet you think there is a 2nd solution out there that you like better, it means that the solution is non-unique. In turn, that means you haven't provided enough equations to fully specify the solution.
Iris
Iris 2014년 12월 15일
Normally I would add constraints to my equations, but this is an assignment for which I have to use the port-Hamiltonian formalism and I have not included the constraints. But I was just going to try to build in constraints now myself. I'll let you know if it worked. Thanx for your input so far though!

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

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by