Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
ISE212 Engineering Computing: MATLAB Homework #7 Due: Monday 5/11/2015 Spring_2015 Upload your HW7 assignments to the TA by going to Content in Blackboard: 1. Create a function that computes the area A and circumference C of a circle, given its radius as an input argument. (Name your m-file>>> circle.m). Ans= 2. Write an executable script file (m-file) that takes no input and solves then simplifies the following nonlinear first-order differential equation: d y /d t = 4 – y 2 >>> y(0) = 1 (Name your m-file>>> desolved15.m). Ans= 3. Write an executable script file (m-file) that takes no input and uses the dsolve function to solve the first-order ordinary differential equation (ODE) shown below and then utilizes the ezplot function combined with the axis command to plot the solution between x values of 0 to 5 and y values of 0 to 1. (Note that the expression is automatically placed at the top of the plot and that the axis label for the independent variable is automatically placed). (Name your m-file>>> wavesagain15.m). dy/dt + 20y = 10 + 4sin(4t) >>> y(0) = 0 Ans: 4. Simple harmonic motion, or oscillation, is exhibited by structures that have elastic restoring forces. (Any particle undergoing small oscillations about a point of stable equilibrium executes simple harmonic motion). There are many situations in nature illustrating this behavior. For example, such systems can be modeled by the spring-mass schematic shown below. The body rests on a horizontal frictionless surface. If the body is displaced from equilibrium and released, the only horizontal force acting on the mass m is the restoring force of the spring FS = -kx, where x is the displacement from the equilibrium position and k is the considered the stiffness of the spring which also represents a constant spring property in this model. The minus sign indicates that the direction of the spring force and of the displacement is always opposite. Newton's law states F = ma or for this illustration -kx = ma which we can rewrite and solve for acceleration of the mass as a = -(k/m)x. If x = x(t) denotes the displacement of the mass m from its equilibrium position as a function of time, t, the equation of motion for this system then becomes: d2x/dt2 + (k/m)x = 0 or md2x/dt2 + kx = 0 When a body is subject to an elastic restoring force only, the mechanical energy of the system remains constant and the oscillatory motion persists indefinitely with undiminished amplitude. This ideal situation is not ordinarily achieved, because of the presence of dissipative forces. For, in addition to the elastic restoring force, there is always a force which acts to oppose the motion. For example, the kinetic force of friction damps the motion. Such motion is called damped harmonic motion as seen in the illustration below. The resistive force FR = -cv where v is the body's velocity and c is a resistance constant and the equation of motion for the damped system then becomes: md2x/dt2 + cdx/dt + kx = 0 Write an executable script file (m-file) that takes no input and uses the dsolve function to find and plot (utilizing ezplot) the solution for t = 0 to 10 for the case where a spring-mass system is governed by the following second-order differential damped oscillator equation with stated initial conditions: 2d2x/dt2 + dx/dt + 8x = 0 >>> x(0) = 2, Dx(0) = 0 (Name your m-file>>> damper15.m). Plot Title: Position of Mass (Note: Units have been removed for your convenience). 5. Differential equations, in general, are much harder to solve than algebraic equations. Therefore, is it possible to transform differential equations into algebraic equations? Luckily it turns out that there is! Such transforms, in general, involve multiplying each term in the differential equation by a suitable function called the kernel and integrating each term over the domain of the differential equation with respect to the independent variable. The result is an equation that does not involve any derivatives of the independent variable. The unknown function is then determined by algebraically solving for the transformed function and applying the inverse transformation. All of these transformations involve integrations and each transformation has certain limitations (conditions) associated with it, and each is applicable to certain types of engineering problems. For this homework problem, we will employ the use of a Laplace Transform to solve a differential equation that appears in nuclear physics. Laplace transforms are particularly suited to engineering problems whose independent variable varies from zero to infinity, such as dynamic problems that deal with time. Here, we will use the Laplace transform to solve a linear differential equation with constant coefficients and systems of equations. The Laplace transform is simply an integral transform with integration limits 0 and ∞ and the kernel e-st. It is denoted by L, and the transform function f(t) is defined as: L{f(t)} = ∫0∞ e-stf(t) dt In nuclear physics, the following fundamental relationship governs radioactive decay: the number of radioactive atoms x in a sample of a radioactive isotope decays at a rate proportional to x. (Radioactive decay is the process by which an atomic nucleus of an unstable atom loses energy by emitting ionizing particles). This leads to the first order linear differential equation: dx/dt = -ax where a is the decay constant for a given type of radioactive isotope. The Laplace transform can be used to solve this differential equation. Rearranging the equation to one side, we have: dx/dt + ax = 0 Write an executable script file (m-file) that takes no input and uses the laplace function to solve and plot (utilizing ezplot) the solution for the first order linear differential equation listed above. Plot for time units t = 0 to 500 with a Delay Constant = 0.01 and a starting amount of atoms x(0) = 250. (Name your m-file >>> laplacehwn15.m). Ans: 6. The simple RL circuit shown here has a resistor and an inductor connected in series. A constant voltage V (battery) is applied when the switch is closed. The (variable) voltage across the resistor is given by: VR = i*R. The (variable) voltage across the inductor is given by: VL = L di/dt. Kirchhoff's voltage law says that the directed sum of the voltages around a circuit must be zero (Vt = VR + VL). This results in the following differential equation: R*i + L di/dt = V Rearranging: di/dt = -R/L*i + V/L Assume that the switch is open until it is closed at a time t = 0, and then remains permanently closed producing a “step response” type voltage input. The current, i, begins to flow through the circuit but does not rise rapidly to its maximum value as determined by the ratio of V/R (Ohms Law). This limiting factor is due to the presence of the self-induced emf within the inductor as a result of the growth of magnetic flux, (Lenz’s Law). After a time the voltage source neutralizes the effect of the self-induced emf, the current flow becomes constant and the induced current and field are reduced to zero. Thus, once the switch is closed, the current in the circuit is not constant. Instead, it will build up from zero to some steady state. The voltage drop across the resistor depends upon the current, i, while the voltage drop across the inductor depends upon the rate of change of the current, di/dt. When the current is equal to zero, (i = 0) at time t = 0, the above expression, which is also a first order differential equation (ODE), can be solved to provide an equation that finds the value of the current at any instant of time t. Write an executable script file (m-file) that takes no input and uses the dsolve function to solve the first-order ordinary differential equation (ODE) shown above for the value of the current i at any instant of time t and then utilizes the ezplot function combined with the axis command to plot the solution for i between t values of 0 to 5 and i values of 0 to 1. The color of the curve should be magenta. For your plot, the voltage V, resistor R, and inductor L will be equal to one (V=R=L=1). (Note: Units have been removed for your convenience). (Name your m-file>>> current15.m). With…. Title: RL Circuit xlabel: time ylabel: current Ans: THE END