Solving for multiple natural frequency and damping ratio given an obfuscated code

I have been given an Obfuscated .p file that plays a set of notes from a popular song. I am tasked with finding the natural frequency(Omega_n) in my code and Damping ratio(Zeta in code) for each individual note. I also believe that my Final Value(fv incode) is incorret and I can't seem to figure out how to solve for the multiple zeta and omega values.
Code attatched below
clc, clear all, close all, format compact
%Group Number 23
[t,x]=Jambox(23)
%Plot of Given Jambox Function
figure(1);
plot(t,x);
hold on;
xlabel('Time, t(sec)');
ylabel('Displacement');
title('Given Function');
si=stepinfo(x,t)
os=1.0067e+4
peak=0.9960
t_peak=2.0007
fv=3.4999 %sec
%Calculation of Zeta and Omega
Zeta=sqrt(log(os)^2/(pi^2+log(os)^2))
Omega_n=(pi)/(t_peak*sqrt(1-(Zeta^2)))
%Force of 15 is chosen
m=15/(fv*Omega_n^2)
sys=tf([1/m],[1 2*Zeta*Omega_n Omega_n^2])
figure(2);
tvector1=linspace(0,6,7)
step(15*sys,tvector1)

2 Comments

I was informed I need to use Log decriment using the two largest peaks and the period
Could you elaborate what you mean by multiple values of Zeta and Omega_n values?

Sign in to comment.

Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Products

Release

R2022a

Asked:

on 1 May 2022

Commented:

on 4 May 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!