Horizontal Freestream Flow Issues With Symbolic Math Toolbox
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 blackI 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 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 fcontour, symbolic MATLAB Answers — New Questions