Write a matlab program to implement the discrete system

Assignment Help MATLAB Programming
Reference no: EM131263820

1. The magnetic field generated from a time-varying electric field in a medium with electric permittivity ε and electric conductivity σ is given by Ampere's Law:

∇ x H¯ = ε ∂E¯/∂t + σE¯.       (1)

If the medium is invariant in z (∂/∂z = 0) and the electric field has only a z component (Ez), then the magnetic field is confined to the 2D x-y plane (i.e., Hz = 0). The above equation is to be discretized using the Finite Volume method on a 2D mesh composed of equilateral triangles of side d as shown below. Suppose the electric field Ez is assigned to each node i in the mesh and time level n, Ez ( xi , yi ,tn ) = Ezn.

(a) Define the finite volume Vi of node i and indicate the appropriate location assignment of the magnetic field H in the mesh.

(b) By applying Ampere's law to the finite volume Vi of node i, obtain a Finite Volume discrete equation for Eq. (1) that is accurate to 2nd-order in time. Express all coefficients in the discrete equation in terms of the length d of the triangle and the time step Δt. (Hint: use Stokes' theorem to convert the surface integral of a curl to a contour integral.)

2. A microfluidic channel has a cross-sectional geometry in the x-y plane as shown Figure 2.1. The channel is assumed to have infinite length. Suppose fluid flow in the channel is modeled by the steady-state Navier-Stokes equation for incompressible flow:

(v¯.∇)v¯ - 1/Re∇2v¯ = -∇p,

where v¯ is the flow velocity, p is the pressure and Re is Reynolds number.

1433_Figure.jpg

(a) If the flow is driven by a constant pressure gradient in the z-direction, ∇p = - pzzˆ, then the flow velocity can be assumed to have only a z-component, in this case the above Navier-Stokes equation reduces to v¯ = v(x, y)zˆ. Show that in this 

Re ∇ v( x, y) = - pz , (pz = ∂p/∂z) (1)

(b) Show that the Finite Volume discretization of Eq. (1) for a general node i on a triangular mesh can be written as
ni wik ni wik

- viΣnik=1wik/lik + Σnik=1wik/lik = vk = -Re.pz Ai , (2)

where vi = v(xi, yi), Ai is the area of the Voronoi polygon associated with node i, ni is the number of neighbour nodes of node i, lik is the length of edge i-k connecting nodes i and k, and wik is the length of the side of the Voronoi polygon perpendicular to edge i-k (see Figure 2.3).

(c) Write a MatLab program to implement the discrete system given by Eq. (2) and solve for the cross-sectional velocity field v(x, y). A triangular mesh for the cross section of the channel is shown in Figure 2.2. The P and T arrays describing the mesh can be downloaded from eClass website (MatLab data file channel_mesh.mat). Assume Re = 1, pz = 1. The boundary condition on the walls of the channel is specified as v = 0 (this is known as the no-slip flow condition). An outline of the MatLab program is given on the next page. Refer to Figure 2.4 for various parameters in the algorithm as well as the formula for calculating the circumcenter of a triangle.

(d) Display the solution v(x, y) on a 3D plot using the trimesh or trisurf function. Hand in a copy of your MatLab program.

492_Figure1.jpg

 

Outline of the Finite Volume Program

% ---- load mesh files: load channel_mesh
Ne = length(T); Npts = length(P);

% ---- construct matrix A and RHS vector b: A = zeros(Npts,Npts);
b = zeros(Npts,1);

for Δe = 1 : Ne, % scan through each triangle element Δe Compute coordinates of the circumcenter of triangle Δe
for qi = 1 : 3,

% local node numbers qj and qk (e.g., if qi = 2 then qj = 3, qk = 1) qj = mod(qi,3) + 1;
qk = mod(qj,3) + 1;

% Get global node numbers ni, nj, nk ni = T(Δe,qi);
nj = T(Δe,qj);
nk = T(Δe,qk);

% Compute contributions to matrix elements from triangle Δe: Compute Lij and Wije for edge i-j
A(ni,nj) = A(ni,nj) + Wije/Lij; A(ni,ni) = A(ni,ni) - Wije/Lij;

Compute Lik and Wike for edge i-k A(ni,nk) = A(ni,nk) + Wike/Lik; A(ni,ni) = A(ni,ni) - Wike/Lik;

% ---- Contribution to RHS vector b from triangle Δe: Compute area Aicb of triangle Δicb
Compute area Aiac of triangle Δiac b(ni) = b(ni) - Re*Pz*(Aicb + Aiac);
end
end

Reference no: EM131263820

Questions Cloud

Effective interest rate established by the market : Auerbach Inc. issued 4% bonds on October 1, 2016. The bonds have a maturity date of September 30, 2026 and a face value of $300 million. The bonds pay interest each March 31 and September 30, beginning March 31, 2017. The effective interest rate esta..
Significance of the division between content and non-content : Why have warrantless searches of passenger bags in the New York Subway have been allowed by the courts? Explain the significance of the division between "content" and "non-content" as it relates to federal electronic surveillance law.
What was the accountant referring to in his comment : The end of the year is approaching, and Maxine has begun tofocus on ways of minimizing her income tax liability. Several years ago she purchased an investment in Teal Limited Partnership, which is subject to the at-risk and the passive activity loss ..
Considering investing in annuity contract : Carla Vista Co. is considering investing in an annuity contract that will return $29,490 annually at the end of each year for 18 years. What amount should Carla Vista Co. pay for this investment if it earns an 4% return?
Write a matlab program to implement the discrete system : ECE - Assignment - Define the finite volume Vi of node i and indicate the appropriate location assignment of the magnetic field H in the mesh - Write a MatLab program to implement the discrete system given by Eq. (2) and solve for the cross-sectiona..
What code section addresses the research question : What Code section addresses the research question? Does your study of the relevant Code section help you to refine or add to the initial research question(s)?
Review the article war v justice terrorism cases enemy : Review the article "War v. Justice: Terrorism Cases, Enemy Combatants, and Political Justice in U.S. Courts" in this week's Learning Resources.
Discuss the role of qualitative research in helping marriott : Assume the respondents be segmented based on their evaluations of hotels on quality, price, service, amenities, comfort, and convenience? How many segments should there be? How would you prepare the data for inclusion into the marketing research r..
Which terms refers to the slight deviations in the tempo : Which one of the following terms refers to the slight deviations in the tempo? Public Enemy's citation of "Don't Worry Be Happy" is a/an _______ statement about the quality of contemporary black music.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd