Hey guys. I am trying to solve the equation of motion for a 2D 2-point-vortex. Im not sure if i am doing it right and how to plot the answer system. Can anybody look at my script and give some advise? Im quite new to matlab

7 views (last 30 days)
Here is my coding

Answers (1)

Star Strider
Star Strider on 16 Mar 2018
Your concept is correct. However you are not calculating the derivatives correctly. You have to step through your ‘PtV’ function with individual values of the solved ‘y’-values to calculate the derivatives.
Try this:
for k1 = 1:numel(t)
ydot(:,k1) = PtV(t(k1),y(k1,:));
end
quiver(y(:,1),y(:,2),ydot(1,:)', ydot(2,:)')
axis equal
The rest of your code appears to be correct, so no changes are needed.

Community Treasure Hunt

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

Start Hunting!