more off
% - k omega = tan(omega)
% 201 omega values between -10 and 10
omega = [-10 : 0.1 : 10];
omega
omega =
Columns 1 through 11
-10.0000 -9.9000 -9.8000 -9.7000 -9.6000 -9.5000 -9.4000 -9.3000 -9.2000 -9.1000 -9.0000
Columns 12 through 22
-8.9000 -8.8000 -8.7000 -8.6000 -8.5000 -8.4000 -8.3000 -8.2000 -8.1000 -8.0000 -7.9000
Columns 23 through 33
-7.8000 -7.7000 -7.6000 -7.5000 -7.4000 -7.3000 -7.2000 -7.1000 -7.0000 -6.9000 -6.8000
Columns 34 through 44
-6.7000 -6.6000 -6.5000 -6.4000 -6.3000 -6.2000 -6.1000 -6.0000 -5.9000 -5.8000 -5.7000
Columns 45 through 55
-5.6000 -5.5000 -5.4000 -5.3000 -5.2000 -5.1000 -5.0000 -4.9000 -4.8000 -4.7000 -4.6000
Columns 56 through 66
-4.5000 -4.4000 -4.3000 -4.2000 -4.1000 -4.0000 -3.9000 -3.8000 -3.7000 -3.6000 -3.5000
Columns 67 through 77
-3.4000 -3.3000 -3.2000 -3.1000 -3.0000 -2.9000 -2.8000 -2.7000 -2.6000 -2.5000 -2.4000
Columns 78 through 88
-2.3000 -2.2000 -2.1000 -2.0000 -1.9000 -1.8000 -1.7000 -1.6000 -1.5000 -1.4000 -1.3000
Columns 89 through 99
-1.2000 -1.1000 -1.0000 -0.9000 -0.8000 -0.7000 -0.6000 -0.5000 -0.4000 -0.3000 -0.2000
Columns 100 through 110
-0.1000 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000
Columns 111 through 121
1.0000 1.1000 1.2000 1.3000 1.4000 1.5000 1.6000 1.7000 1.8000 1.9000 2.0000
Columns 122 through 132
2.1000 2.2000 2.3000 2.4000 2.5000 2.6000 2.7000 2.8000 2.9000 3.0000 3.1000
Columns 133 through 143
3.2000 3.3000 3.4000 3.5000 3.6000 3.7000 3.8000 3.9000 4.0000 4.1000 4.2000
Columns 144 through 154
4.3000 4.4000 4.5000 4.6000 4.7000 4.8000 4.9000 5.0000 5.1000 5.2000 5.3000
Columns 155 through 165
5.4000 5.5000 5.6000 5.7000 5.8000 5.9000 6.0000 6.1000 6.2000 6.3000 6.4000
Columns 166 through 176
6.5000 6.6000 6.7000 6.8000 6.9000 7.0000 7.1000 7.2000 7.3000 7.4000 7.5000
Columns 177 through 187
7.6000 7.7000 7.8000 7.9000 8.0000 8.1000 8.2000 8.3000 8.4000 8.5000 8.6000
Columns 188 through 198
8.7000 8.8000 8.9000 9.0000 9.1000 9.2000 9.3000 9.4000 9.5000 9.6000 9.7000
Columns 199 through 201
9.8000 9.9000 10.0000
omega
omega =
Columns 1 through 8
-10.0000 -9.9000 -9.8000 -9.7000 -9.6000 -9.5000 -9.4000 -9.3000
Columns 9 through 16
-9.2000 -9.1000 -9.0000 -8.9000 -8.8000 -8.7000 -8.6000 -8.5000
Columns 17 through 24
-8.4000 -8.3000 -8.2000 -8.1000 -8.0000 -7.9000 -7.8000 -7.7000
Columns 25 through 32
-7.6000 -7.5000 -7.4000 -7.3000 -7.2000 -7.1000 -7.0000 -6.9000
Columns 33 through 40
-6.8000 -6.7000 -6.6000 -6.5000 -6.4000 -6.3000 -6.2000 -6.1000
Columns 41 through 48
-6.0000 -5.9000 -5.8000 -5.7000 -5.6000 -5.5000 -5.4000 -5.3000
Columns 49 through 56
-5.2000 -5.1000 -5.0000 -4.9000 -4.8000 -4.7000 -4.6000 -4.5000
Columns 57 through 64
-4.4000 -4.3000 -4.2000 -4.1000 -4.0000 -3.9000 -3.8000 -3.7000
Columns 65 through 72
-3.6000 -3.5000 -3.4000 -3.3000 -3.2000 -3.1000 -3.0000 -2.9000
Columns 73 through 80
-2.8000 -2.7000 -2.6000 -2.5000 -2.4000 -2.3000 -2.2000 -2.1000
Columns 81 through 88
-2.0000 -1.9000 -1.8000 -1.7000 -1.6000 -1.5000 -1.4000 -1.3000
Columns 89 through 96
-1.2000 -1.1000 -1.0000 -0.9000 -0.8000 -0.7000 -0.6000 -0.5000
Columns 97 through 104
-0.4000 -0.3000 -0.2000 -0.1000 0 0.1000 0.2000 0.3000
Columns 105 through 112
0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 1.1000
Columns 113 through 120
1.2000 1.3000 1.4000 1.5000 1.6000 1.7000 1.8000 1.9000
Columns 121 through 128
2.0000 2.1000 2.2000 2.3000 2.4000 2.5000 2.6000 2.7000
Columns 129 through 136
2.8000 2.9000 3.0000 3.1000 3.2000 3.3000 3.4000 3.5000
Columns 137 through 144
3.6000 3.7000 3.8000 3.9000 4.0000 4.1000 4.2000 4.3000
Columns 145 through 152
4.4000 4.5000 4.6000 4.7000 4.8000 4.9000 5.0000 5.1000
Columns 153 through 160
5.2000 5.3000 5.4000 5.5000 5.6000 5.7000 5.8000 5.9000
Columns 161 through 168
6.0000 6.1000 6.2000 6.3000 6.4000 6.5000 6.6000 6.7000
Columns 169 through 176
6.8000 6.9000 7.0000 7.1000 7.2000 7.3000 7.4000 7.5000
Columns 177 through 184
7.6000 7.7000 7.8000 7.9000 8.0000 8.1000 8.2000 8.3000
Columns 185 through 192
8.4000 8.5000 8.6000 8.7000 8.8000 8.9000 9.0000 9.1000
Columns 193 through 200
9.2000 9.3000 9.4000 9.5000 9.6000 9.7000 9.8000 9.9000
Column 201
10.0000
omega=linspace(-10,10,201);
omega
omega =
Columns 1 through 8
-10.0000 -9.9000 -9.8000 -9.7000 -9.6000 -9.5000 -9.4000 -9.3000
Columns 9 through 16
-9.2000 -9.1000 -9.0000 -8.9000 -8.8000 -8.7000 -8.6000 -8.5000
Columns 17 through 24
-8.4000 -8.3000 -8.2000 -8.1000 -8.0000 -7.9000 -7.8000 -7.7000
Columns 25 through 32
-7.6000 -7.5000 -7.4000 -7.3000 -7.2000 -7.1000 -7.0000 -6.9000
Columns 33 through 40
-6.8000 -6.7000 -6.6000 -6.5000 -6.4000 -6.3000 -6.2000 -6.1000
Columns 41 through 48
-6.0000 -5.9000 -5.8000 -5.7000 -5.6000 -5.5000 -5.4000 -5.3000
Columns 49 through 56
-5.2000 -5.1000 -5.0000 -4.9000 -4.8000 -4.7000 -4.6000 -4.5000
Columns 57 through 64
-4.4000 -4.3000 -4.2000 -4.1000 -4.0000 -3.9000 -3.8000 -3.7000
Columns 65 through 72
-3.6000 -3.5000 -3.4000 -3.3000 -3.2000 -3.1000 -3.0000 -2.9000
Columns 73 through 80
-2.8000 -2.7000 -2.6000 -2.5000 -2.4000 -2.3000 -2.2000 -2.1000
Columns 81 through 88
-2.0000 -1.9000 -1.8000 -1.7000 -1.6000 -1.5000 -1.4000 -1.3000
Columns 89 through 96
-1.2000 -1.1000 -1.0000 -0.9000 -0.8000 -0.7000 -0.6000 -0.5000
Columns 97 through 104
-0.4000 -0.3000 -0.2000 -0.1000 0 0.1000 0.2000 0.3000
Columns 105 through 112
0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 1.1000
Columns 113 through 120
1.2000 1.3000 1.4000 1.5000 1.6000 1.7000 1.8000 1.9000
Columns 121 through 128
2.0000 2.1000 2.2000 2.3000 2.4000 2.5000 2.6000 2.7000
Columns 129 through 136
2.8000 2.9000 3.0000 3.1000 3.2000 3.3000 3.4000 3.5000
Columns 137 through 144
3.6000 3.7000 3.8000 3.9000 4.0000 4.1000 4.2000 4.3000
Columns 145 through 152
4.4000 4.5000 4.6000 4.7000 4.8000 4.9000 5.0000 5.1000
Columns 153 through 160
5.2000 5.3000 5.4000 5.5000 5.6000 5.7000 5.8000 5.9000
Columns 161 through 168
6.0000 6.1000 6.2000 6.3000 6.4000 6.5000 6.6000 6.7000
Columns 169 through 176
6.8000 6.9000 7.0000 7.1000 7.2000 7.3000 7.4000 7.5000
Columns 177 through 184
7.6000 7.7000 7.8000 7.9000 8.0000 8.1000 8.2000 8.3000
Columns 185 through 192
8.4000 8.5000 8.6000 8.7000 8.8000 8.9000 9.0000 9.1000
Columns 193 through 200
9.2000 9.3000 9.4000 9.5000 9.6000 9.7000 9.8000 9.9000
Column 201
10.0000
omega=omega';
omega
omega =
-10.0000
-9.9000
-9.8000
-9.7000
-9.6000
-9.5000
-9.4000
-9.3000
-9.2000
-9.1000
-9.0000
-8.9000
-8.8000
-8.7000
-8.6000
-8.5000
-8.4000
-8.3000
-8.2000
-8.1000
-8.0000
-7.9000
-7.8000
-7.7000
-7.6000
-7.5000
-7.4000
-7.3000
-7.2000
-7.1000
-7.0000
-6.9000
-6.8000
-6.7000
-6.6000
-6.5000
-6.4000
-6.3000
-6.2000
-6.1000
-6.0000
-5.9000
-5.8000
-5.7000
-5.6000
-5.5000
-5.4000
-5.3000
-5.2000
-5.1000
-5.0000
-4.9000
-4.8000
-4.7000
-4.6000
-4.5000
-4.4000
-4.3000
-4.2000
-4.1000
-4.0000
-3.9000
-3.8000
-3.7000
-3.6000
-3.5000
-3.4000
-3.3000
-3.2000
-3.1000
-3.0000
-2.9000
-2.8000
-2.7000
-2.6000
-2.5000
-2.4000
-2.3000
-2.2000
-2.1000
-2.0000
-1.9000
-1.8000
-1.7000
-1.6000
-1.5000
-1.4000
-1.3000
-1.2000
-1.1000
-1.0000
-0.9000
-0.8000
-0.7000
-0.6000
-0.5000
-0.4000
-0.3000
-0.2000
-0.1000
0
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000
0.8000
0.9000
1.0000
1.1000
1.2000
1.3000
1.4000
1.5000
1.6000
1.7000
1.8000
1.9000
2.0000
2.1000
2.2000
2.3000
2.4000
2.5000
2.6000
2.7000
2.8000
2.9000
3.0000
3.1000
3.2000
3.3000
3.4000
3.5000
3.6000
3.7000
3.8000
3.9000
4.0000
4.1000
4.2000
4.3000
4.4000
4.5000
4.6000
4.7000
4.8000
4.9000
5.0000
5.1000
5.2000
5.3000
5.4000
5.5000
5.6000
5.7000
5.8000
5.9000
6.0000
6.1000
6.2000
6.3000
6.4000
6.5000
6.6000
6.7000
6.8000
6.9000
7.0000
7.1000
7.2000
7.3000
7.4000
7.5000
7.6000
7.7000
7.8000
7.9000
8.0000
8.1000
8.2000
8.3000
8.4000
8.5000
8.6000
8.7000
8.8000
8.9000
9.0000
9.1000
9.2000
9.3000
9.4000
9.5000
9.6000
9.7000
9.8000
9.9000
10.0000
f=tan(omega);
f
f =
-0.6484
-0.5146
-0.3939
-0.2824
-0.1770
-0.0754
0.0248
0.1254
0.2286
0.3367
0.4523
0.5789
0.7211
0.8856
1.0820
1.3264
1.6457
2.0914
2.7737
3.9824
6.7997
21.7151
-18.5068
-6.4429
-3.8523
-2.7060
-2.0493
-1.6166
-1.3046
-1.0649
-0.8714
-0.7091
-0.5683
-0.4428
-0.3279
-0.2203
-0.1173
-0.0168
0.0834
0.1853
0.2910
0.4031
0.5247
0.6597
0.8139
0.9956
1.2175
1.5013
1.8856
2.4494
3.3805
5.2675
11.3849
-80.7128
-8.8602
-4.6373
-3.0963
-2.2858
-1.7778
-1.4235
-1.1578
-0.9474
-0.7736
-0.6247
-0.4935
-0.3746
-0.2643
-0.1597
-0.0585
0.0416
0.1425
0.2464
0.3555
0.4727
0.6016
0.7470
0.9160
1.1192
1.3738
1.7098
2.1850
2.9271
4.2863
7.6966
34.2325
-14.1014
-5.7979
-3.6021
-2.5722
-1.9648
-1.5574
-1.2602
-1.0296
-0.8423
-0.6841
-0.5463
-0.4228
-0.3093
-0.2027
-0.1003
0
0.1003
0.2027
0.3093
0.4228
0.5463
0.6841
0.8423
1.0296
1.2602
1.5574
1.9648
2.5722
3.6021
5.7979
14.1014
-34.2325
-7.6966
-4.2863
-2.9271
-2.1850
-1.7098
-1.3738
-1.1192
-0.9160
-0.7470
-0.6016
-0.4727
-0.3555
-0.2464
-0.1425
-0.0416
0.0585
0.1597
0.2643
0.3746
0.4935
0.6247
0.7736
0.9474
1.1578
1.4235
1.7778
2.2858
3.0963
4.6373
8.8602
80.7128
-11.3849
-5.2675
-3.3805
-2.4494
-1.8856
-1.5013
-1.2175
-0.9956
-0.8139
-0.6597
-0.5247
-0.4031
-0.2910
-0.1853
-0.0834
0.0168
0.1173
0.2203
0.3279
0.4428
0.5683
0.7091
0.8714
1.0649
1.3046
1.6166
2.0493
2.7060
3.8523
6.4429
18.5068
-21.7151
-6.7997
-3.9824
-2.7737
-2.0914
-1.6457
-1.3264
-1.0820
-0.8856
-0.7211
-0.5789
-0.4523
-0.3367
-0.2286
-0.1254
-0.0248
0.0754
0.1770
0.2824
0.3939
0.5146
0.6484
plot(omega,f)
help plot
plot Linear plot.
plot(X,Y) plots vector Y versus vector X. If X or Y is a matrix,
then the vector is plotted versus the rows or columns of the matrix,
whichever line up. If X is a scalar and Y is a vector, disconnected
line objects are created and plotted as discrete points vertically at
X.
plot(Y) plots the columns of Y versus their index.
If Y is complex, plot(Y) is equivalent to plot(real(Y),imag(Y)).
In all other uses of plot, the imaginary part is ignored.
Various line types, plot symbols and colors may be obtained with
plot(X,Y,S) where S is a character string made from one element
from any or all the following 3 columns:
b blue . point - solid
g green o circle : dotted
r red x x-mark -. dashdot
c cyan + plus -- dashed
m magenta * star (none) no line
y yellow s square
k black d diamond
w white v triangle (down)
^ triangle (up)
< triangle (left)
> triangle (right)
p pentagram
h hexagram
For example, plot(X,Y,'c+:') plots a cyan dotted line with a plus
at each data point; plot(X,Y,'bd') plots blue diamond at each data
point but does not draw any line.
plot(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by
the (X,Y,S) triples, where the X's and Y's are vectors or matrices
and the S's are strings.
For example, plot(X,Y,'y-',X,Y,'go') plots the data twice, with a
solid yellow line interpolating green circles at the data points.
The plot command, if no color is specified, makes automatic use of
the colors specified by the axes ColorOrder property. By default,
plot cycles through the colors in the ColorOrder property. For
monochrome systems, plot cycles over the axes LineStyleOrder property.
Note that RGB colors in the ColorOrder property may differ from
similarly-named colors in the (X,Y,S) triples. For example, the
second axes ColorOrder property is medium green with RGB [0 .5 0],
while plot(X,Y,'g') plots a green line with RGB [0 1 0].
If you do not specify a marker type, plot uses no marker.
If you do not specify a line style, plot uses a solid line.
plot(AX,...) plots into the axes with handle AX.
plot returns a column vector of handles to lineseries objects, one
handle per plotted line.
The X,Y pairs, or X,Y,S triples, can be followed by
parameter/value pairs to specify additional properties
of the lines. For example, plot(X,Y,'LineWidth',2,'Color',[.6 0 0])
will create a plot with a dark red line width of 2 points.
Example
x = -pi:pi/10:pi;
y = tan(sin(x)) - sin(tan(x));
plot(x,y,'--rs','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10)
See also plottools, semilogx, semilogy, loglog, plotyy, plot3, grid,
title, xlabel, ylabel, axis, axes, hold, legend, subplot, scatter.
Reference page for plot
Other functions named plot
plot(omega,f,'--or','LineWidth',2)
plot(omega,f)
axis([-10 10 -10 10])
grid on
set(gca)
ALim: {}
ALimMode: {'auto' 'manual'}
ActivePositionProperty: {1x2 cell}
AmbientLightColor: {1x0 cell}
Box: {'on' 'off'}
BoxStyle: {'full' 'back'}
BusyAction: {1x2 cell}
ButtonDownFcn: {}
CLim: {}
CLimMode: {'auto' 'manual'}
CameraPosition: {}
CameraPositionMode: {'auto' 'manual'}
CameraTarget: {}
CameraTargetMode: {'auto' 'manual'}
CameraUpVector: {}
CameraUpVectorMode: {'auto' 'manual'}
CameraViewAngle: {}
CameraViewAngleMode: {'auto' 'manual'}
Children: {}
Clipping: {'on' 'off'}
ClippingStyle: {1x2 cell}
Color: {1x0 cell}
ColorOrder: {}
ColorOrderIndex: {}
CreateFcn: {}
DataAspectRatio: {}
DataAspectRatioMode: {'auto' 'manual'}
DeleteFcn: {}
FontAngle: {1x2 cell}
FontName: {}
FontSize: {}
FontSmoothing: {'on' 'off'}
FontUnits: {1x5 cell}
FontWeight: {'normal' 'bold'}
GridAlpha: {}
GridAlphaMode: {'auto' 'manual'}
GridColor: {1x0 cell}
GridColorMode: {'auto' 'manual'}
GridLineStyle: {1x5 cell}
HandleVisibility: {1x3 cell}
HitTest: {'on' 'off'}
Interruptible: {'on' 'off'}
LabelFontSizeMultiplier: {}
Layer: {'bottom' 'top'}
LineStyleOrder: {}
LineStyleOrderIndex: {}
LineWidth: {}
MinorGridAlpha: {}
MinorGridAlphaMode: {'auto' 'manual'}
MinorGridColor: {1x0 cell}
MinorGridColorMode: {'auto' 'manual'}
MinorGridLineStyle: {1x5 cell}
NextPlot: {1x3 cell}
OuterPosition: {}
Parent: {}
PickableParts: {1x3 cell}
PlotBoxAspectRatio: {}
PlotBoxAspectRatioMode: {'auto' 'manual'}
Position: {}
Projection: {1x2 cell}
Selected: {'on' 'off'}
SelectionHighlight: {'on' 'off'}
SortMethod: {1x2 cell}
Tag: {}
TickDir: {1x3 cell}
TickDirMode: {'auto' 'manual'}
TickLabelInterpreter: {1x3 cell}
TickLength: {}
Title: {}
TitleFontSizeMultiplier: {}
TitleFontWeight: {'normal' 'bold'}
UIContextMenu: {}
Units: {1x6 cell}
UserData: {}
View: {}
Visible: {'on' 'off'}
XAxis: {}
XAxisLocation: {1x3 cell}
XColor: {1x0 cell}
XColorMode: {'auto' 'manual'}
XDir: {1x2 cell}
XGrid: {'on' 'off'}
XLabel: {}
XLim: {}
XLimMode: {'auto' 'manual'}
XMinorGrid: {'on' 'off'}
XMinorTick: {'on' 'off'}
XScale: {'linear' 'log'}
XTick: {}
XTickLabel: {}
XTickLabelMode: {'auto' 'manual'}
XTickLabelRotation: {}
XTickMode: {'auto' 'manual'}
YAxis: {}
YAxisLocation: {1x3 cell}
YColor: {1x0 cell}
YColorMode: {'auto' 'manual'}
YDir: {1x2 cell}
YGrid: {'on' 'off'}
YLabel: {}
YLim: {}
YLimMode: {'auto' 'manual'}
YMinorGrid: {'on' 'off'}
YMinorTick: {'on' 'off'}
YScale: {'linear' 'log'}
YTick: {}
YTickLabel: {}
YTickLabelMode: {'auto' 'manual'}
YTickLabelRotation: {}
YTickMode: {'auto' 'manual'}
ZAxis: {}
ZColor: {1x0 cell}
ZColorMode: {'auto' 'manual'}
ZDir: {1x2 cell}
ZGrid: {'on' 'off'}
ZLabel: {}
ZLim: {}
ZLimMode: {'auto' 'manual'}
ZMinorGrid: {'on' 'off'}
ZMinorTick: {'on' 'off'}
ZScale: {'linear' 'log'}
ZTick: {}
ZTickLabel: {}
ZTickLabelMode: {'auto' 'manual'}
ZTickLabelRotation: {}
ZTickMode: {'auto' 'manual'}
set(gca,'xtick',[-3*pi:pi:3*pi])
set(gca,'xaxislocation','origin')
% - k omega = tan(omega)
% for now assume k = 1
k=1
k =
1
xlabel('omega')
title('tan(omega) versus omega')
f = [f -k*omega];
f
f =
-0.6484 10.0000
-0.5146 9.9000
-0.3939 9.8000
-0.2824 9.7000
-0.1770 9.6000
-0.0754 9.5000
0.0248 9.4000
0.1254 9.3000
0.2286 9.2000
0.3367 9.1000
0.4523 9.0000
0.5789 8.9000
0.7211 8.8000
0.8856 8.7000
1.0820 8.6000
1.3264 8.5000
1.6457 8.4000
2.0914 8.3000
2.7737 8.2000
3.9824 8.1000
6.7997 8.0000
21.7151 7.9000
-18.5068 7.8000
-6.4429 7.7000
-3.8523 7.6000
-2.7060 7.5000
-2.0493 7.4000
-1.6166 7.3000
-1.3046 7.2000
-1.0649 7.1000
-0.8714 7.0000
-0.7091 6.9000
-0.5683 6.8000
-0.4428 6.7000
-0.3279 6.6000
-0.2203 6.5000
-0.1173 6.4000
-0.0168 6.3000
0.0834 6.2000
0.1853 6.1000
0.2910 6.0000
0.4031 5.9000
0.5247 5.8000
0.6597 5.7000
0.8139 5.6000
0.9956 5.5000
1.2175 5.4000
1.5013 5.3000
1.8856 5.2000
2.4494 5.1000
3.3805 5.0000
5.2675 4.9000
11.3849 4.8000
-80.7128 4.7000
-8.8602 4.6000
-4.6373 4.5000
-3.0963 4.4000
-2.2858 4.3000
-1.7778 4.2000
-1.4235 4.1000
-1.1578 4.0000
-0.9474 3.9000
-0.7736 3.8000
-0.6247 3.7000
-0.4935 3.6000
-0.3746 3.5000
-0.2643 3.4000
-0.1597 3.3000
-0.0585 3.2000
0.0416 3.1000
0.1425 3.0000
0.2464 2.9000
0.3555 2.8000
0.4727 2.7000
0.6016 2.6000
0.7470 2.5000
0.9160 2.4000
1.1192 2.3000
1.3738 2.2000
1.7098 2.1000
2.1850 2.0000
2.9271 1.9000
4.2863 1.8000
7.6966 1.7000
34.2325 1.6000
-14.1014 1.5000
-5.7979 1.4000
-3.6021 1.3000
-2.5722 1.2000
-1.9648 1.1000
-1.5574 1.0000
-1.2602 0.9000
-1.0296 0.8000
-0.8423 0.7000
-0.6841 0.6000
-0.5463 0.5000
-0.4228 0.4000
-0.3093 0.3000
-0.2027 0.2000
-0.1003 0.1000
0 0
0.1003 -0.1000
0.2027 -0.2000
0.3093 -0.3000
0.4228 -0.4000
0.5463 -0.5000
0.6841 -0.6000
0.8423 -0.7000
1.0296 -0.8000
1.2602 -0.9000
1.5574 -1.0000
1.9648 -1.1000
2.5722 -1.2000
3.6021 -1.3000
5.7979 -1.4000
14.1014 -1.5000
-34.2325 -1.6000
-7.6966 -1.7000
-4.2863 -1.8000
-2.9271 -1.9000
-2.1850 -2.0000
-1.7098 -2.1000
-1.3738 -2.2000
-1.1192 -2.3000
-0.9160 -2.4000
-0.7470 -2.5000
-0.6016 -2.6000
-0.4727 -2.7000
-0.3555 -2.8000
-0.2464 -2.9000
-0.1425 -3.0000
-0.0416 -3.1000
0.0585 -3.2000
0.1597 -3.3000
0.2643 -3.4000
0.3746 -3.5000
0.4935 -3.6000
0.6247 -3.7000
0.7736 -3.8000
0.9474 -3.9000
1.1578 -4.0000
1.4235 -4.1000
1.7778 -4.2000
2.2858 -4.3000
3.0963 -4.4000
4.6373 -4.5000
8.8602 -4.6000
80.7128 -4.7000
-11.3849 -4.8000
-5.2675 -4.9000
-3.3805 -5.0000
-2.4494 -5.1000
-1.8856 -5.2000
-1.5013 -5.3000
-1.2175 -5.4000
-0.9956 -5.5000
-0.8139 -5.6000
-0.6597 -5.7000
-0.5247 -5.8000
-0.4031 -5.9000
-0.2910 -6.0000
-0.1853 -6.1000
-0.0834 -6.2000
0.0168 -6.3000
0.1173 -6.4000
0.2203 -6.5000
0.3279 -6.6000
0.4428 -6.7000
0.5683 -6.8000
0.7091 -6.9000
0.8714 -7.0000
1.0649 -7.1000
1.3046 -7.2000
1.6166 -7.3000
2.0493 -7.4000
2.7060 -7.5000
3.8523 -7.6000
6.4429 -7.7000
18.5068 -7.8000
-21.7151 -7.9000
-6.7997 -8.0000
-3.9824 -8.1000
-2.7737 -8.2000
-2.0914 -8.3000
-1.6457 -8.4000
-1.3264 -8.5000
-1.0820 -8.6000
-0.8856 -8.7000
-0.7211 -8.8000
-0.5789 -8.9000
-0.4523 -9.0000
-0.3367 -9.1000
-0.2286 -9.2000
-0.1254 -9.3000
-0.0248 -9.4000
0.0754 -9.5000
0.1770 -9.6000
0.2824 -9.7000
0.3939 -9.8000
0.5146 -9.9000
0.6484 -10.0000
f = [f -k*omega];
plot(omega,f)
omega
omega =
-10.0000
-9.9000
-9.8000
-9.7000
-9.6000
-9.5000
-9.4000
-9.3000
-9.2000
-9.1000
-9.0000
-8.9000
-8.8000
-8.7000
-8.6000
-8.5000
-8.4000
-8.3000
-8.2000
-8.1000
-8.0000
-7.9000
-7.8000
-7.7000
-7.6000
-7.5000
-7.4000
-7.3000
-7.2000
-7.1000
-7.0000
-6.9000
-6.8000
-6.7000
-6.6000
-6.5000
-6.4000
-6.3000
-6.2000
-6.1000
-6.0000
-5.9000
-5.8000
-5.7000
-5.6000
-5.5000
-5.4000
-5.3000
-5.2000
-5.1000
-5.0000
-4.9000
-4.8000
-4.7000
-4.6000
-4.5000
-4.4000
-4.3000
-4.2000
-4.1000
-4.0000
-3.9000
-3.8000
-3.7000
-3.6000
-3.5000
-3.4000
-3.3000
-3.2000
-3.1000
-3.0000
-2.9000
-2.8000
-2.7000
-2.6000
-2.5000
-2.4000
-2.3000
-2.2000
-2.1000
-2.0000
-1.9000
-1.8000
-1.7000
-1.6000
-1.5000
-1.4000
-1.3000
-1.2000
-1.1000
-1.0000
-0.9000
-0.8000
-0.7000
-0.6000
-0.5000
-0.4000
-0.3000
-0.2000
-0.1000
0
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000
0.8000
0.9000
1.0000
1.1000
1.2000
1.3000
1.4000
1.5000
1.6000
1.7000
1.8000
1.9000
2.0000
2.1000
2.2000
2.3000
2.4000
2.5000
2.6000
2.7000
2.8000
2.9000
3.0000
3.1000
3.2000
3.3000
3.4000
3.5000
3.6000
3.7000
3.8000
3.9000
4.0000
4.1000
4.2000
4.3000
4.4000
4.5000
4.6000
4.7000
4.8000
4.9000
5.0000
5.1000
5.2000
5.3000
5.4000
5.5000
5.6000
5.7000
5.8000
5.9000
6.0000
6.1000
6.2000
6.3000
6.4000
6.5000
6.6000
6.7000
6.8000
6.9000
7.0000
7.1000
7.2000
7.3000
7.4000
7.5000
7.6000
7.7000
7.8000
7.9000
8.0000
8.1000
8.2000
8.3000
8.4000
8.5000
8.6000
8.7000
8.8000
8.9000
9.0000
9.1000
9.2000
9.3000
9.4000
9.5000
9.6000
9.7000
9.8000
9.9000
10.0000
omega=[-10:0.1:10]';
f=[tan(omega) -k*omega];
omega
omega =
-10.0000
-9.9000
-9.8000
-9.7000
-9.6000
-9.5000
-9.4000
-9.3000
-9.2000
-9.1000
-9.0000
-8.9000
-8.8000
-8.7000
-8.6000
-8.5000
-8.4000
-8.3000
-8.2000
-8.1000
-8.0000
-7.9000
-7.8000
-7.7000
-7.6000
-7.5000
-7.4000
-7.3000
-7.2000
-7.1000
-7.0000
-6.9000
-6.8000
-6.7000
-6.6000
-6.5000
-6.4000
-6.3000
-6.2000
-6.1000
-6.0000
-5.9000
-5.8000
-5.7000
-5.6000
-5.5000
-5.4000
-5.3000
-5.2000
-5.1000
-5.0000
-4.9000
-4.8000
-4.7000
-4.6000
-4.5000
-4.4000
-4.3000
-4.2000
-4.1000
-4.0000
-3.9000
-3.8000
-3.7000
-3.6000
-3.5000
-3.4000
-3.3000
-3.2000
-3.1000
-3.0000
-2.9000
-2.8000
-2.7000
-2.6000
-2.5000
-2.4000
-2.3000
-2.2000
-2.1000
-2.0000
-1.9000
-1.8000
-1.7000
-1.6000
-1.5000
-1.4000
-1.3000
-1.2000
-1.1000
-1.0000
-0.9000
-0.8000
-0.7000
-0.6000
-0.5000
-0.4000
-0.3000
-0.2000
-0.1000
0
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000
0.8000
0.9000
1.0000
1.1000
1.2000
1.3000
1.4000
1.5000
1.6000
1.7000
1.8000
1.9000
2.0000
2.1000
2.2000
2.3000
2.4000
2.5000
2.6000
2.7000
2.8000
2.9000
3.0000
3.1000
3.2000
3.3000
3.4000
3.5000
3.6000
3.7000
3.8000
3.9000
4.0000
4.1000
4.2000
4.3000
4.4000
4.5000
4.6000
4.7000
4.8000
4.9000
5.0000
5.1000
5.2000
5.3000
5.4000
5.5000
5.6000
5.7000
5.8000
5.9000
6.0000
6.1000
6.2000
6.3000
6.4000
6.5000
6.6000
6.7000
6.8000
6.9000
7.0000
7.1000
7.2000
7.3000
7.4000
7.5000
7.6000
7.7000
7.8000
7.9000
8.0000
8.1000
8.2000
8.3000
8.4000
8.5000
8.6000
8.7000
8.8000
8.9000
9.0000
9.1000
9.2000
9.3000
9.4000
9.5000
9.6000
9.7000
9.8000
9.9000
10.0000
f
f =
-0.6484 10.0000
-0.5146 9.9000
-0.3939 9.8000
-0.2824 9.7000
-0.1770 9.6000
-0.0754 9.5000
0.0248 9.4000
0.1254 9.3000
0.2286 9.2000
0.3367 9.1000
0.4523 9.0000
0.5789 8.9000
0.7211 8.8000
0.8856 8.7000
1.0820 8.6000
1.3264 8.5000
1.6457 8.4000
2.0914 8.3000
2.7737 8.2000
3.9824 8.1000
6.7997 8.0000
21.7151 7.9000
-18.5068 7.8000
-6.4429 7.7000
-3.8523 7.6000
-2.7060 7.5000
-2.0493 7.4000
-1.6166 7.3000
-1.3046 7.2000
-1.0649 7.1000
-0.8714 7.0000
-0.7091 6.9000
-0.5683 6.8000
-0.4428 6.7000
-0.3279 6.6000
-0.2203 6.5000
-0.1173 6.4000
-0.0168 6.3000
0.0834 6.2000
0.1853 6.1000
0.2910 6.0000
0.4031 5.9000
0.5247 5.8000
0.6597 5.7000
0.8139 5.6000
0.9956 5.5000
1.2175 5.4000
1.5013 5.3000
1.8856 5.2000
2.4494 5.1000
3.3805 5.0000
5.2675 4.9000
11.3849 4.8000
-80.7128 4.7000
-8.8602 4.6000
-4.6373 4.5000
-3.0963 4.4000
-2.2858 4.3000
-1.7778 4.2000
-1.4235 4.1000
-1.1578 4.0000
-0.9474 3.9000
-0.7736 3.8000
-0.6247 3.7000
-0.4935 3.6000
-0.3746 3.5000
-0.2643 3.4000
-0.1597 3.3000
-0.0585 3.2000
0.0416 3.1000
0.1425 3.0000
0.2464 2.9000
0.3555 2.8000
0.4727 2.7000
0.6016 2.6000
0.7470 2.5000
0.9160 2.4000
1.1192 2.3000
1.3738 2.2000
1.7098 2.1000
2.1850 2.0000
2.9271 1.9000
4.2863 1.8000
7.6966 1.7000
34.2325 1.6000
-14.1014 1.5000
-5.7979 1.4000
-3.6021 1.3000
-2.5722 1.2000
-1.9648 1.1000
-1.5574 1.0000
-1.2602 0.9000
-1.0296 0.8000
-0.8423 0.7000
-0.6841 0.6000
-0.5463 0.5000
-0.4228 0.4000
-0.3093 0.3000
-0.2027 0.2000
-0.1003 0.1000
0 0
0.1003 -0.1000
0.2027 -0.2000
0.3093 -0.3000
0.4228 -0.4000
0.5463 -0.5000
0.6841 -0.6000
0.8423 -0.7000
1.0296 -0.8000
1.2602 -0.9000
1.5574 -1.0000
1.9648 -1.1000
2.5722 -1.2000
3.6021 -1.3000
5.7979 -1.4000
14.1014 -1.5000
-34.2325 -1.6000
-7.6966 -1.7000
-4.2863 -1.8000
-2.9271 -1.9000
-2.1850 -2.0000
-1.7098 -2.1000
-1.3738 -2.2000
-1.1192 -2.3000
-0.9160 -2.4000
-0.7470 -2.5000
-0.6016 -2.6000
-0.4727 -2.7000
-0.3555 -2.8000
-0.2464 -2.9000
-0.1425 -3.0000
-0.0416 -3.1000
0.0585 -3.2000
0.1597 -3.3000
0.2643 -3.4000
0.3746 -3.5000
0.4935 -3.6000
0.6247 -3.7000
0.7736 -3.8000
0.9474 -3.9000
1.1578 -4.0000
1.4235 -4.1000
1.7778 -4.2000
2.2858 -4.3000
3.0963 -4.4000
4.6373 -4.5000
8.8602 -4.6000
80.7128 -4.7000
-11.3849 -4.8000
-5.2675 -4.9000
-3.3805 -5.0000
-2.4494 -5.1000
-1.8856 -5.2000
-1.5013 -5.3000
-1.2175 -5.4000
-0.9956 -5.5000
-0.8139 -5.6000
-0.6597 -5.7000
-0.5247 -5.8000
-0.4031 -5.9000
-0.2910 -6.0000
-0.1853 -6.1000
-0.0834 -6.2000
0.0168 -6.3000
0.1173 -6.4000
0.2203 -6.5000
0.3279 -6.6000
0.4428 -6.7000
0.5683 -6.8000
0.7091 -6.9000
0.8714 -7.0000
1.0649 -7.1000
1.3046 -7.2000
1.6166 -7.3000
2.0493 -7.4000
2.7060 -7.5000
3.8523 -7.6000
6.4429 -7.7000
18.5068 -7.8000
-21.7151 -7.9000
-6.7997 -8.0000
-3.9824 -8.1000
-2.7737 -8.2000
-2.0914 -8.3000
-1.6457 -8.4000
-1.3264 -8.5000
-1.0820 -8.6000
-0.8856 -8.7000
-0.7211 -8.8000
-0.5789 -8.9000
-0.4523 -9.0000
-0.3367 -9.1000
-0.2286 -9.2000
-0.1254 -9.3000
-0.0248 -9.4000
0.0754 -9.5000
0.1770 -9.6000
0.2824 -9.7000
0.3939 -9.8000
0.5146 -9.9000
0.6484 -10.0000
omega=[-10:0.1:10]';
f=[tan(omega) -k*omega];
plot(omega,f)
axis([-10 10 -10 10]);
grid on
% -k omega = tan(omega)
% error = tan(omega) + k omega
% first must define the error as a function
% call it freqEq1
help freqEq
Function used to find the natural frequencies of a
string that has one end rigidly attached to the musical
instrument but the other end attached to a flexible
strip.
Input:
omega: The natural frequency in radians
k: The bending flexibility of the strip
Both are suitably nondimensionalized in a way not
important here.
Output:
error: If error is zero, then the frequency is a
valid one for that value of k. Note that a
string can vibrate with infinitely many
frequencies (theoretically at least)
Advanced analysis taught in Analysis in Mechanical
Engineering II shows that the equation the frequencies
must satisfy is:
- k omega = tan(omega)
However, the tan is infinite at any odd amount of pi/2,
and that is a numerical problem. So we multiply both
sides by the cosine:
- k omega cos(omega) = sin(omega)
Then if the frequency is not right, the error in the
equation (difference between the right and left hand
sides) is:
error = sin(omega) + k omega cos(omega)
help freqEq
Function used to find the natural frequencies of a
string that has one end rigidly attached to the musical
instrument but the other end attached to a flexible
strip.
Input:
omega: The natural frequency in radians
k: The bending flexibility of the strip
Both are suitably nondimensionalized in a way not
important here.
Output:
error: If error is zero, then the frequency is a
valid one for that value of k. Note that a
string can vibrate with infinitely many
frequencies (theoretically at least)
Advanced analysis taught in Analysis in Mechanical
Engineering II shows that the equation the frequencies
must satisfy is:
- k omega = tan(omega)
However, the tan is infinite at any odd amount of pi/2,
and that is a numerical problem. So we multiply both
sides by the cosine:
- k omega cos(omega) = sin(omega)
Then if the frequency is not right, the error in the
equation (difference between the right and left hand
sides) is:
error = sin(omega) + k omega cos(omega)
help freqEq1
Evaluate error = tan(omega) + k omega where k=1
Input: omega: the frequency to test
Output: error: zero if omega is a valid frequency,
nonzero if not
fzero(freqEq1,2)
{Not enough input arguments.
Error in freqEq1 (line 8)
error=tan(omega)+1*omega;}
freqEq(1)
{Not enough input arguments.
Error in freqEq (line 34)
error = sin(omega) + k*omega*cos(omega);}
freqEq1(1)
ans =
2.5574
fzero('freqEq1',2)
ans =
2.0288
fzero('freqEq1',[1.9 2.5])
ans =
2.0288
fzero('freqEq1',.5*pi)
ans =
1.5708
% - k omega = tan(omega)
% multiply by cos(omega)
help freqEq1Mod
This function returns the error in the equation
satisfied by the frequencies of a string with one end
flexibly attached. The scaled attachment flexibility k
is assumed to be 1.
Input:
omega: the frequency to test
Output:
error: zero if omega is a correct frequency (tone)
of the string, nonzero if it is not.
Advanced analysis taught in Analysis in Mechanical
Engineering II shows that the equation the frequencies
must satisfy is:
- k omega = tan(omega)
However, the tan is infinite at any odd amount of pi/2,
and that is a numerical problem. So we multiply both
sides by the cosine:
- k omega cos(omega) = sin(omega)
Then if the frequency is not right, the error in the
equation (difference between the right and left hand
sides) is:
error = sin(omega) + k omega cos(omega)
help freqEq1Mod
Evaluate error = tan(omega) + k omega where k=1
Input: omega: the frequency to test
Output: error: zero if omega is a valid frequency,
nonzero if not
fzero('freqEq1Mod',.5*pi)
ans =
2.0288
fzero('freqEq1Mod',1.5*pi)
ans =
4.9132
fzero('freqEq1Mod',2.5*pi)
ans =
7.9787
freqEq1Mod(2)
ans =
0.0770