Question: Matlab Lab 4 - Wave Speed function. There are many problems in civil engineering that do not have a closed-form solution. This means that an

MatlabMatlab Lab 4 - Wave Speed function. There are many problems incivil engineering that do not have a closed-form solution. This means that

Lab 4 - Wave Speed function. There are many problems in civil engineering that do not have a closed-form solution. This means that an iterative solution is required. This is like when you were learning to drive and didn't how much gas to give the car. You'd try something (initial seed value) and see how the car responded (the loop). Based on the car's speed after a short period of time (output), you would adjust your foot (change the input). This continues until steady state has been achieved Ocean engineering includes predicting wave travel speeds based on their frequency. There is no closed form solution to predict this speed so we need an iterative approach. In this lab, you will create a solver that determines wave speed (often called celerity) given frequency The initial guess value, or seed, for your iteration is: u2 Equation 1 tanh(02%) In Equation 1, is the angular frequency (1/s), g is gravity (m/s'), and h is the depth of the water (m). The output, k, is the wave number. The wave number k is 2n/L where L is the distance between wave peaks, known as the wavelength Equation 1 does not give a very accurate answer for most depths but works as a reasonable seed value. The real relationship between frequency and wave number is given in Equation 2 Equation 2 g tanh (kh) Note that k is on both sides of the equation. This is a common clue that we don't have a closed form solution. 1. write a function that determines k given and h. The first thing it should do is calculate the seed. Then, you will need a loop that keeps calculating k until the answer is good enough". In this case, we define "good enough" as when the current value of k is within 1% of the previous value 2, write a script that runs your function for one of the values of given on page 2 over a series of water depths ranging from h1 to h2 in 10-meter increments Lab 4 - Wave Speed function. There are many problems in civil engineering that do not have a closed-form solution. This means that an iterative solution is required. This is like when you were learning to drive and didn't how much gas to give the car. You'd try something (initial seed value) and see how the car responded (the loop). Based on the car's speed after a short period of time (output), you would adjust your foot (change the input). This continues until steady state has been achieved Ocean engineering includes predicting wave travel speeds based on their frequency. There is no closed form solution to predict this speed so we need an iterative approach. In this lab, you will create a solver that determines wave speed (often called celerity) given frequency The initial guess value, or seed, for your iteration is: u2 Equation 1 tanh(02%) In Equation 1, is the angular frequency (1/s), g is gravity (m/s'), and h is the depth of the water (m). The output, k, is the wave number. The wave number k is 2n/L where L is the distance between wave peaks, known as the wavelength Equation 1 does not give a very accurate answer for most depths but works as a reasonable seed value. The real relationship between frequency and wave number is given in Equation 2 Equation 2 g tanh (kh) Note that k is on both sides of the equation. This is a common clue that we don't have a closed form solution. 1. write a function that determines k given and h. The first thing it should do is calculate the seed. Then, you will need a loop that keeps calculating k until the answer is good enough". In this case, we define "good enough" as when the current value of k is within 1% of the previous value 2, write a script that runs your function for one of the values of given on page 2 over a series of water depths ranging from h1 to h2 in 10-meter increments

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!