User talk:Egm4313.s12.team8.jmurillo

Problem Statement
Use the MATLAB command 'ode45' to numerically integrate $$y''-3y'+2y=ln(1+x)$$ given the following initial conditions. Obtain the numerical solution for y(x) and plot y(x) in the same figure with yn(x).

Initial conditions: $$\displaystyle y(-0.75)=1, y'(-0.75)=0$$

Solution
Since the command ode45 can only handle first order differential equations, we have to convert our second order ODE into a series of first order ODEs.

We let x(1)=y and x(2)=y'. Therefore, x(1)'=x(2) x(2)'=log(1+x)-2x(1)+3x(2)

The MATLAB syntax for ode45 is as follows

[t,y]=ode45(@INPUTODE, tspan, initial conditions)

tspan=[-0.75 3] initial conditions= [1 0]

MATLAB Code
M-File: function dxdt=Problem4(t,x)

%Variables: x1=y, x2=y'

dxdt = zeros(2,1); dxdt(1) = x(2); dxdt(2) = log(1+t)-2*x(1)+3*x(2); Function call:

[t,y]=ode45(@Problem4,[-.75 3],[1;0])

=R2.6=

Problem Statement
Realize spring-dashpot-mass systems in series as shown in Fig. 1 below with the given characteristic equation and double real roots $$ \lambda = -3 $$. Find the values for the parameters k,c,m.

Given



The equation of motion of the spring-dashpot-mass system is as follows: $$\displaystyle m(y_k''+\frac{k}{c}y_k')+ky_k=f(t) $$

Double real roots: $$\displaystyle \lambda=-3 $$

Solution
Since we know the roots of the system we obtain the following characteristic equation:

$$\displaystyle (\lambda+3)^2=\lambda^2+6\lambda+9$$ (1) The equation of motion is: $$\displaystyle m(y_k''+\frac{k}{c}y_k')+ky_k=f(t) $$ (2)

We can get (1) and (2) to be in the same form by distributing the m in (2). $$\displaystyle my_k''+\frac{mk}{c}y_k'+ky_k=f(t) $$ (2a)

Now we can use coefficient matching to equate the coefficients of (1) and (2):

$$\displaystyle m=1$$ $$\displaystyle \frac{mk}{c}=6$$ $$\displaystyle k=9$$

Therefore: $$\displaystyle m=1,$$ $$\displaystyle c=\frac{3}{2},$$ $$\displaystyle k=9$$

R3.5 Plot
I made and uploaded a plot to the solution of R3.5 using the same program as all the other plots for this report. Use it if you'd like:

Egm4313.s12.team8.tclamb 03:43, 22 February 2012 (UTC)

R3.6
=R3.6=

Problem Statement
Solve the following differential equation with initial conditions y(0)=1 and y'(0)=0. Consider the following two L2-ODEs-CC: (1)$$\displaystyle y_{p1}''-3y_{p1}'+2y_{p1}=r_1(x)=4x^2$$ (2)$$\displaystyle y_{p2}''-3y_{p2}'+2y_{p2}=r_2(x)=-6x^5$$

The particular solution for (1) is $$\displaystyle y_{p2}=7+6x+2x^2$$. Find the particular solution for (2) and then obtain the solution y for the L2-ODE-CC. Compare the result with that obtained in R3.5.

Solution
Given: Initial conditions: y(0)=1 and y'(0)=0 $$\displaystyle y_{p1}=7+6x+2x^2$$

The characteristic equation of (2) is as follows: $$\displaystyle \lambda^2-3\lambda+2=0$$ $$\displaystyle \lambda=1,\lambda=2$$ Therefore the general solution of (2) is: $$\displaystyle y_h=c_1e^{1x}+c_2e^{2x}$$

The particular solution is given by the following: $$\displaystyle y_p=\sum_{j=0}^{5}c_jx^j$$ So by expanding the series the particular solution yp is: (3)$$\displaystyle y_p=c_0x^0+c_1x^1+c_2x^2+c_3x^3+c_4x^4+c_5x^5$$ (4)$$\displaystyle y_p'=c_1+2c_2x^1+3c_3x^2+4c_4x^3+5c_5x^4$$ (5)$$\displaystyle y_p''=2c_2+6c_3x^1+12c_4x^2+20c_5x^3$$

Then we put (3)-(5) into the form $$\displaystyle y_{p2}''-3y_{p2}'+2y_{p2}=-6x^5$$. $$\displaystyle (2c_2+6c_3x^1+12c_4x^2+20c_5x^3)-3(c_1+2c_2x^1+3c_3x^2+4c_4x^3+5c_5x^4)+2(c_0x^0+c_1x^1+c_2x^2+c_3x^3+c_4x^4+c_5x^5)=0+0x+0x^2+0x^3+0x^4-6x^5$$

By matching coefficients we obtain the following system of equations: $$\displaystyle 2c_0-3c_1+2c_2=0$$ $$\displaystyle 2c_1-6c_2+6c_3=0$$ $$\displaystyle 2c_2-9c_3+12c_4=0$$ $$\displaystyle 2c_3-12c_4+20c_5=0$$ $$\displaystyle 2c_4-15c_5=0$$ $$\displaystyle 2c_5=-6$$

Solving the system of equations we obtain c0= -708.75, c1= -697.5, c2= -337.5, c3= -105, c4= -22.5, c5= -3.

Therefore the particular solution for yp2 is as follows:

(6) $$\displaystyle y_{p2}=-708.75-697.5x^1-337.5x^2-105x^3-22.5x^4-3x^5$$

Now if we add the particular solution from yp1 we have the following: $$\displaystyle y_p=y_{p1}+y_{p2}$$ $$\displaystyle y_p=7+6x+2x^2-708.75-697.5x^1-337.5x^2-105x^3-22.5x^4-3x^5$$ $$\displaystyle y_p=-701.75-691.5x^1-335.5x^2-105x^3-22.5x^4-3x^5$$

To obtain the solution y we have to add yh+yp. $$\displaystyle y=y_h+y_p$$ $$\displaystyle y=[c_1e^{1x}+c_2e^{2x}]+[-701.75-691.5x^1-335.5x^2-105x^3-22.5x^4-3x^5]$$ Using the initial conditions we can solve for c1 and c2 $$\displaystyle y(0)=1=c_1+c_2-701.75$$ ===> $$\displaystyle c_1+c_2=702.75$$ $$\displaystyle y'(0)=0=c_1+2c_2-691.5$$ ===> $$\displaystyle c_1+2c_2=691.5$$

So c1=714 and c2=-11.25 and our solution is as follows:

$$\displaystyle y=714e^{1x}-11.25e^{2x}]-701.75-691.5x^1-335.5x^2-105x^3-22.5x^4-3x^5$$

As you can see, this solution is identical to the solution from R3.5 due to the principle of superposition.

R5.8
=R5.8=

Problem Statement
Find the integral of $$\displaystyle \int x^n \log(1+x)dx $$. First by using integration by parts and then with the help of the General Binomial Theorem for n=0,1:

$$\displaystyle (x+y)^n=\sum_{k=0}^{n}\begin{pmatrix}n\\k \end{pmatrix} x^{n-k}y^k $$ Where $$\displaystyle \begin{pmatrix}n\\k \end{pmatrix}=\frac{n!}{k!(n-k)!} $$

Solution
For n=0 $$\displaystyle \int x^n \log(1+x)dx = \int x^0 \log(1+x)dx= \int \log(1+x)dx$$

Using Integration By Parts: $$\displaystyle \int udv= uv-\int vdu$$ $$\displaystyle u=\log(1+x) \text{ and } du=\frac{1}{1+x}dx$$ $$\displaystyle dv=dx \text{ and } v=x$$

$$\displaystyle \int \log(1+x)dx= x\log(1+x)-\int \frac{x}{1+x}dx$$ $$\displaystyle \int \log(1+x)dx= x\log(1+x)-\int (1- \frac{1}{1+x})dx$$ $$\displaystyle \int \log(1+x)dx= x\log(1+x)-x+\log(1+x)+C$$ Group together like terms, factor the log(1+x), and simplify to get: $$\displaystyle \int \log(1+x)dx= (x+1)\log(1+x)-x+C$$ Using the General Binomial Theorem for n=0: $$\displaystyle (x+y)^0=\sum_{k=0}^{0}\begin{pmatrix}0\\k \end{pmatrix} x^{0-k}y^k=1 $$ That leaves us with the following integral: $$\displaystyle \int x^0 \log(1+x)dx = \int (1)\log(1+x)dx$$ Which has the solution: $$\displaystyle \int \log(1+x)dx= (x+1)\log(1+x)-x+C$$ For n=1 $$\displaystyle \int x^n \log(1+x)dx = \int x^1 \log(1+x)dx= \int x\log(1+x)dx$$

Using Integration By Parts: $$\displaystyle \int udv= uv-\int vdu$$ $$\displaystyle u=\log(1+x) \text{ and } du=\frac{1}{1+x}dx$$ $$\displaystyle dv=x \text{ and } v=\frac{1}{2}x^2$$

$$\displaystyle \int x\log(1+x)dx= \frac{1}{2}x^2 \log(1+x)-\int \frac{x^2}{2(1+x)}dx$$ $$\displaystyle \int x\log(1+x)dx= \frac{1}{2}x^2 \log(1+x)-\frac{1}{2}\int (x+\frac{1}{1+x}-1)dx$$ $$\displaystyle \int x\log(1+x)dx= \frac{1}{2}x^2 \log(1+x)-\frac{1}{2}[\frac{1}{2}x^2+\log(1+x)-x]+C$$ $$\displaystyle \int x\log(1+x)dx= \frac{1}{2}x^2 \log(1+x)-\frac{1}{2}[\frac{1}{2}x^2+\log(1+x)-x]+C$$ $$\displaystyle \int x\log(1+x)dx= \frac{1}{2}x^2 \log(1+x)-\frac{1}{4}x^2-\frac{1}{2}\log(1+x)+\frac{1}{2}x+C$$

Group together like terms, factor, and simplify to get: $$\displaystyle \int x\log(1+x)dx= \frac{1}{2}(x^2-1)\log(1+x)-\frac{1}{2}x(\frac{1}{2}x-1)+C$$

Using the General Binomial Theorem for a single variable with n=1: $$\displaystyle (x+1)^1=\sum_{k=0}^{1}\begin{pmatrix}1\\k \end{pmatrix} x^{k}=x $$ That leaves us with the following integral: $$\displaystyle \int x^1 \log(1+x)dx = \int (x)\log(1+x)dx$$ Which has the solution: $$\displaystyle \int x\log(1+x)dx= \frac{1}{2}(x^2-1)\log(1+x)-\frac{1}{2}x(\frac{1}{2}x-1)+C$$

= R6.2 =

Problem Statement
Find the Fourier Series Expansion for f(x) as follows:

1. Determine if f(x) is even, odd, or neither. Develop the Fourier Series Expansion of $$f(\bar{x})$$. Plot $$f(\bar{x})$$ and the truncated Fourier Series $$f_{n}(\bar{x})$$.

$$f_{n}(\bar{x}):= \bar{a}_0 + \sum_{k=1}^n[\bar{a}_k \cos k \omega \bar{x} + \bar{b}_k \sin k \omega \bar{x}]$$ for n = 0,1.

Observe the values of $$f_{n}(\bar{x})$$ at the points of discontinuities and the Gibbs phenomenon. Transform the variable so to obtain the Fourier Series Expansion for f(x).

2. Repeat 1 but using $$f_{n}(\tilde{x})$$ to obtain the Fourier Series Expansion of f(x). Compare results for n=0,1.

$$f(x)=x^2 ,(-1<x<1), p=2 $$ $$f(x)=1-\frac{x^2}{4} ,(-2<x<2), p=4$$



Part 1
To determine if f(x) is even or odd, substitute -x in for x. If f(x)=f(-x) then the function is even.

$$f(-x)=(-x)^2=x^2=f(x)$$ $$f(-x)=1-\frac{(-x)^2}{4}=1-\frac{x^2}{4}=f(x)$$

Therefore both functions are even.

According to the book, the Fourier Series for even functions reduces to a Fourier cosine series.

$$f(x)= a_0 + \sum_{n=1}^\infty[a_n \cos \frac{n \pi}{L} x]$$

$$a_0= \frac{1}{L} \int_{0}^{L} f(x)dx$$

$$a_n= \frac{2}{L} \int_{0}^{L} f(x)\cos \frac{n \pi x}{L} dx$$

From the Figure shown in the Problem Statement, $$f(\bar{x})$$ has a period of p=4. Therefore L=2, $$\omega = \frac{2 \pi}{p}$$.

$$a_0= \frac{1}{2} \int_{0}^{2} f(\bar{x})d \bar{x}$$

$$a_0= \frac{A}{2}$$

$$a_n= \frac{2}{2} \int_{0}^{2} f(\bar{x})\cos \frac{n \pi \bar{x}}{2} d \bar{x}$$

$$a_n= \frac{2A}{k \pi} \sin \frac{k \pi}{2}$$

$$f_k(\bar{x})= \frac{A}{2} + \sum_{k=1}^n[(\frac{2A}{k \pi} \sin \frac{k \pi}{2}) \cos \frac{k \pi}{2} \bar{x}]$$

For n=0:

$$f_0(\bar{x})= \frac{A}{2}$$

For n=1:

$$f_1(\bar{x})= \frac{A}{2} + \frac{2A}{\pi} \cos \frac{\pi}{2} \bar{x}$$

$$\bar{x} = x - 1.25$$

$$f_k(x)= \frac{A}{2} + \frac{A}{\pi}\sin (\frac{\pi (x-1.25)}{2})$$

Let A=1



Part 2
From the Figure shown in the Problem Statement, $$f(\tilde{x})$$ has a period of p=4. Therefore L=2, $$\omega = \frac{2 \pi}{p}$$.

$$a_0= \frac{1}{2L} \int_{0}^{2L} f(\tilde{x})d \tilde{x}$$

$$a_0= \frac{1}{4} \int_{0}^{4} f(\tilde{x})d \tilde{x}$$

$$a_0= \frac{A}{2}$$

$$a_n= \frac{1}{L} \int_{0}^{2L} f(\tilde{x})\cos (n \omega \tilde{x}) d \tilde{x}$$

$$a_n= \frac{1}{2} \int_{0}^{4} f(\tilde{x})\cos (\frac{n \pi \tilde{x}}{2}) d \tilde{x}$$

$$a_n= \frac{1}{2} f(\tilde{x})\cos (\frac{n \pi \tilde{x}}{2}) \mid _0^4 = \frac{A}{n \pi} \sin (\pi k)$$

$$b_n= \frac{1}{L} \int_{0}^{2L} f(\tilde{x})\sin (n \omega \tilde{x}) d \tilde{x}$$

$$b_n= \frac{1}{2} \int_{0}^{4} f(\tilde{x})\sin (\frac{n \pi \tilde{x}}{2}) d \tilde{x}$$

$$b_n= \frac{1}{2} f(\tilde{x})\sin (\frac{n \pi \tilde{x}}{2}) \mid _0^4 = \frac{A}{n \pi}(1 - \cos (\pi k))$$

Since $$f(\tilde{x})$$ is an odd function the Fourier series reduces to a Fourier sine series.

$$f_k(\tilde{x})= \frac{A}{2} + \sum_{k=1}^n ([\frac{A}{k \pi}(1 - \cos (\pi k)] \sin [\frac{k \pi \tilde{x}}{2}])$$

For n=0:

$$f_0(\tilde{x})= \frac{A}{2}$$

For n=1:

$$f_1(\tilde{x})= \frac{A}{2} + \frac{A}{\pi}\sin (\frac{\pi \tilde{x}}{2})$$

$$\tilde{x} = x - 0.25$$

$$f_1(x)= \frac{A}{2} + \frac{A}{\pi}\sin (\frac{\pi (x-.25)}{2})$$

Let A=1



= R7.5 =

Problem Statement
Part 1: Find the exact integration of $$ \int_{0}^{p} \sin (j \omega x) \sin (k \omega x) dx$$ Where $$j \not\equiv k$$ and $$ j,k = 1,2,... $$

Given: $$ p=2 \pi, j=2, k=3$$

Part 2: Confirm the result with MATLAB's trapz command for the trapezoidal rule.

Part 1
Substituting in the provided data gives us:

$$ \int_{0}^{2 \pi} \sin (2 \omega x) \sin (3 \omega x) dx$$

Apply the following trigonometric identity:

$$ \sin(a) \sin(b)=\frac{1}{2} ( \cos(a-b)- \cos(a+b))$$ Where $$ a=2 \omega x, b=3 \omega x$$

The integral becomes:

$$ \int_{0}^{2 \pi} \frac{1}{2} ( \cos(\omega x)- \cos(5 \omega x)) dx$$

$$ \frac{1}{2 \omega} \int_{0}^{2 \pi} \cos(u)du- \frac{1}{10 \omega} \int_{0}^{2 \pi} \cos(v)dv$$

Where $$ u= \omega x, du= \omega dx, v=5 \omega x, dv=5 \omega dx$$

The finite integral becomes:

$$[ \frac{1}{2 \omega} \sin(\omega x)- \frac{1}{10 \omega} \sin(5 \omega x)]_{0}^{2 \pi}$$

We know from the book that $$\omega = \frac{2 \pi}{p}$$ Therefore $$\omega = \frac{2 \pi}{2 \pi} = 1$$

So our finite integral is now:

$$[ \frac{1}{2} \sin(x)- \frac{1}{10} \sin(5x)]_{0}^{2 \pi}=0$$

Part 2
The following is MATLAB code used to determine the definite integral from 0 to $$2 \pi$$ using a step of 0.05:

>> x=0:0.05:2*pi; y=sin(2*x).*sin(3*x); z=trapz(x,y)

z = -1.5564e-004

As we decrease the size of the step and increase the accuracy the result continues to get smaller: >> x=0:0.01:2*pi; y=sin(2*x).*sin(3*x); z=trapz(x,y)

z = -3.8317e-007 >> x=0:0.001:2*pi; y=sin(2*x).*sin(3*x); z=trapz(x,y)

z = -1.9803e-010

The values are essentially zero and therefore, they confirm the result from integration.

Copyright problems on photos
Hello. There is a problem with one or more files you have uploaded. Every file you upload must have a clear statement of the copyright position. If you took the photos yourself, add PD-self if you are placing it unreservedly in the public domain. If you wish to retain minimal rights, add Cc-by-sa-3.0. If you did not take the photo, please add an explanation of why it can be hosted here. I am afraid that if you do not do this, the file will have to be deleted; there is a strict site policy on this. Let me know if you have any problems.--Green Giant (discuss • contribs) 23:23, 20 May 2020 (UTC)

Files Missing License Information
Thank you for uploading files to Wikiversity. See Media for copyright and license requirements for Wikiversity files. All files must have copyright and/or license information added to the file.

Instructions for adding copyright and/or license information are available at License tags. Files must be updated within seven days or they may be removed without further notice. See Requests For Deletion for more information.

The following files are missing copyright and/or license information:
 * File:R.2.6.PNG

MaintenanceBot (discuss • contribs) 03:43, 11 November 2013 (UTC)