subject

Goal: Making and using functions and input files; plot gridded variables; use embedded control structures.

Assignment: You will write an input file, two functions and a main program that interfaces with

each of these.

1) Create an input file with the following data (in meters)
Wave height = 3
Wavelength = 10
Water depth = [1 2 3 4]

2) In coastal engineering, the "wave number" is defined as k = 2p/Lwhere Lis the wave’s wavelength. There is a relationship between the wave number and the wave’s period, T, given by:

(2pi/T)^2 = gk tanh(kh) (1)
Where his the water depth. Create a function called ‘wave_period’ that will compute the wave number for each for each of the depths given in (1). This function should take wavelength, wave height, and water depth as input and give wave period as output.
3) The velocity components below a linear wave are given by the following equations:
u=(H/2)sigma[(cosh k(h+z)/sinh (kh) ] cos(kx-sigma. t) (2)
w=-(H/2)sigma[(sinh k(h+z)/sinh (kh) ] sinh(kx-sigma. t) (3)
where sigma= 2p/T, u is the x-velocity component, and w is the y-velocity component. These equations define velocity components as a function of time (t) and space (x). By holding one or the other constant, velocities can be computed.
Create a function to compute the x-velocity and y-velocity components below a wave as a function of xby holding t= 0 in the above equations. Allow the user to specify how many points they would like to use in both the x and z directions. Create a 2x2 subplot of the results using 20 points in the x-direction and 10 points in the z-direction. Please note that zin these equations starts at 0 and goes to –h.
Hint: you may want to use an embedded "for" loop (or several). Another hint: type "help quiver" to see what you should be going after.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:10
Write an application that allows a user to enter the names and birthdates of up to 10 friends. continue to prompt the user for names and birthdates until the user enters the sentinel value “zzz” for a name or has entered 10 names, whichever comes first. when the user is finished entering names, produce a count of how many names were entered, and then display the names. in a loop, continuously ask the user to type one of the names and display the corresponding birthdate or an error message if the name has not been previously entered. the loop continues until the user enters “zzz” for a name. save the application as birthdayreminder.java.
Answers: 1
question
Computers and Technology, 22.06.2019 19:10
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
question
Computers and Technology, 23.06.2019 07:00
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
You know the right answer?
Goal: Making and using functions and input files; plot gridded variables; use embedded control struc...
Questions
question
SAT, 09.12.2021 01:00