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)
Show older comments
Here is my coding
0 Comments
Answers (1)
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.
0 Comments
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!