How to find the angular frequency and theta
26 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
saraahhhhh
le 22 Fév 2020
Commenté : Image Analyst
le 22 Fév 2020
clear all
close all
%define the variable
t = 2; %time(in s)
omega = linspace (-2*pi/3,pi) %angular frequency
pm = 101325; %mean pressure (in Pa)
pA = 10; %av. fluctuation amplitude (in Pa)
a = 348; %speed of sound
dA = 1.20; %density air
theta = linspace(0,pi/2)
%calculate the pressure
p = pm + pA*(cos(omega*t));
%calculate the displacement
zeta = (pA/dA*a)*cos((omega*t)-(pi/2-theta));
The problem is I need to find the omega(angular frequency) and theta but Im using the 'linspace' function
0 commentaires
Réponse acceptée
Image Analyst
le 22 Fév 2020
I see nothing wrong with using linspace() to define variables, but usually one supplies the number of elements, like 1000 or whatever
omega = linspace (-2*pi/3, pi, 1000)
theta = linspace(0, pi/2, 1000)
4 commentaires
Image Analyst
le 22 Fév 2020
So you need to define a variable called omegat with linspace
omegat = linspace(-2*pi, p*pi, 1000); % or whatever you want.
p = p_m + p_A cos (omegat)
plot(omegat, p, 'b-', 'LineWidth', 2);
grid on;
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!