Hw8 #1, do I integrate by hand and then by MatLab? Where did we talk about integration?
Well integration by MatLab was done in HW1. You can check those solutions if you don't remember. To integrate by hand, just write out the three equations and then integrate them separately.
I see what you mean with Hw#1 but how does doing it by hand work?
Well write out the three equations explicitly for a start
\[\dot g = g * \xi \] g is the translation matrix, a 3x3 \[\xi\] is the body velocity, a 3x1 the product is a 3x1, in this case 3 numbers
I do not get 3 equations
I meant instead of matrix form write out the equations in regular form.
\[g = \left[\begin{matrix}g11 & g12 & g13\\g21 & g22 & g23 \\ g31 & g32 & g33\end{matrix}\right]\] \[\xi =\left(\begin{matrix}\xi1 \\ \xi2 \\ \xi3\end{matrix}\right)\] \[\dot x = g11*\xi1 +g12*\xi2 +g13*\xi3\] \[\dot y = g21*\xi1 + g22*\xi2 + g23*\xi3\] \[\dot \theta = g31*\xi1 + g32*\xi2 + g33*\xi3\] but I have numbers that reduce these equations down to single numbers
Ok just plug in the g11 etc symbolically and get rid of the factors that are 0
You only have numbers that reduce this down to a single numbers in the initial state.
yes, in the initial state.
So, I will always start with these 3 equations and the apply the initial conditions from the point after integration.
Yes just integrate the equations with respect to time and use the initial conditions to figure out constants.
\[\xi \] is the body velocity. I use this for my equations.
Yep
I integrate form 0 to tau
0 to pi with respect to tau
\[x = \pi \cos \theta +\pi \sin \theta + C\] This is what I get for x. C is my constant for initial conditions. I know mathematically how \[\pi \] is in front and \[\theta \] has not been evaluated. But, why is pi in front and why has theta not been evaluated?
Does it represent some unknown area under a graph?
I think you forgot the tau in your solution.
Oh I'm sorry you substituted it
Ok so you should be able to get C using the initial condition right?
\[C = -\pi \cos \theta - \pi \sin \theta \]
This means x = 0 always.
Oh I see what you did. You need to figure out C before you substitute that the final time is pi. so\[x = \tau*\cos(\theta)+\tau*\sin(\theta)+C\]
Now say x(0) = 0 and determine C
Is \[x(0), x(\tau) \]?
x(0) is x at tau = 0.
So what is in the ( ) is tau
Yes
I have class
Are you saying C = 0?
for x(0).
If C = 0 for x(0) C=0 all the time. C is just a constant
I get C = - tau.
for x
Ok so C is 0 then right?
for y I get \[C = \frac{ 0.5 }{ \sin \theta - \cos \theta } - \tau \]
Not correct. What is your equation for y(tau)
I did my indefinite integral incorrectly. My C should absorb any multiples tac on to it. I see that C = 0. I still have problems understanding why I wait to evaluate tau until I do.
So I get a Cx, Cy and Ctheta
Ok do you agree that ydot = sin(theta)-cos(theta)?
yes.
Then do you also agree that y = tau*sin(theta)-tau*cos(theta)+C?
yes
Ok to figure out C, we simply plug in known conditions. In the problem we are given that at tau=0, y = .5. Therefore C = .5.
To figure out y at t=pi, then you would plug in pi for tau.
So at tau=pi y = pi*sin(theta)-pi*cos(theta)+.5. You can figure out theta by integrating thetadot and plugging in pi for tau. I have to go now. I'll check your questions this evening.
do I do the same for x?
Yes of course. x,y,and theta. You have a speed in x, speed in y, and speed in theta. You want to figure out position in x, position in y, and position in theta after certain time.
Thanks.
later
I do not understand the part of #1 that askes if the output makes sense. What does a 'make sense' response look like?
For problem #1, is the MatLab section required or is it there for information reasons?
You are required to plotthe trajectory in MatLab for part 1 yes. As for yourfirst question...you are given an initial positions in x,y,theta and a speed in x,y,theta. Your final answer is your final position in x,y,theta. You should be able to guess what the final configuration will be given the initial and the speed. Compare your guess against the actual results. Also compare the two xis you were given and how they affected the final configuration.
How do we start Problem 2? Do we need to find \[\xi (\hat) \]? And then implement Rodrigues Formula?
I believe there was a formula discussed in class for the closed form solution of the exponential of xi. You can see it here for convenience: http://i.imgur.com/Mcq11.png
I am refreashing myself on the workings of ode45
The problem/solution from homework 1 should be helpful.
I get a line with a positive slope when I plot \[\dot x = \cos \theta + \sin \theta \]
I took the ode45 of \[\dot x = \cos (5\pi/12) + \sin (5\pi/12)\] and plotted it. That is where I got a straight line with a positive slope.
So, R(xi3*tau) = [cos(pi/4) -sin(pi/4); sin(pi/4) cos(pi/4] How do we obtain the Jacobian of {x1; x2} ?
*Jacobian of {xi1, xi2}?
Confused about problem #1 ploting
Will I have an integration m.file for xdot, ydot and thetadot? 3 intergration m.files.
My equations are \[\dot x = \cos \theta + \sin \theta \] \[\dot y = \sin \theta - \cos \theta \] \[\dot \theta = 1/4\] where does my tau come into play? How do I get the angle theta without solveing the 3 equations?
Ok can we make 2 threads here? billingsley you start another question on the left so I don't get confused. Bebo... I don't understand why you plugged in 5*pi/12 for tau in the differential equation. In this case it just evaluates to a constant and of course the integration will be linear.
That is where I thought theta went. My theta is 5pi/12.
Your final theta may be 5pi/12 but your theta is changing. Not constant.
Ok but how?
How is your theta changing?
Theta changes from 0 to 2pi. This is because you want to see how the body changes in one full rotation.
I'm not following you. Thetadot is given as 1/4 correct?
yes.
This means theta is 1/4*tau correct?
yes
Theta(tau) = (1/4)tau + C
with initial conditions theta(tau) = (1/4)tau + (pi/6)
Ok well then you know theta is changing in time...right?
I do understand that that is what would happen but I do not see how I can work a changing theta into the equation without changing the equation.
Post your code of how you defined the differential equation in matlab.
function xdot = f(t, x) xdot = cos(t) + sin(t); end function ydot = f(t, y) ydot = sin(t) - cos(t); end function thdot = f(t, x) thdot = 1/4; end I have 3 m.files
Your functions shouldn't input or use t...ode45 takes care of that. You can just have 1 mfile that inputs x. Where x(1)=x x(2)=y x(3)=theta and you should define xdot(1), xdot(2), xdot(3)
function xdot = f(t, x) xdot = zeros(3, 1); xdot(1) = cos(t) + sin(t); xdot(2) = sin(t) - cos(t); xdot(3) = 1/4; end
should be cos(theta) not t
ok
Should it be function xdot = f(theta, x) xdot = zeros(3, 1); xdot(1) = cos(theta) + sin(theta); xdot(2) = sin(theta) - cos(theta); xdot(3) = 1/4; end if so how does tau = pi get in here?
no the inputs are still t,x theta = x(3) when you call ode45 you define the timespan as [0 pi] thats how that gets in there
working
I have a plot but it does not look right.|dw:1349900424956:dw|
Join our real-time social learning platform and learn together with your friends!