Horizontal Freestream Flow Issues With Symbolic Math Toolbox
Show older comments
I am attempting to plot stictly horizontal freestream flow using fcontour and the Symbolic Math toolbox. A few days ago I was able to successfully achieve this with the code below. However, starting last night whenever I run the script the "symbolic method" produces vertical contour lines that indicate stricty vertical freestram flow. I have gone back to the original code to ensure nothing I changed in the script had an impact, but the issue still remains. I have included an image of the incorrect plot (from the symbolic method) vs. the correct plot (from the numerical method) to better illustrate the problem. I would love some guidance on what to try and fix this strange issue.
clear
clc
% use the symbolic method to create the stream function for freestream flow
% and plot it
syms xs ys
Uval = 1;
Vval = 0;
psi_fs = Uval*ys - Vval*xs;
figure(4)
fcontour(psi_fs,[-3 3 -5 5],'k'); %'k' makes all the lines black
% use the numerical method to create the stream function for freestream
% flow and plot it
xlocs = [-3:.1:3]; % you can use linspace for this
ylocs = [-3:.1:3];
% make the grid of points x horizontal, y vertical
[xmat,ymat] = meshgrid(xlocs,ylocs);
psi_vals_fs = Uval*ymat - Vval*xmat;
figure(5)
contour(xmat, ymat, psi_vals_fs,'k') % 'k' makes all the lines black

Accepted Answer
More Answers (0)
Categories
Find more on Parametric Modeling 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!


