text:
# Differential Heat Equations Question

• Oct 18th 2011, 01:03 PM
AlanC877
Differential Heat Equations Question
Can anyone help with the following maths question:

Show that the function:

u(t,x)=f(y), where y=((2x)/sqrt(t))

is a solution of the heat equation:

partialderivative(u) / partialderivative(t) = partialderivative(u)^2 / partialderivative(x)^2

(where the partialderivative(u or x)^2 is the second derivative)

provided that f(y) satisfies 8f''(y) + yf'(y)=0

• Oct 18th 2011, 01:27 PM
TheEmptySet
Re: Differential Heat Equations Question
Quote:

Originally Posted by AlanC877
Can anyone help with the following maths question:

Show that the function:

u(t,x)=f(y), where y=((2x)/sqrt(t))

is a solution of the heat equation:

partialderivative(u) / partialderivative(t) = partialderivative(u)^2 / partialderivative(x)^2

(where the partialderivative(u or x)^2 is the second derivative)

provided that f(y) satisfies 8f''(y) + yf'(y)=0

You just need to use the chain rule

$\frac{\partial u}{\partial t} =f'(y) \cdot \frac{\partial }{\partial t}\left(\frac{2x}{\sqrt{t}} \right) =-\frac{x}{t^{-\frac{3}{2}}}f'(y)=-\frac{y}{2t}f'(y)$

Now see if you can do the same thing with the x dervaitves.
• Oct 18th 2011, 02:35 PM
AlanC877
Re: Differential Heat Equations Question
Quote:

Originally Posted by TheEmptySet
You just need to use the chain rule

$\frac{\partial u}{\partial t} =f'(y) \cdot \frac{\partial }{\partial t}\left(\frac{2x}{\sqrt{t}} \right) =-\frac{x}{t^{-\frac{3}{2}}}f'(y)=-\frac{y}{2t}f'(y)$

Now see if you can do the same thing with the x dervaitves.

Thanks for the help.

All my ds in the following are partials.

I got that du/dt = -f'(y)xt^(-3/2)

I then found that du/dx = 2f'(y)t^(-1/2)

From this I said that d^2u/dx^2 = 2f''(y)t^(-1/2)

I then re-arranged 8f''(y) + yf'(y) = 0 to f''(y) = (-yf'(y))/8

Substituting into d^2u/dx^2 gives (-yf'(y)t^(-1/2))/4

Letting y = 2xt^-(1/2) means d^2u/dx^2 = (-f'(y)xt^(-1))/2

Guessing I'm doing something stupid somewhere?!
• Oct 18th 2011, 03:04 PM
TheEmptySet
Re: Differential Heat Equations Question
Quote:

Originally Posted by AlanC877
Thanks for the help.

All my ds in the following are partials.

I got that du/dt = -f'(y)xt^(-3/2)

I then found that du/dx = 2f'(y)t^(-1/2)

From this I said that d^2u/dx^2 = 2f''(y)t^(-1/2)

I then re-arranged 8f''(y) + yf'(y) = 0 to f''(y) = (-yf'(y))/8

Substituting into d^2u/dx^2 gives (-yf'(y)t^(-1/2))/4

Letting y = 2xt^-(1/2) means d^2u/dx^2 = (-f'(y)xt^(-1))/2

Guessing I'm doing something stupid somewhere?!

I agree that

$\frac {\partial u}{\partial x}=f'(y)\cdot \left( \frac{2}{\sqrt{t}}\right)=\frac{2}{\sqrt{t}}f'(y)$

but you have forgotten to use the chain rule when you take the 2nd dervaitive. You should get

$\frac{\partial^2 u}{\partial x^2}=\frac{2}{\sqrt{t}}f''(y)\cdot \left( \frac{2}{\sqrt{t}}\right)=\frac{4}{t}f''(y)$
• Oct 18th 2011, 03:38 PM
AlanC877
Re: Differential Heat Equations Question
Quote:

Originally Posted by TheEmptySet
I agree that

$\frac {\partial u}{\partial x}=f'(y)\cdot \left( \frac{2}{\sqrt{t}}\right)=\frac{2}{\sqrt{t}}f'(y)$

but you have forgotten to use the chain rule when you take the 2nd dervaitive. You should get

$\frac{\partial^2 u}{\partial x^2}=\frac{2}{\sqrt{t}}f''(y)\cdot \left( \frac{2}{\sqrt{t}}\right)=\frac{4}{t}f''(y)$

Ah yes, stupid me :P Thanks a million!


text:
Select Page

Number of zeros at the end of a
Problem Type: Number of zeros at the end of p!
To solve such type of problems we see only pair of 2 x5 in p! .
Because if a number is divisible by 10 then it will have 0 in the end and 10= 2×5 so finding number of zeros is equivalent to finding maximum power of 10 in p! which is same as counting number of pairs of 2 and 5.
Lets take an example for this

Example
Find the number of zeros at the end of 45!
Solution:
Zero mainly comes from the combination of (5x 2) or by the presence of 10, and the number of zeros depends upon the number of times 10 is involved.So we check power of 2 and 5 first
Maximum power of 2 in 45!

$\displaystyle \begin{array}{l}\left[ \frac{45}{2} \right]+\left[ \frac{45}{{{2}^{2}}} \right]+\left[ \frac{45}{{{2}^{3}}} \right]+\left[ \frac{45}{{{2}^{4}}} \right]+\left[ \frac{45}{{{2}^{5}}} \right]+…..\\=\text{ }22\text{ }+\text{ }11\text{ }+\text{ }5\text{ }+\text{ }2\text{ }+1=\text{ }41\\Maximum\text{ }power\text{ }of\text{ }5\text{ }in\text{ }45!\\\left[ \frac{45}{5} \right]+\left[ \frac{45}{{{5}^{2}}} \right]+\left[ \frac{45}{{{5}^{3}}} \right]+…..\\\begin{array}{*{35}{l}} =\text{ }9+\text{ }1 \\ =\text{ }10 \\ \end{array}\\\end{array}$

So in 45! Number of 2’s are 41
And the number of 5’s is 10
So maximum pair of 2 and 5 that can be made are 10 so the number of zeros at the end of the 45! is 10.

Example
Find the number of zeros in 500!
Solution: Zero mainly comes from the combination of (5x 2) or by the presence of 10, and the number of zeros depends upon the number of times 10 is involved.So we check power of 2 and 5 first
Maximum power of 2 in 500!

$\displaystyle \begin{array}{l}\left[ \frac{500}{2} \right]+\left[ \frac{500}{{{2}^{2}}} \right]+\left[ \frac{500}{{{2}^{3}}} \right]+\left[ \frac{500}{{{2}^{4}}} \right]+\left[ \frac{500}{{{2}^{5}}} \right]+\left[ \frac{500}{{{2}^{6}}} \right]+\left[ \frac{500}{{{2}^{7}}} \right]+\left[ \frac{500}{{{2}^{8}}} \right]…\\\begin{array}{*{35}{l}} =\text{ }250\text{ }+\text{ }125\text{ }+\text{ }62\text{ }+\text{ }31\text{ }+15\text{ }+7\text{ }+\text{ }3\text{ }+\text{ }1 \\ =\text{ }494 \\ \end{array}\\Maximum\text{ }power\text{ }of~5\text{ }in\text{ }500!\\\left[ \frac{500}{5} \right]+\left[ \frac{500}{{{5}^{2}}} \right]+\left[ \frac{500}{{{5}^{3}}} \right]+\left[ \frac{500}{{{5}^{4}}} \right]+…..\\\begin{array}{*{35}{l}} =\text{ }100\text{ }+\text{ }20\text{ }+\text{ }4 \\ =\text{ }124 \\ \end{array}\end{array}$
Number of 5’s in 500! are  124
And the numbers of 2’s is  494
So the maximum possible pairs of 2 and 5 that can be made are 4 so the number of zeros in 500! are 124 .So the number of zeros in the end of the 500! are 124.

Example
What will be the number of zeros in (24!)3! ?
Now first calculate the number of zeros in 24!
Maximum power of 2 in 24!
$\displaystyle \begin{array}{l}\left[ \frac{24}{2} \right]+\left[ \frac{24}{{{2}^{2}}} \right]+\left[ \frac{24}{{{2}^{3}}} \right]+\left[ \frac{24}{{{2}^{4}}} \right]+…..\\\begin{array}{*{35}{l}} =\text{ }12\text{ }+\text{ }6\text{ }+\text{ }3\text{ }+\text{ }1 \\ =\text{ }22 \\ \end{array}\\Maximum\text{ }power\text{ }of\text{ }5\text{ }in\text{ }24!\\\left[ \frac{24}{5} \right]+\left[ \frac{24}{{{5}^{2}}} \right]+…..\\\begin{array}{*{35}{l}} =\text{ }4\text{ }+\text{ }0 \\ =\text{ }4 \\ \end{array}\end{array}$
Number of 5’s in 24! is 4
And the numbers of 2’s are more than 4
So the maximum possible pairs of 2 and 5 that can be made are 4 so the number of zeros in 24! are 4
Now 24! also have power of 3! i.e. 6 . So the whole expression would have 4 x 6 = 24 zeros in the end.

format: plain


text:
SFEMaNS  version 4.1 (work in progress) Reference documentation for SFEMaNS
Test 2: Navier-Stokes periodic

Introduction

In this example, we check the correctness of SFEMaNS for a hydrodynamic problem involving periodic and Dirichlet boundary conditions.

We solve the Navier-Stokes equations:

\begin{align*} \partial_t\bu+\left(\ROT\bu\right)\CROSS\bu - \frac{1}{\Re}\LAP \bu +\GRAD p &=\bef, \\ \DIV \bu &= 0, \\ \bu_{|\{z=0\}} &= \bu_{|\{z=1\}} , \\ p_{|\{z=0\}} &= p_{|\{z=1\}} , \\ \bu_{|\Gamma} &= \bu_{\text{bdy}} , \\ \bu_{|t=0} &= \bu_0, \\ p_{|t=0} &= p_0, \end{align*}

in the domain $$\Omega= \{ (r,\theta,z) \in {R}^3 : (r,\theta,z) \in [0,1/2] \times [0,2\pi) \times [0,1]\}$$ with $$\Gamma= \partial \Omega\setminus\{ \{z=0\} \cup \{z=1\} \}$$. The data are the source term $$\bef$$, the boundary data $$\bu_{\text{bdy}}$$, the initial data $$\bu_0$$ and $$p_0$$. The parameter $$\Re$$ is the kinetic Reynolds number.

Manufactured solutions

We approximate the following analytical solutions:

\begin{align*} u_r(r,\theta,z,t) &= -r^2 \left( 1-2\pi r \sin(2\pi z) \right) \sin(\theta) \cos(t), \\ u_{\theta}(r,\theta,z,t) &= -3 r^2 \cos(\theta) \cos(t), \\ u_z(r,\theta,z,t) &= r^2 \left( 4\cos(2\pi z) +1 \right) \sin(\theta) \cos(t), \\ p(r,\theta,z,t) &= r^2 \cos(2\pi z)\cos(\theta)\cos(t), \end{align*}

where the source term $$\bef$$ and the boundary data $$\bu_{\text{bdy}}$$ are computed accordingly.

The finite element mesh used for this test is named Mesh_10_form.FEM and has a mesh size of $$0.1$$ for the P1 approximation. You can generate this mesh with the files in the following directory: ($SFEMaNS_MESH_GEN_DIR)/EXAMPLES/EXAMPLES_MANUFACTURED_SOLUTIONS/Mesh_10_form. The following image shows the mesh for P1 finite elements.  Finite element mesh (P1). Information on the file condlim.f90 The initial conditions, boundary conditions and the forcing term $$\textbf{f}$$ in the Navier-Stokes equations are set in the file condlim_test_2.f90. Here is a description of the subroutines and functions of interest. 1. The subroutine init_velocity_pressure_ initializes the velocity field and the pressure at the time $$-dt$$ and $$0$$ with $$dt$$ being the time step. It is done by using the functions vv_exact and pp_exact as follows: time = 0.d0 DO i= 1, SIZE(list_mode) mode = list_mode(i) DO j = 1, 6 !===velocity un_m1(:,j,i) = vv_exact(j,mesh_f%rr,mode,time-dt) un (:,j,i) = vv_exact(j,mesh_f%rr,mode,time) END DO DO j = 1, 2 !===pressure pn_m2(:) = pp_exact(j,mesh_c%rr,mode,time-2*dt) pn_m1 (:,j,i) = pp_exact(j,mesh_c%rr,mode,time-dt) pn (:,j,i) = pp_exact(j,mesh_c%rr,mode,time) phin_m1(:,j,i) = pn_m1(:,j,i) - pn_m2(:) phin (:,j,i) = Pn (:,j,i) - pn_m1(:,j,i) ENDDO ENDDO 2. The function vv_exact contains the analytical velocity field. It is used to initialize the velocity field and to impose Dirichlet boundary conditions on the velocity field. 1. First we define $$2\pi$$ as follows: k = 2*ACOS(-1.d0) 2. We define the radial and vertical coordinates r, z. r = rr(1,:) z = rr(2,:) 3. If the Fourier mode m is not equal to 1, the velocity field is set to zero. IF (m/=1) THEN vv = 0.d0 RETURN END IF 4. For the Fourier mode $$m=1$$, we define the velocity field depending of its TYPE (1 and 2 for the component radial cosine and sine, 3 and 4 for the component azimuthal cosine and sine, 5 and 6 for the component vertical cosine and sine) as follows: IF (TYPE == 1) THEN vv(:) = 0.d0 ELSEIF (TYPE == 2 .AND. m /= 0) THEN vv(:) = -r**2*(1-k*r*SIN(k*z)) ELSEIF (TYPE == 3) THEN vv(:) = -3*r**2 ELSEIF (TYPE == 4 .AND. m /= 0) THEN vv(:) = 0.d0 ELSEIF (TYPE == 5) THEN vv(:) = 0.d0 ELSEIF (TYPE == 6 .AND. m /= 0) THEN vv(:) = r**2*(4*COS(k*z)+1) ENDIF vv(:) = vv(:) * COS(t) RETURN where $$t$$ is the time. The reader can note that the condition "m /= 0" is not needed since we already set vv to zero when we are not dealing with the Fourier mode $$m=1$$. 3. The function pp_exact contains the analytical pressure. It is used to initialize the pressure. 1. First we define the real $$2\pi$$. k = 2*ACOS(-1.d0) 2. If the Fourier mode m, is not equal to 1, the pressure is set to zero. IF (m/=1) THEN vv = 0.d0 RETURN END IF 3. For the Fourier mode $$m=1$$, the pressure only depends of the TYPE 1 (cosine) so we write: IF (TYPE==1) THEN vv(:)= rr(1,:)**2*COS(k*rr(2,:))*COS(t) ELSE vv(:) = 0.d0 END IF RETURN where $$t$$ is the time. Thus the coefficient in sine of the presure for the Fourier mode $$1$$ is zero. 4. The function source_in_NS_momentum computes the source term $$\bef$$ of the Navier-Stokes equations. All the other subroutines present in the file condlim_test_2.f90 are not used in this test. We refer to the section Fortran file condlim.f90 for a description of all the subroutines of the condlim file. Setting in the data file We describe the data file of this test. It is called debug_data_test_2 and can be found in the following directory: ($SFEMaNS_DIR)/MHD_DATA_TEST_CONV_PETSC.

1. We use a formatted mesh by setting:
===Is mesh file formatted (true/false)?
.t.
2. The path and the name of the mesh are specified with the two following lines:
===Directory and name of mesh file
'.' 'Mesh_10_form.FEM'
where '.' refers to the directory where the data file is, meaning ($SFEMaNS_DIR)/MHD_DATA_TEST_CONV_PETSC. 3. We use two processors in the meridian section. It means the finite element mesh is subdivised in two. ===Number of processors in meridian section 2 4. We solve the problem for $$3$$ Fourier modes. ===Number of Fourier modes 3 5. We use $$3$$ processors in Fourier space. ===Number of processors in Fourier space 3 It means that each processors is solving the problem for $$3/3=1$$ Fourier modes. 6. We select specific Fourier modes to solve by setting: ===Select Fourier modes? (true/false) .t. 7. We give the list of the Fourier modes to solve. ===List of Fourier modes (if select_mode=.TRUE.) 0 1 2 We note that setting select Fourier modes to false would give the same result as we select the first three Fourier modes. 8. We approximate the Navier-Stokes equations by setting: ===Problem type: (nst, mxw, mhd, fhd) 'nst' 9. We do not restart the computations from previous results. ===Restart on velocity (true/false) .f. It means the computation starts from the time $$t=0$$. 10. We use a time step of $$0.01$$ and solve the problem over $$100$$ time iterations. ===Time step and number of time iterations .01d0, 100 11. We set periodic boundary condition. 1. We set the number of pair of boundaries that has to be periodic. ===How many pieces of periodic boundary? 1 2. We give the label of the boundaries and the vector that lead to the first boundary to the second one. ===Indices of periodic boundaries and corresponding vectors 4 2 .0d0 1.d0 We note that we need as much as lines as the number of pairs of boundaries with periodic condition. 12. We set the number of domains and their label, see the files associated to the generation of the mesh, where the code approximates the Navier-Stokes equations. ===Number of subdomains in Navier-Stokes mesh 1 ===List of subdomains for Navier-Stokes mesh 1 13. We set the number of boundaries with Dirichlet conditions on the velocity field and give their respective labels. ===How many boundary pieces for full Dirichlet BCs on velocity? 1 ===List of boundary pieces for full Dirichlet BCs on velocity 5 14. We set the kinetic Reynolds number $$\Re$$. ===Reynolds number 1.d0 15. We do not apply penalty on the divergence of the velocity field. ===Coefficient for penalty of divergence in NS? 0.d0 We note $$0$$ is the defaut value so this two lines are not required. 16. We give information on how to solve the matrix associated to the time marching of the velocity. 1. ===Maximum number of iterations for velocity solver 100 2. ===Relative tolerance for velocity solver 1.d-6 ===Absolute tolerance for velocity solver 1.d-10 3. ===Solver type for velocity (FGMRES, CG, ...) GMRES ===Preconditionner type for velocity solver (HYPRE, JACOBI, MUMPS...) MUMPS 17. We give information on how to solve the matrix associated to the time marching of the pressure. 1. ===Maximum number of iterations for pressure solver 100 2. ===Relative tolerance for pressure solver 1.d-6 ===Absolute tolerance for pressure solver 1.d-10 3. ===Solver type for pressure (FGMRES, CG, ...) GMRES ===Preconditionner type for pressure solver (HYPRE, JACOBI, MUMPS...) MUMPS 18. We give information on how to solve the mass matrix. 1. ===Maximum number of iterations for mass matrix solver 100 2. ===Relative tolerance for mass matrix solver 1.d-6 ===Absolute tolerance for mass matrix solver 1.d-10 3. ===Solver type for mass matrix (FGMRES, CG, ...) CG ===Preconditionner type for mass matrix solver (HYPRE, JACOBI, MUMPS...) MUMPS Outputs and value of reference The outputs of this test are computed with the file post_processing_debug.f90 that can be found in the following directory: ($SFEMaNS_DIR)/MHD_DATA_TEST_CONV_PETSC.

To check the well behavior of the code, we compute four quantities:

1. The L2 norm of the error on the velocity field.
2. The H1 norm of the error on the velocity field.
3. The L2 norm of the divergence of the velocity field.
4. The L2 norm of the error on the pressure.

These quantities are computed at the final time $$t=1$$. They are compared to reference values to attest of the correctness of the code. These values of reference are in the last lines of the file debug_data_test_2 in the directory(\$SFEMaNS_DIR)/MHD_DATA_TEST_CONV_PETSC. They are equal to:

============================================
(Mesh_10_form.FEM)
===Reference results
9.010064775995388E-005 L2 error on velocity
4.268199030547359E-003 H1 error on velocity
2.016626738178190E-002 L2 norm of divergence
2.993344602551886E-003 L2 error on pressure

To conclude this test, we show the profile of the approximated pressure and velocity magnitude at the final time. These figures are done in the plane $$y=0$$ which is the union of the half plane $$\theta=0$$ and $$\theta=\pi$$.

 Pressure in the plane plane y=0. Velocity magnitude in the plane plane y=0.


text:
A quadrilateral is a plane figure made with four line segments closing in a space. The easiest, fastest way to learn about quadrilaterals is to build one yourself.

Find four straight objects to use as line segments (four = quadr; side = lateral). Anything will do, and they do not have to be the same length: straws, rulers, dowels, pens -- whatever you have handy. If you connect the four linear objects at their eight ends, you have a quadrilateral, a four-sided polygon.

Usually, the four sides do not cross each other, making a simple quadrilateral. You could arrange your quadrilateral so line segments cross each other: you have a complex quadrilateral.

Quadrilaterals appear in four different classifications:

1. Convex -- Each interior angle is less than 180° and the two diagonals are inside the closed space of the quadrilateral
2. Concave -- One interior angle is greater than 180° and one diagonal lies outside the shape
3. Simple -- The quadrilateral does not cross its sides (it is not self-intersecting)
4. Complex -- The quadrilateral has self-intersecting sides

A quadrilateral has two identifying properties:

1. Four straight sides
2. Four vertices (angles where sides meet at their endpoints)

### How many sides does a quadrilateral have?

A quadrilateral has 4 straight sides. Sides and angles can be equal or unequal. When two or four sides are equal, you get special types of quadrilaterals such as trapezoids and rectangles.

All the other four-sided plane figures derive from the quadrilateral:

• Rhombus
• Square
• Rectangle
• Parallelogram
• Kite
• Dart
• Trapezoid

## How To Draw a Quadrilateral

Use a straightedge or ruler to draw a quadrilateral. Draw four line segments so each endpoint touches one other endpoint. Whether you have drawn a simple or complex, convex or concave quadrilateral, you did it correctly!

Draw a simple quadrilateral. Do not let any line segments cross each other. Your simple quadrilateral could be either concave or convex. If two sides point inward, you drew a concave quadrilateral.

Now draw a quadrilateral where two non-adjacent line segments cross each other. You have drawn a complex quadrilateral.

Each vertex is given a letter, moving in either direction (clockwise or counterclockwise) to the next vertex, like quadrilateral $ABCD$. Each side of the quadrilateral is then identified by its line segment (). Each interior angle uses its vertex letter ().

Diagonals can be constructed by connecting opposite (non-adjacent) vertices: .

### How To Name a Quadrilateral

A simple quadrilateral is also called a quadrangle or a tetragon. A simple quadrilateral will be symmetrical if it has at least one pair of congruent sides.

• For a simple quadrilateral, interior angles of the four vertices add to 360°
• For a convex quadrilateral, each interior angle will be less than 180°
• For a concave quadrilateral, one interior angle will be greater than 180°
• For a complex quadrilateral, interior angles add to 720° because two of the interior angles are reflex angles, each greater than 180° but less than 360°

All convex quadrilaterals have diagonals (line segments connecting non-adjacent vertices) inside their enclosed space.

All concave quadrilaterals have one of their diagonals outside their enclosed space. All complex quadrilaterals have both diagonals outside their enclosed space.

You may have noticed that the complex quadrilateral has self-intersecting sides. In mathematics, though, the angles formed by the intersection are not part of the shape.

A complex quadrilateral has two acute interior acute angles and two interior reflex angles. Those two reflex angles will appear to be outside the shape, which can be confusing. They are still considered "interior" angles.

Even though two line segments cross and appear to make two more interior angles, the quadrilateral is still said to have only four interior angles. The self-intersecting line segments do not add two angles to the complex quadrilateral.

## Lesson Summary

In this lesson you learned that a quadrilateral is a plane figure made with four line segments closing in a space. Specific types of quadrilaterals, like the rectangle, trapezoid and square, have more restrictive definitions.

• Quadrilaterals can be simple or complex
• Simple quadrilaterals can be convex or concave
• Quadrilaterals can be symmetrical or asymmetrical
• Interior angles of all simple quadrilaterals (convex or concave) add up to 360°

## What you learned:

This video lesson taught you to:

• Identify a quadrilateral and place it in the family of plane figures
• Identify and name the four sides and four vertices
• Tell the difference between a simple and complex quadrilateral
• Tell the difference between a convex and a concave quadrilateral

### Next Lesson:

Instructor: Malcolm M.
Malcolm has a Master's Degree in education and holds four teaching certificates. He has been a public school teacher for 27 years, including 15 years as a mathematics teacher.

### 20+ Math Tutors in Ashburn, VA

Get better grades with tutoring from top-rated private tutors. Local and online.

15 chapters | 149 lessons
Tutors online

### Find a math tutor in Ashburn, VA

Learn faster with a math tutor. Find a tutor locally or online.


text:
Data Scientist

# It's if_else statements all the way down...

I’ve been developing a package where I needed a function to take numerous different actions (different mutations) depending on the values of different variables within each row of a dataframe. I started off by using a series of nested dplyr::if_else functions inside of a dplyr::mutate call. I ended up with a bit of a mess, perhaps a dozen or so if_else calls… that’s when I got some abuse from my colleague following a Github pull request.

### Vector example

There must be a better way? A quick Google got me here. A neat idea, but I noticed the suggestion of the new-ish dplyr::case_when function in the comments section of this excellent blog post. I’ve taken up the baton, by exploring this function in this post.

The example from the ?case_when is quite informative; I give a visual interpretation (see the code comments for details). However, we should explore it further and apply it to a dataframe to expand our understanding.

The same outcome but which did you find the more readable? (Imagine you were quality assuring this code?)

### Dataframes example

As pointed out in the case_when help examples, ordering is important where you want to go from most specific to least specific. In the example below we wanted the Mazda RX4 Wag to be labbelled as a Mazda Wagon in the newly created brand variable. This failed due to our ordering; to suceed we should move this before the left hand side (LHS) first argument. Notice how the right hand side of the ~ provides the replacement value. Try replacing the "Wow" with a numeric 50, what happens when you run the code?

case_when is still somewhat new and experimental. For now I may stick with nested if_else statements until this is more stable and works well within mutate despite case_when being a bit easier to read. If you play around with this demo code it’s quite easy to break, this may be in part to some useful non-standard evaluation intrinsic to mutate. For example replacing the & with && causes it to error. Try it with your own data and keep your eyes peeled for further developments! In Hadley we trust.

## Conclusion

A relatively new offering from the tidyverse on making nested if_else statements more readible.


text:
Advice: EE to work in Aviation Industry

1. Jun 17, 2007

DefaultName

Hi, Im currently an EE and soon will be entering the workforce. My primary goal is to work for Boeing/Sikorsky/etc... for those of you that are in the industry or know of it -- what courses are absolutely crucial to succeed?

Obviously, the EE fundametals, such as circuit design, signals and systems, etc... but for those technical electives you get to choose - which will be of most value in that field?

For example, my school has these courses as upper-level electives:

* Laser Communications
* Digital Communications
* Electro-Optics
* CMOS VLSI
* Digital Signal Processing I
* Analog Circuit Design
* Control Systems II (I have to take Control Systems I, no matter what)
* Linear and Sampled Data in Control Systems
* Information Theory
* Systems on a Chip Design
* VLSI Systems Design
* Robust Multivariable Control

2. Jun 17, 2007

chroot

Staff Emeritus
Individual undergraduate courses are not going to materially affect your chances of being accepted to Boeing, or of being successful at Boeing. That said, the courses that sound most applicable are probably the communications and control classes.

- Warren

3. Jun 17, 2007

DefaultName

Oh, but if you take those courses, you'll be fit for some entry level position with a certain group, no?

4. Jun 18, 2007

mgb_phys

As chroot said, at most big companies the HR dept does the hiring - they aren't going to know what any of the above words mean. They will look at school GPA and references from the teachers.

Take courses that interest you - at entry level it isn't going to matter exactly what you know because you are soon going to realise you don't know enough about anything ;-)

5. Jun 18, 2007

ranger

I've had a bunch of engineers tell me this. It makes me so scared and confused

6. Jun 18, 2007

mgb_phys

Don't worry - a degree isn't about learning everything so much as learning how to learn!
Knowing the simple example case of a particular system isn't going to help in reality - knowing how to solve a differential equation ( or even recognising that it is a differential equation) will!

Anyway, all your co-workers are equally scared that they are going to be replaced by this young hard working hot-shot straight from a presitigous engineering program who can remember what XYZ's law is!

7. Jun 18, 2007

Staff: Mentor

Don't worry ranger, I disagree with what mgb is saying. Entry-level EE hiring is not done by HR -- they may screen the candidates initially to get to a practical number of good candidates for the first engineering interviews, but as long as you have a reasonable resume and a few key things (see below), you will make it past that first HR screening.

As I've said in other threads, it is extremely helpful for you all to have some practical experience building projects or working at internships, summer jobs, RA positions, etc. It stands out on your resume, and it also helps to show you what really is important in your studies, and what really is not all that important. Working on real projects and building things with your knowledge helps you to start to learn to "ask the right questions", both of yourselves and of your instructors.

Anyway, to the OP, I agree with chroot's comments, although I am by no means an expert in the aerospace applications of EE. However, from what I have seen from the outside, and from thinking about what kinds of projects you would work on, I would single out the following areas from your list:

(* Laser Communications)
* Digital Communications
(* Electro-Optics)
(* CMOS VLSI)
* Digital Signal Processing I
(* Analog Circuit Design)
* Control Systems II (I have to take Control Systems I, no matter what)
* Linear and Sampled Data in Control Systems
(* VLSI Systems Design)
* Robust Multivariable Control

The selections in parenthesis would be useful if you knew of projects or project teams at the company who actively were using those technologies. Do you have a pretty good idea of the different jobs that the aero companies have?

8. Jun 18, 2007

mgb_phys

I would agree that internships, clubs, projects etc are a better indication of someones interests and usefulness in a job than pure exam results.

I don't work in aerospace but any sort of control systems course is useful - it is one of the areas where some knowledge of the theory usually pays back the effort. VLSI etc isn't directly relevant in most applications because you are using bought in parts instead of making them.
Laser and digital comms is mostly a follow-the-protocol-specs area, there isn't a lot of deep background knowledge in writing to an I2C bus.

I would suggest looking at analog circuit design - all electronics is analogue and as circuits get faster RF and transmission line stuff becomes more relevent even for digital signals.

9. Jun 18, 2007

chroot

Staff Emeritus
Generally, "analog design" refers to analog integrated circuit design, not board- or system-level design.

The bottom line is that you're going to gain nothing of relevance to the aerospace industry in a class on integrated circuits -- since, as mgb says, the aerospace industry doesn't design integrated circuits.

On the other hand, planes are basically one giant exercise in control systems, so I would bone up on control theory. Communications (including avionics and radio navigation) is definitely another very large component.

The thread also seems to have overlooked another very large application of electrical engineering in aviation: power electronics. Modern aircraft have fuel cells and very elaborate power-distribution and conditioning systems that certainly take some skills to design.

There was a time when I really, really wanted to be involved in designing glass cockpits. My career has since taken me in a wildly different direction, but I wish you luck in this direction.

- Warren

10. Jun 18, 2007

Cyrus

Id agree with warren, but keep in mind that there is not much new stuff in way of controls for manner aircraft. Most of the controls work is done on UAVs these days. The bigger airplanes are working on control systems for mission sucesss. I.e., if an engine or system fails, how to optimize the flight systems still working to make it to your destination. (Reliability and Robustness).

Either way, I think you can have a lot of fun as an EE in aerospace.

11. Jun 20, 2007

DefaultName

Thanks for the all the information!!

12. Jun 30, 2007

DefaultName

Well, here's an update: I just got an internship with a company that works in aviation... it's a short one, 1 1/2 months until the middle of September. I accepted, even though it's more industrial/manufacturig engineering. I think that it'll be a good experience overall, rather than working a minimum wage job somewhere. Plus, I get to play with planes =D

13. Jun 30, 2007

turbo

All students here should heed mgb_phys's words. When I was a process chemist in a pulp mill, the company would hire CEs, MEs, etc, directly out of school (paying them a lot more money than me) and I had to spend a good deal of time educating them about the mill's processes, process control systems, functional bottlenecks (sometimes hard to quantify, but BIG  in a manufacturing environment), and on and on. Much of what you will need to thrive as an engineer in a manufacturing environment, you will have to learn as you go. Much will be rather general, but industry-specific, much will be specific to your location/plant, and a surprising amount will turn out to be specific to a particular project or process. When you hit the job market, don't expect to breathe a sigh of relief and stop the intensive learning of school - the learning is going to continue and depending on your boss/supervisor you may be introduced to some forms of motivation that you're not accustomed to. The best thing a prospective engineer can do for themselves is secure summer internships in their target industry, or a related environment. My nephew did this, performed well, learned a lot of valuable job skills, and had several nice offers on the table by the time he graduated.

14. Jun 30, 2007

turbo

That's great! Especially if you are fortunate enough to be assigned to assist an engineer with interesting projects who will give you some responsibility and some goals to meet.

Last edited: Jun 30, 2007
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook


text:
Parallelogram law of vectors

[This is a very silly question. Will be a great help if someone could answer this question]

How is this law proven? I am not asking about the proof itself rather asking about the preliminary assumptions. That is how does two vectors be represented as two adjacent sides of a parallelogram and how does their resultant correspond to the diagonal? I could understand that this is applicable for displacement since it coincides with intuition. But how is it applicable for velocity or force? All these seems quite wierd to me.

In case of displacement, say a person is moving in such a manner that his path is representing two adjacent sides of a parallelogram. For example in parallelogram ABCD, the person is moving from A to B and then B to C. Well this concludes that the person has been displaced from A to C (along a straight line connecting A and C). But what if two forces are acting on a person at A directing towards B and D? In this case we cannot put forward the idea we used in case of displacement. Then how do we get to know that AC is the resultant of those two forces?

• You can try to learn the derivation of triangle law of vector addition, parallelogram law is essentially a restatement of triangle law Jun 10, 2021 at 10:08
• It's worth noting that some people think force should actually be thought of as a covector. This makes sense since we have $f = \frac{dp}{dt}$, and momentum is naturally a covector. This distinction almost never matters in practice because we usually have a way of identifying vectors and covectors. Jun 11, 2021 at 15:37

Your first question

How is this law proven? I am not asking about the proof itself rather asking about the preliminary assumptions.

The parallelogram law, mathematically speaking, is a result of an affine space. In simple terms, an affine space is a space that is flat. For example, the surface of a table and standard 3D space are affine spaces. The surface of a sphere, on the other hand, is not an affine space.

We first need to understand what a vector space is. A vector space is a set whose elements must obey certain rules. The elements are called vectors only if all the rules are satisfied.

An affine space is a set of points and a vector space, together with an addition operation that adds vectors (from the vector space) to points.

Let $$P,Q$$ be points and $$\mathbf{u},\mathbf{v}$$ be vectors. The addition is defined to satisfy two properties:

1. $$(P+\mathbf{u})+ \mathbf{v} = P+(\mathbf{u}+ \mathbf{v})$$
2. There is a unique vector $$\overrightarrow{PQ}$$ that goes from $$P$$ to $$Q$$.

An aside

We can add vectors to vectors (from vector addition in the vector space), as well as vectors to points (with the definition above), but it would make no sense to add points to points without defining a privileged point known as the origin.

Simply put, this is just saying that vectors are the displacements from point to point. From this definition, the following identities (which hopefully look familiar) can be proven without much difficulty:

1. $$\overrightarrow{PQ} + \overrightarrow{QR} = \overrightarrow{PR}$$
2. $$P + \mathbf{0} = P$$
3. If $$\overrightarrow{PQ} = \mathbf{0}$$, then $$P = Q$$
4. $$\overrightarrow{PQ} = -\overrightarrow{QP}$$

where $$\mathbf{0}$$ is the zero vector. We can then prove the parallelogram law: $$\text{If} \;\; \overrightarrow{P_1Q_1} = \overrightarrow{P_2Q_2} \\ \overrightarrow{P_1Q_1} + \overrightarrow{Q_1P_2} = \overrightarrow{P_2Q_2} + \overrightarrow{Q_1P_2} \\ \overrightarrow{P_1P_2} = \overrightarrow{Q_1P_2} + \overrightarrow{P_2Q_2} \\ \therefore \overrightarrow{P_1P_2} = \overrightarrow{Q_1Q_2}$$ where we have used the first identity as well as the commutativity of vector addition.

Your second question

I could understand that this is applicable for displacement since it coincides with intuition. But how is it applicable for velocity or force?

From the above we have shown that displacements are vectors in an affine space. Therefore we need to prove that velocity, acceleration and force are vectors. Velocity is defined to be the rate of change of displacement. Let $$\mathbf{r}(t)$$ be the displacement from a fixed point. The velocity is then $$\frac{\text{d} \mathbf{r}}{\text{d}t} = \lim \limits_{\Delta t \to 0} \frac{\mathbf{r}(t+\Delta t) - \mathbf{r}(t)}{\Delta t}$$ The numerator $$\mathbf{r}(t+\Delta t)- \mathbf{r}(t)$$ is the difference of two vectors which is also a vector. The numerator multiplied by $$1/\Delta t$$ is also a vector by scalar multiplication. Therefore we have proven that velocity is also a vector. By the same logic, acceleration is also a vector and so on.

The parallelogram rule is simply the way in which you add two quantities that are vectors. So the real question is ... how do we know that displacement, velocity and force are all vectors ?

For displacements it is, as you say, almost intuitive. Displacements in Euclidean space are Euclidean vectors, and so you can add then like vectors - if you walk $$x$$ miles in one direction and then $$y$$ miles in another direction, your final displacement $$\vec x + \vec y$$ is the diagonal of the parallelogram formed by the two vectors $$\vec x$$ and $$\vec y$$.

Velocity is the rate of change of displacement. And we can prove mathematically that the rate of change of one vector is another vector. So velocities are vectors, and can be added using the parallelogram rule.

Force is not so obvious, but we know from Newton's second law that force is proportional to acceleration, which is the rate of change of velocity. Since velocity is a vector then so is acceleration, and since acceleration is a vector then so is force. In the same way, we can conclude that momentum is also a vector because it is proportional to velocity.

• sir, in case of displacement say there is a parallelogram ABCD and a person moves from A to B and then to C, then we can easily understand that the person has been displaced from A to C and as per the definition of displacement, the straight line connecting A and C should be the displacement of the person. But when it comes to force, two forces are acting from A to B and A to D then how does AC represent their resultant?
– MSKB
Jun 10, 2021 at 10:21
• I could not understand the last part of the previous comment
– MSKB
Jun 10, 2021 at 10:23
• @MohammadSakibShahriar Displacement is a vector and the rate of change of a vector is another vector. Velocity is the rate of change of displacement (a vector) therefore velocity is a vector. Acceleration is the rate of change of velocity (a vector) therefore acceleration is a vector. Force is mass (a scalar) times acceleration (a vector) so force is also a vector. Momentum is mass (a scalar) times velocity (a vector) so momentum is also a vector. Jun 10, 2021 at 11:01
• I think it is always good to also think when these things fail (especially for obvious things), and this is on curved surfaces. Assume you are close to the norhpol (like 89 degree). Walking 100 km east and then 3000km south will give a dramatically different location than first going south then east. Jun 10, 2021 at 21:57
• I think it's worth noting that some people think force should be considered a co-vector. This consistent with the law $f = \frac{d p}{dt}$, since $p$ is naturally a co-vector. Jun 11, 2021 at 14:15

It is not so much a problem of physics as a problem of choosing a given formalism to represent a physical problem.

The choice of choosing the metaphor of mathematical vectors to represent a problem whose entities have a [fixed] number parameters is quite straightforward if one is familiar with the mathematical concept of vectors (they nicely map to each other).

https://www.storyofmathematics.com/vector-addition

https://www.varsitytutors.com/hotmath/hotmath_help/topics/adding-and-subtracting-vectors

Operations on physical entities which have typically 3 dimensions in classical mechanics are made simple if one chooses to represent them with vectors from a 3 dimensional space. It allows one to use all the standard operations available for vectors (a ready-made toolkit if you like) and to apply them to : position, speed, momentum, angular momentum. Amongst these operations are: addition, scalar product, measure of distances, calculation of surfaces, angular momentum, etc.

In other words there is a mapping between:

• A problem whose variables have N parameters, N fixed.
• A vector space with N dimensions.
• Geometry in a N-dimensional space (the parallelograms you mention).

Let's tackle your question in single steps, and take the "force" example. Then I understand your question as "If two forces are applied to an object at the same time, why does the parallelogram method give the correct resulting force?"

Vectors are a mathematical concept. Often, we use 2- or 3-dimensional vectors, being composed from 2 or 3 numbers, e.g. representing x, y, and z components of points or distances or forces.

First, there is the question "If I represent vectors as arrows on paper, does the parallelogram method give a diagonal arrow that correctly represents the mathematical addition of the two input vectors?" Mathematics answers that as being true (I don't have a proof for that at hand, but I'm quite sure that one exists).

Then, physics found it useful to use vectors as representations of forces. So, forces can be added according to the laws established by math, e.g. numerically or by drawing the parallelogram.

Finally, there's the question if the vector addition of two forces has any physical meaning. Especially, can an object that experiences two combined forces be replaced by the same object experiencing one single force (being the vector addition of the individual forces), without changing the resulting movement of the object? That's a physics question, and is has been observed to be true many, many times - so often that we believe this to be universally true.

To sum it up:

• Mathematics can prove that the parallelogram method correctly adds two vectors.
• Physics found out (by observation) that vector addition is a proper method for describing the combined effect of individual forces.
• So does that mean addition of forces is something empirical rather than proven from scratch?
– MSKB
Jun 10, 2021 at 11:07
• All physics is empirical, essentially. Jun 10, 2021 at 11:18
• Yeah thats true but some equations are based on only observations and some are derived from other equations. So I wanted to know in which category does this law belong to?
– MSKB
Jun 10, 2021 at 11:35


text:
# Prove that $|f(x)|^p\ln|f(x)|$ is a bounded function (with some conditions)

I wish to prove that $g(x,p)=|f(x)|^p\ln|f(x)|$ is a bounded function of $(x,p)$, where $0<|f(x)|\leq M$ for all $x$, and $p\in[p_1,p_2]$, where $0<p_1<p_2<\infty$.

$f$ is measurable but not necessary continuous.

My attempt: Let $(x,p)$ be an arbitrary point. We wish to show $|g(x,p)|\leq K$ where $K$ is independent of $x, p$.

Case 1) Suppose $|f(x)|\geq 1$. Then $0<|f(x)|^p\ln|f(x)|\leq M^{p_2}\ln M$. The bounds are independent of $(x,p)$ so we are done for this case.

Case 2) Suppose $|f(x)|<1$. Then $0<|f(x)|^p\leq M^p\leq M^{p_2}$.

The $\ln|f(x)|$ part is kind of tricky as it is unbounded. However since $t^p\ln t\to 0$ as $t\to 0^+$, $|f(x)|^p\ln|f(x)|$ ought to be bounded. I don't know how to write it rigorously though.

Thanks for any help.

If $t<1$, then $$|t^p \ln t| \le |t|^{p_1} |\ln t|.$$ Since $|t|^{p_1} |\ln t| \to 0$ as $t\to 0$, $|t|^{p_1} |\ln t|$ can be extended to a continuous function defined on $[0,1]$ and thus is bounded on $[0,1]$. Thus $t^p \ln t$ is also bounded on $[0,1] \times [p_1\times p_2]$. Together with case one you have that $t^p \ln t$ is bounded on $[0,M] \times [p_1,p_2]$.
• I see... Here we implicit use the fact that $|t|^{p_1}|\ln t|$ is a continuous function of $t$ right? – yoyostein Sep 17 '16 at 6:17
• Can you briefly explain "Since $|t|^{p_1} |\ln t| \to 0$ as $t\to 0$, $|t|^{p_1} |\ln t|$ is bounded on $[0,1]$". This is the part where I am a bit confused. The rest are ok. Is it something like for $t<\delta$, $||t|^{p_1} |\ln t||<\epsilon$, for $\delta \leq t\leq 1$ it is bounded by extreme value theorem since $[\delta,1]$ is compact. – yoyostein Sep 17 '16 at 6:23


text:
# Isothermal Gas Expansion, a Reversible or Irreversible process?

Consider the following situation. A certain quantity of ideal monatomic gas (say one mole) is confined in a cylinder by a piston and is maintained at constant temperature (say $T_0$) by thermal contact with a heat reservoir. Then the gas slowly expands from $V_1$ to $V_2$ while being held at the same temperature $T_0$.

Question: Is this process reversible or irreversible?

Attempt: When the gas expands, the temperature must decrease, so the heat reservoir gives energy to the gas so the gas is maintained to the same temperature, right? Then If we do work on the gas so that it returns to the initial volume $V_1$, we know that due to $\Delta T=0$, then $\Delta U=0$, right? So, the work done on the gas is going to transform itself to heat that would be absorbed by the heat reservoir. My question is: how do we know if the heat given by the heat reservoir is the same that the heat absorbed by itself? If this is true, then I guess the process will be reversible, but if it's not true, does the process would be irreversible? Or it does not matter due that we have a heat reservoir?

-
I edited my question @Manishearth –  Anuar May 20 '13 at 15:34

Your process will be reversible only if it is a) quasi-static and b) non-dissipative. It will be quasi-static if it is carried out infinitely slowly in such a manner that the pressure on either sides of the piston varies only infinitesimally. It will be non-dissipative if the piston is frictionless and there is no viscous heating of the gas as it expands.

-
So, for practical results, can we consider that the process is reversible? –  Anuar May 21 '13 at 12:18
@Anuar. You can approximate the process to be reversible if you are carrying it out sufficiently slowly. From the definition of reversible process, you would have guessed that real world processes are far from that ideal. –  Amey Joshi May 21 '13 at 14:10
Put another way, work $W$ is given by $W = \int_{V_1}^{V_2} p_{ext} dV$, where $p_{ext}$ is the external pressure. So you cannot determine the work or the temperature change unless you can do this integral, which you can't, because you do not know if the internal and external pressures are even related.
I don't understand why you say that. According to Blundell (Thermal Physics), the expression $đW=-pdV$ can be used only in a reversible process. Also I understand that "in a reversible cycle, the system and its surroundings will be exactly the same after each cycle". that's why I'm asking for the $Q$'s. Because they are equal then I'll conclude that the process is reversible. –  Anuar May 20 '13 at 18:29


text:
# Sports games

Pupils of same school participated district sports games. When dividing into teams found that in the case of the creation teams with 4 pupils remaining 1 pupil, in the case of a five-member teams remaining 2 pupils and in the case of six-members teams remaining 3 pupils. How many pupils in this school attended games if one school could participated a maximum of 80 pupils?

Result

n =  57

#### Solution:

0 = 4×0 + 0 = 5×0 + 0 = 6×0 + 0
1 = 4×0 + 1 = 5×0 + 1 = 6×0 + 1
2 = 4×0 + 2 = 5×0 + 2 = 6×0 + 2
3 = 4×0 + 3 = 5×0 + 3 = 6×0 + 3
4 = 4×1 + 0 = 5×0 + 4 = 6×0 + 4
5 = 4×1 + 1 = 5×1 + 0 = 6×0 + 5
6 = 4×1 + 2 = 5×1 + 1 = 6×1 + 0
7 = 4×1 + 3 = 5×1 + 2 = 6×1 + 1
8 = 4×2 + 0 = 5×1 + 3 = 6×1 + 2
9 = 4×2 + 1 = 5×1 + 4 = 6×1 + 3
10 = 4×2 + 2 = 5×2 + 0 = 6×1 + 4
11 = 4×2 + 3 = 5×2 + 1 = 6×1 + 5
12 = 4×3 + 0 = 5×2 + 2 = 6×2 + 0
13 = 4×3 + 1 = 5×2 + 3 = 6×2 + 1
14 = 4×3 + 2 = 5×2 + 4 = 6×2 + 2
15 = 4×3 + 3 = 5×3 + 0 = 6×2 + 3
16 = 4×4 + 0 = 5×3 + 1 = 6×2 + 4
17 = 4×4 + 1 = 5×3 + 2 = 6×2 + 5
18 = 4×4 + 2 = 5×3 + 3 = 6×3 + 0
19 = 4×4 + 3 = 5×3 + 4 = 6×3 + 1
20 = 4×5 + 0 = 5×4 + 0 = 6×3 + 2
21 = 4×5 + 1 = 5×4 + 1 = 6×3 + 3
22 = 4×5 + 2 = 5×4 + 2 = 6×3 + 4
23 = 4×5 + 3 = 5×4 + 3 = 6×3 + 5
24 = 4×6 + 0 = 5×4 + 4 = 6×4 + 0
25 = 4×6 + 1 = 5×5 + 0 = 6×4 + 1
26 = 4×6 + 2 = 5×5 + 1 = 6×4 + 2
27 = 4×6 + 3 = 5×5 + 2 = 6×4 + 3
28 = 4×7 + 0 = 5×5 + 3 = 6×4 + 4
29 = 4×7 + 1 = 5×5 + 4 = 6×4 + 5
30 = 4×7 + 2 = 5×6 + 0 = 6×5 + 0
31 = 4×7 + 3 = 5×6 + 1 = 6×5 + 1
32 = 4×8 + 0 = 5×6 + 2 = 6×5 + 2
33 = 4×8 + 1 = 5×6 + 3 = 6×5 + 3
34 = 4×8 + 2 = 5×6 + 4 = 6×5 + 4
35 = 4×8 + 3 = 5×7 + 0 = 6×5 + 5
36 = 4×9 + 0 = 5×7 + 1 = 6×6 + 0
37 = 4×9 + 1 = 5×7 + 2 = 6×6 + 1
38 = 4×9 + 2 = 5×7 + 3 = 6×6 + 2
39 = 4×9 + 3 = 5×7 + 4 = 6×6 + 3
40 = 4×10 + 0 = 5×8 + 0 = 6×6 + 4
41 = 4×10 + 1 = 5×8 + 1 = 6×6 + 5
42 = 4×10 + 2 = 5×8 + 2 = 6×7 + 0
43 = 4×10 + 3 = 5×8 + 3 = 6×7 + 1
44 = 4×11 + 0 = 5×8 + 4 = 6×7 + 2
45 = 4×11 + 1 = 5×9 + 0 = 6×7 + 3
46 = 4×11 + 2 = 5×9 + 1 = 6×7 + 4
47 = 4×11 + 3 = 5×9 + 2 = 6×7 + 5
48 = 4×12 + 0 = 5×9 + 3 = 6×8 + 0
49 = 4×12 + 1 = 5×9 + 4 = 6×8 + 1
50 = 4×12 + 2 = 5×10 + 0 = 6×8 + 2
51 = 4×12 + 3 = 5×10 + 1 = 6×8 + 3
52 = 4×13 + 0 = 5×10 + 2 = 6×8 + 4
53 = 4×13 + 1 = 5×10 + 3 = 6×8 + 5
54 = 4×13 + 2 = 5×10 + 4 = 6×9 + 0
55 = 4×13 + 3 = 5×11 + 0 = 6×9 + 1
56 = 4×14 + 0 = 5×11 + 1 = 6×9 + 2
57 = 4×14 + 1 = 5×11 + 2 = 6×9 + 3

$n = 4x+1 = 5y+2 = 6z+3 \ \\ x,y,z \in N \ \\ n \le 80 \ \\ n = 57$

Our examples were largely sent or created by pupils and students themselves. Therefore, we would be pleased if you could send us any errors you found, spelling mistakes, or rephasing the example. Thank you!

Leave us a comment of this math problem and its solution (i.e. if it is still somewhat unclear...):

Be the first to comment!

## Next similar math problems:

1. Children
Less than 20 children is played various games on the yard. They can create a pairs, triso and quartets. How many children were in the yard when Annie came to them?
2. Four-digit number
Find also a four-digit number, which quadrupled written backwards is the same number.
3. Divisibility
Write all the integers x divisible by seven and eight at the same time for which the following applies: 100
4. The balls
You have 108 red and 180 green balls. You have to be grouped into the bags so that the ratio of red to green in each bag was the same. What smallest number of balls may be in one bag?
5. Sheep
Shepherd tending the sheep. Tourists asked him how much they have. The shepherd said, "there are fewer than 500. If I them lined up in 4-row 3 remain. If in 5-row 4 remain. If in 6-row 5 remain. But I can form 7-row." How many sheep have herdsman?
6. Toy cars
Pavel has a collection of toy cars. He wanted to regroup them. But in the division of three, four, six, and eight, he was always one left. Only when he formed groups of seven, he divided everyone. How many toy cars have in the collection?
7. Grandmother
Grandmother wants to give the candies to grandchildren that when she gives 5 candy everyone 3 missing and when she gives 4 candies 3 is surplus. How many grandchildren has grandmother and how many candies has?
8. Divisible by 5
How many three-digit odd numbers divisible by 5, which are in place ten's number 3?
9. Twenty-five
How many three-digit natural numbers are divisible by 25?
10. Remainder
A is an arbitrary integer that gives remainder 1 in the division with 6. B is an arbitrary integer that gives remainder 2 the division by. What makes remainder in division by 3 product of numbers A x B ?
11. 7 digit number
If 3c54d10 is divisible by 330, what is the sum of c and d?
12. Digit sum
Determine for how many integers greater than 900 and less than 1,001 has digit sum digit of the digit sum number 1.
13. Trees
Loggers wanted to seed more than 700 and less than 800 trees. If they seed in rows of 37, left them 8 trees. If they seed in rows of 43, left the 11 trees. How many trees must seed ?
14. Shepherd
The shepherd has fewer than 500 sheep; where they can be up to 2, 3, 4, 5, 6 row is always 1 remain, and as can be increased up to 7 rows of the sheep, and it is not increased no ovine. How many sheep has a shepherd?
15. The florist
The florist had 200 roses in the morning. During the day, more than half sold it. From the remaining roses, it will tie the bouquet. If a bouquet of 3, 4, 5 or 6 roses are bound, one always remains. How many roses from the morning shipment sold?
16. Lines
Five bus lines runs at intervals 3, 6, 9, 12, 15 minutes. In the morning, suddenly start at 4:00. After how many minutes the bus lines meet again?
17. Banknotes
How many different ways can the cashier payout € 310 if he uses only 50 and 20 euro banknotes? Find all solutions.


text:
Notes On Enthalpy Of Combustion And Atomisation - CBSE Class 11 Chemistry
Combustion is a process of burning a chemical compound at high temperatures in presence of excess of oxygen or air. Combustion reactions are exothermic reactions. The energy released during these reactions is used to drive automobiles, ships, air planes and trains, to operate industrial processes, rocketry, and for numerous other purposes. The energy change accompanying the process of combustion is called the enthalpy of combustion. It is defined as the amount of heat energy evolved when one mole of substance is completely burnt or oxidised in excess of air or oxygen, and is represented as ΔcH. Ex: C(s) + O2(g) → CO2(g); ΔcH = - 393.5 kj mol-1 When 1mole of carbon is completely burnt, it releases 393.5 kilo joules of heat. The negative sign of enthalpy change indicates the exothermic nature of the reaction. Standard enthalpy of combustion is defined as "the enthalpy change per mole of a substance, when it undergoes combustion, with all the reactants and products being in their standard states at the specified temperature." It is represented by ΔcH not. The energy released by the combustion of food or fuel is usually compared in terms of their combustion energy per gram, which is known as calorific value. Calorific value of food or fuel is defined as "the amount of heat released by the complete combustion of one gram of fuel or food." Calorific value is usually expressed in kilo joules per gram or kilo calorie per gram.                             Calorific Values of Some Fuels     Fuel     Calorific Value KJ/g    Fuel   Calorific Value KJ/g  Hydrogen          150  Biogas          35-40  Methane          55  Charcoal          33  Butane          50  Ethanol          30  Petrol          50  Coal          25-33  Kerosene          48  Wood          17  Diesel          45  Dung cake          6-8 When one mole, 180 grams of glucose burns, it releases 2840 kilo joules of heat. When one mole of given a substance dissociates into gaseous atoms, the enthalpy change accompanying the process is called the standard enthalpy of atomisation. It is represented by ΔH°. The conversion of 1mole of hydrogen molecules into hydrogen atoms requires 435.5 kilo joules per mole of energy. Therefore, the enthalpy of atomisation of dihydrogen is 435.5 kilo joules per mole. The chemical reactions involve the breaking and making of bonds. The breaking of bonds requires energy, while the making of bonds involves the release of energy. The enthalpy changes associated with chemical bonds are expressed in terms of bond dissociation enthalpy and mean bond enthalpy. In case of diatomic molecules, bond dissociation enthalpy is the change in enthalpy when one mole of covalent bonds of a gaseous covalent compound is broken to form products in the gas phase. For all diatomic molecules, bond dissociation enthalpy is the same as atomisation enthalpy. In case of polyatomic molecules, bond dissociation enthalpy is different for different bonds within the same molecule. Bond enthalpies can be calculated using Hess's law. The bond enthalpies useful in predicting the enthalpy of a reaction in gas phase. ΔrHo = ∑ bond Enthalpies reactions - ∑ Bond Enthalpies products ΔrHo = Standard enthalpy of a reaction

#### Summary

Combustion is a process of burning a chemical compound at high temperatures in presence of excess of oxygen or air. Combustion reactions are exothermic reactions. The energy released during these reactions is used to drive automobiles, ships, air planes and trains, to operate industrial processes, rocketry, and for numerous other purposes. The energy change accompanying the process of combustion is called the enthalpy of combustion. It is defined as the amount of heat energy evolved when one mole of substance is completely burnt or oxidised in excess of air or oxygen, and is represented as ΔcH. Ex: C(s) + O2(g) → CO2(g); ΔcH = - 393.5 kj mol-1 When 1mole of carbon is completely burnt, it releases 393.5 kilo joules of heat. The negative sign of enthalpy change indicates the exothermic nature of the reaction. Standard enthalpy of combustion is defined as "the enthalpy change per mole of a substance, when it undergoes combustion, with all the reactants and products being in their standard states at the specified temperature." It is represented by ΔcH not. The energy released by the combustion of food or fuel is usually compared in terms of their combustion energy per gram, which is known as calorific value. Calorific value of food or fuel is defined as "the amount of heat released by the complete combustion of one gram of fuel or food." Calorific value is usually expressed in kilo joules per gram or kilo calorie per gram.                             Calorific Values of Some Fuels     Fuel     Calorific Value KJ/g    Fuel   Calorific Value KJ/g  Hydrogen          150  Biogas          35-40  Methane          55  Charcoal          33  Butane          50  Ethanol          30  Petrol          50  Coal          25-33  Kerosene          48  Wood          17  Diesel          45  Dung cake          6-8 When one mole, 180 grams of glucose burns, it releases 2840 kilo joules of heat. When one mole of given a substance dissociates into gaseous atoms, the enthalpy change accompanying the process is called the standard enthalpy of atomisation. It is represented by ΔH°. The conversion of 1mole of hydrogen molecules into hydrogen atoms requires 435.5 kilo joules per mole of energy. Therefore, the enthalpy of atomisation of dihydrogen is 435.5 kilo joules per mole. The chemical reactions involve the breaking and making of bonds. The breaking of bonds requires energy, while the making of bonds involves the release of energy. The enthalpy changes associated with chemical bonds are expressed in terms of bond dissociation enthalpy and mean bond enthalpy. In case of diatomic molecules, bond dissociation enthalpy is the change in enthalpy when one mole of covalent bonds of a gaseous covalent compound is broken to form products in the gas phase. For all diatomic molecules, bond dissociation enthalpy is the same as atomisation enthalpy. In case of polyatomic molecules, bond dissociation enthalpy is different for different bonds within the same molecule. Bond enthalpies can be calculated using Hess's law. The bond enthalpies useful in predicting the enthalpy of a reaction in gas phase. ΔrHo = ∑ bond Enthalpies reactions - ∑ Bond Enthalpies products ΔrHo = Standard enthalpy of a reaction

Previous
Next


text:
Q

# Construct the angles of the following measurements: (i) 30 degrees

Q3.    Construct the angles of the following measurements:

(i) 30o

Views

Steps to construction to follow:

Step 1: Draw a ray OY.

Step 2: Now, take A as a center and take any radius, then draw an arc AB cutting OY at A.

Step 3: Take A and B as centres, draw 2 arcs are marked intersecting each other at X and hence, the bisector of $30^{\circ}$ is constructed.

Thus, $\angle XOY$ is the required angle.

Exams
Articles
Questions


text:
# Are questions about sources for types of puzzles off-topic?

My question is similar (although I don't think it's an exact duplicate) to this question.

I'm interested in finding examples of certain types of puzzles and I haven't had much luck using search engines. Would questions about where to find specific types of puzzles be off-topic?


text:
# Forward_list::operator = in C++ STL

C++Server Side ProgrammingProgramming

In this article we will be discussing the working, syntax and examples of forward_list::operator = in C++.

## What is a Forward_list in STL?

Forward list are sequence containers that allow constant time insert and erase operations anywhere within the sequence. Forward list are implement as a singly-linked lists. The ordering is kept by the association to each element of a link to the next element in the sequence.

## What is forward_list::operator =?

Forward_list::operator = is used to assign the new values to the forward_list container by replacing the already existing ones. This operator also modifies the size of the forward_list container according to the new values.

## Syntax

Forward_container1 = (forward_container2);

This function accepts another forward_list container of the same type.

## Return Value

It returns “*this” pointer.

In the below code we are creating two forward lists and inserting elements to it and after that we will use ‘=’ operator to overwrite the elements of a forward list 1 with the forward list 2.

## Example

Live Demo

#include <forward_list>
#include <iostream>
using namespace std;
int main(){
forward_list<int> forwardList1 = {10, 20, 30 };
forward_list<int> forwardList2 = { 0, 1, 2, 3 };
forwardList1 = forwardList2;
cout << "my forwardList1 after using = operator with forwardList2\n";
for (auto i = forwardList1.begin(); i != forwardList1.end(); ++i)
cout << ' ' << *i;
return 0;
}

## Output

If we run the above code it will generate the following output

my forwardList1 after using = operator with forwardList2
0 1 2 3

## Example

In the below code we are creating two forward lists and inserting elements to it and after that we will use ‘=’ operator to overwrite the elements of a forward list 1 with the forward list 2. The main task now is to check the status of forward list 2 i.e. whether it will also gets changed or not

Live Demo

#include <forward_list>
#include <iostream>
using namespace std;
int main(){
forward_list<int> forwardList1 = {10, 20, 30 };
forward_list<int> forwardList2 = { 0, 1, 2, 3 };
forwardList1 = forwardList2;
cout << "my forwardList1 after using = operator with forwardList2\n";
for (auto i = forwardList1.begin(); i != forwardList1.end(); ++i)
cout << ' ' << *i;
cout << "\n my forwardList2 after using = operator with forwardList1\n";
for (auto i = forwardList2.begin(); i != forwardList2.end(); ++i)
cout << ' ' << *i;
return 0;
}

## Output

If we run the above code it will generate the following output

my forwardList1 after using = operator with forwardList2
0 1 2 3
my forwardList2 after using = operator with forwardList1
0 1 2 3
Published on 02-Mar-2020 12:25:47


text:
# GPS tracker recommendation

### Help Support The Rocketry Forum:

##### Member
Hi all. I would like to get a GPS tracker for my rocket (PML Tethys). Eventually, I would like to do dual deployment, but not in this rocket. Any suggestions on a GPS tracker, or refer me to a post with that recommendation? I tried to contact Eggtimer Rocketry, but the email bounced.

#### MOF410

##### Well-Known Member
TRF Supporter
I have a 2g gps tracker that was recommended by the rocket store...hes been using for years. Uses a sim card to send coordinates. Seems to work great so far.

#### The-Rocket-Store.Com

##### Well-Known Member
^^^^ This - If you are looking for small, simple, and you just want to find your rocket after it lands, it does the trick. I was experimenting with 4G unit that is twice the size, 3 times the weight-------and it works no better

##### Member
Interesting. I'm a bit concerned about cell (mobile) coverage. I'll be launching in Argonia, KS. My in-laws live in Anthony, KS (a few miles down the road), and I've had spotty coverage with T-mobile. Though that was better coverage than when I had Verizon about 5 years ago.

#### cerving

##### Owner, Eggtimer Rocketry
TRF Supporter
Hi all. I would like to get a GPS tracker for my rocket (PML Tethys). Eventually, I would like to do dual deployment, but not in this rocket. Any suggestions on a GPS tracker, or refer me to a post with that recommendation? I tried to contact Eggtimer Rocketry, but the email bounced.
Hmm... PM me and I'll get back to you, I don't know why the email would have bounced.

#### ksaves2

Like others have said. The cell phone network trackers have the lowest learning curve and as long as you have service onsite, should work ok for finding your rocket.

##### Well-Known Member
2G cell service has a stated limited life. Most cell carriers have said they'll stop supporting 2G in the near future (2021 or so). Nothing written in stone but I'd rather not risk an investment for a limited lifespan. Eggtimer's GPS is good stuff. Featherweight seems to have a decent one too.

#### The-Rocket-Store.Com

##### Well-Known Member
2G cell service has a stated limited life. Most cell carriers have said they'll stop supporting 2G in the near future (2021 or so). Nothing written in stone but I'd rather not risk an investment for a limited lifespan. Eggtimer's GPS is good stuff. Featherweight seems to have a decent one too.
It's under $20, and 2G has been "disappearing" for a decade now. #### heada ##### Well-Known Member It's under$20, and 2G has been "disappearing" for a decade now.
AT&T discontinued 2G in 2017
Verizon has a date of Dec 31 2020 to have all 2G turned off (3G at the same time)
T-Mobile has a date of Dec 31 2020 to have all 2G turned off (but may delay until sometime in 2021)
Sprint has a date of Dec 31 2021 to have all 2G turned off

As 2G towers die, they're not being fixed or replaced as the costs to maintain them isn't justified. Eventually the carriers will just turn them all off like AT&T already did.

#### n27sb

##### N27SB
TRF Supporter
If you can solder, Eggtimer/Eggfinder are great products.

#### Cameron Anderson

##### Well-Known Member
If you don't want to solder, two good choices - Missileworks T3, or if you have apple products, Featherweight GPS.

#### Greg Furtman

##### Well-Known Member
TRF Supporter
As @n27sb said if you can solder the Eggtimer/Eggfinder products are very good and reasonably priced.

#### QFactor

##### L2 - NAR & TRA
It looks like the Tethys has a nice long nose cone for installing an Eggfinder or Missile Works T3.

#### ChicagoDave

##### Well-Known Member
TRF Supporter
if you have an iPhone the Featherweight GPS tracker is top notch and has worked extremely well for me. The only down sides are 1) iPhone only and 2) no map integration with the app (that I know of).

Here's a video of my Featherweight in action at Mini Midwest Power a few months back: Featherweight GPS Tracker

#### kjs

##### Well-Known Member
TRF Supporter
Here's a video of my Featherweight in action at Mini Midwest Power a few months back: Featherweight GPS Tracker
And watching the video reminds me I need to give you an easy "copy coordinates to clipboard" (or other way to share with a mapping application...!

#### HHaase

##### Well-Known Member
Does the Featherweight use its own GPS receiver for the iphone side of the equation, or is it dependent on the phone gps? I've found that the GPS receivers in phones are just not very good at all.

#### Bat-mite

I use the BigRedBee 900MHz set (BRB900). Put the Rx in the rocket, turn on the Tx, receive real time coordinates. No learning curve until you want to download data and view in Google Earth (which is fun). No HAM required, no soldering required. The only catch is that you need something to navigate you to the coordinates. I use an old Magellan 315 hiker's GPS, about $20 on eBay. #### ChicagoDave ##### Well-Known Member TRF Supporter And watching the video reminds me I need to give you an easy "copy coordinates to clipboard" (or other way to share with a mapping application...! Ha ha yeah, I guess I'm lucky that I can remember the GPS coordinates and type them in before I forget But having an easy way to get them to a map app would be great. Last edited: #### John Kemker ##### Well-Known Member TRF Supporter AT&T discontinued 2G in 2017 Verizon has a date of Dec 31 2020 to have all 2G turned off (3G at the same time) T-Mobile has a date of Dec 31 2020 to have all 2G turned off (but may delay until sometime in 2021) Sprint has a date of Dec 31 2021 to have all 2G turned off As 2G towers die, they're not being fixed or replaced as the costs to maintain them isn't justified. Eventually the carriers will just turn them all off like AT&T already did. Sprint's turn-off date matches T-Mobile's, as they're part of T-Mobile, now. #### cerving ##### Owner, Eggtimer Rocketry TRF Sponsor TRF Supporter The Eggfinder LCD receiver with the GPS add-on is a single-device ground solution... you don't need a phone to navigate or view the data. Plus, it remembers the received data, so if you drop it and it shuts off when the driver of the Jeep you're riding in gets a little too yahoo, you can turn it back on and it will pick up where it left off. #### Cory ##### Well-Known Member Big Red Bee 900 mhz GPS is nice. Missile Works RTX is nice. Altus Metrum is nice. All are effective - all are expensive. #### kjs ##### Well-Known Member TRF Supporter Does the Featherweight use its own GPS receiver for the iphone side of the equation, or is it dependent on the phone gps? I've found that the GPS receivers in phones are just not very good at all. Currently the ground station (GS) for the Featherweight system is actually a full blown tracker just mounted to a 'mother board' so it fits in the enclosure and supports battery charging and external on/off switch. In that mode, the phone is using the GPS unit on the tracker inside the GS. For reasons I can't go into yet, I'm going to also work on using just the phone GPS to track to a location as an option. Having said that, I find the phone to be the same +/- 30 feet that most GPS like to spec... Perhaps I should record the delta for a while and test that... #### HHaase ##### Well-Known Member Currently the ground station (GS) for the Featherweight system is actually a full blown tracker just mounted to a 'mother board' so it fits in the enclosure and supports battery charging and external on/off switch. In that mode, the phone is using the GPS unit on the tracker inside the GS. For reasons I can't go into yet, I'm going to also work on using just the phone GPS to track to a location as an option. Having said that, I find the phone to be the same +/- 30 feet that most GPS like to spec... Perhaps I should record the delta for a while and test that... I'd suggest checking more long term to see how stable the phone is. Typically the phone stuff also has a much slower refresh rate. I tried doing some telemetry during autocross with my phone GPS and found it nearly useless. It was refreshing too slowly, and accuracy was intermittent. At times I'd get a 5m accuracy, other times I'd be lucky if the phone saw me being within a quarter mile of my location. This was with a few generations of iphones. I eventually gave up and got an external GPS receiver, which worked great until they stopped updating the associated app for newer generations of IOS. Now this is with actual GPS data, the cellular locating data tends to be more stable as long as you're in good coverage, though not as accurate. -Hans #### kjs ##### Well-Known Member TRF Supporter Typically the phone stuff also has a much slower refresh rate. I tried doing some telemetry during autocross with my phone GPS and found it nearly useless. It was refreshing too slowly, and accuracy was intermittent. At times I'd get a 5m accuracy, other times I'd be lucky if the phone saw me being within a quarter mile of my location. That is interesting.... I can say that when enabling the location tracking in a phone, there are different options for precision that can be used from 'finest' to much more coarse (because the finer resolution consumes the battery more). In one case I saw something about 3km accuracy and thought that was a little worthless. Anymore in these days though people plug their phones into their cars and use them for (successful) navigation so I would think they are much better now... #### cerving ##### Owner, Eggtimer Rocketry TRF Sponsor TRF Supporter GPS's give you a better fix the longer that you leave them on, the ones in cars and phones tend to stay powered on all the time (although they may be running in the background). The ones in rockets are generally not powered on until shortly before flight. That's one reason we got rid of the power switch on our transmitters... if you power it on first thing while you're prepping then you maximize the amount of time that the GPS has to find satellites and get a good quality fix. Turning it on right before you launch is not a good practice, unless you power it on ahead of time and put it into a "sleep" mode (which is what the original Eggfinder TX had, but we found out that it was not very workable in practice). #### manixFan ##### Not a rocket scientist I'd suggest checking more long term to see how stable the phone is. Typically the phone stuff also has a much slower refresh rate. I tried doing some telemetry during autocross with my phone GPS and found it nearly useless. It was refreshing too slowly, and accuracy was intermittent. At times I'd get a 5m accuracy, other times I'd be lucky if the phone saw me being within a quarter mile of my location. This was with a few generations of iphones. I eventually gave up and got an external GPS receiver, which worked great until they stopped updating the associated app for newer generations of IOS. Now this is with actual GPS data, the cellular locating data tends to be more stable as long as you're in good coverage, though not as accurate. -Hans The refresh rate of phones is the same as any other consumer grade GPS system - once per second. Tens of millions use their phones for real-time mapping and navigation every day without issue. If phone GPS was as bad is you indicate, how could it possibly be used for real-time highway navigation at speeds of 60 -80 mph? This study showed that the average error rate of an iPhone 6 was 7-13m on GPS only: Your experience seems to be limited by some other factor than your phone. Perhaps it was the app itself or the autocross environment - that fact that an external antenna solved the problem seems to indicate that may have been the issue.. But the idea that modern smartphones don't have sufficient GPS capabilities does not match with real world experience. Tony kjs #### HHaase ##### Well-Known Member I just know that I regularly have issues when I try to use my phones for navigation. When I was trying to locate my rocket last week, the app I was using would occasionally tell me I had 5m accuracy, but most of the time was bouncing between 250m and 5,000m. I ended up being about 100m away from the rocket when somebody else found it..... despite my phone telling me I was at the coordinates that my eggfinder gave me. My phone seems to work particularly bad in Minneapolis for some reason. It's always amusing when I travel for work and I arrive at my convention/training class/seminar while my phone is still telling me to take a left turn out of the hotel parking lot. I still carry a dumpy old Garmin GPS because it's simply more reliable for me than the three generations of iphone I've had. #### DankMemes ##### Well-Known Member TRF Supporter Depends on what you're looking for, if you're looking for somethings that's drop in and go for a tracker these are some good options, albeit pricey these are in the$400 range with all the accessories

Altus Metrum TeleGPS (Requires HAM License)

Apogee Simple Tracker

##### Member
I can solder, but not good at it. I might try the eggtimer or missleworks. Thanks all for the advice. Gives me some things to think about. I may end up getting my L1 first and then seeing what people are using at the launch. Much to decide.

#### DankMemes

##### Well-Known Member
TRF Supporter
Here’s some videos detailing the assembly of the eggfinder tx and receiver.

Will give you an idea of what that’s like and if you’d be interested. It’s doable just need some patience and a steady hand for the smaller surface mount components


text:
• # Learning How to write a 2D UFO game using the Orx Portable Game Engine - Part 4

General and Gameplay Programming

# Creating Pickup Objects

This is part 4 of a series on creating a game with the Orx Portable Game Engine. Part 1 is here, and part 3 is here.

In our game, the player will be required to collect objects scattered around the playfield with the ufo.

When the ufo collides with one, the object will disappear, giving the impression that it has been picked up.

Begin by creating a config section for the graphic, and then the pickup object:

[PickupGraphic]
Texture = pickup.png
Pivot   = center

[PickupObject]
Graphic = PickupGraphic

The graphic will use the image pickup.png which is located in the project's data/object folder.

It will also be pivoted in the center which will be handy for a rotation effect later.

Finally, the pickup object uses the pickup graphic. Nice and easy.

Our game will have eight pickup objects. We need a simple way to have eight of these objects in various places.

We will employ a nice trick to handle this. We will make an empty object, called PickupObjects which will hold eight copies of the pickup object as child objects.

That way, wherever the parent is moved, the children move with it.

[PickupObjects]
ChildList = PickupObject1 # PickupObject2 # PickupObject3 # PickupObject4 # PickupObject5 # PickupObject6 # PickupObject7 # PickupObject8
Position  = (-400, -300, -0.1)

This object will have no graphic. That's ok. It can still act like any other object.

Notice the position. It is being positioned in the top left hand corner of the screen. All of the child objects PickupObject1 to PickupObject8 will be positioned relative to the parent in the top left corner.

Now to create the actual children. We'll use the inheritance trick again, and just use PickupObject as a template:

[PickupObject1@PickupObject]
Position = (370, 70, -0.1)

[PickupObject2@PickupObject]
Position = (210, 140, -0.1)

[PickupObject3@PickupObject]
Position = (115, 295, -0.1)

[PickupObject4@PickupObject]
Position = (215, 445, -0.1)

[PickupObject5@PickupObject]
Position = (400, 510, -0.1)

[PickupObject6@PickupObject]
Position = (550, 420, -0.1)

[PickupObject7@PickupObject]
Position = (660, 290, -0.1)

[PickupObject8@PickupObject]
Position = (550, 150, -0.1)

Each of the PickupObject* objects uses the properties defined in PickupObject. And the only difference between them are their Position properties.

The last thing to do is to create an instance of PickupObjects in code in the Init() function:

orxObject_CreateFromConfig("PickupObjects");

Compile and Run.

Eight pickup objects should appear on screen. Looking good.

It would look good if the pickups rotated slowly on screen, just to make them more interesting. This is very easy to achieve in Orx using FX.

FX can also be defined in config.

FX allows you to affect an object's position, colour, rotation, scaling, etc, even sound can be affected by FX.

Change the PickupObject by adding a FXList property:

[PickupObject]
Graphic = PickupGraphic
FXList  = SlowRotateFX

Clearly being an FXList you can have many types of FX placed on an object at the same time. We will only have one.

An FX is a collection of FX Slots. FX Slots are the actual effects themselves. Confused? Let's work through it. First, the FX:

[SlowRotateFX]
SlotList = SlowRotateFXSlot
Loop     = true

This simply means, use some effect called SlowRotateFXSlot, and when it is done, do it again in a loop.

Next the slot (or effect):

[SlowRotateFXSlot]
Type       = rotation
StartTime  = 0
EndTime    = 10
Curve      = linear
StartValue = 0
EndValue   = 360

That's a few properties. First, the Type, which is a rotation FX.

The total time for the FX is 10 seconds, which comes from the StartTime and EndTime properties.

The Curve type is linear so that the values changes are done so in a strict and even manner.

And the values which the curve uses over the 10 second period starts from 0 and climbs to 360.

Re-run and notice the pickups now turning slowly for 10 seconds and then repeating.

# Picking up the collectable objects

Time to make the ufo collide with the pickups. In order for this to work (just like for the walls) the pickups need a body.

And the body needs to be set to collide with a ufo and vice versa.

First a body for the pickup template:

[PickupObject]
Graphic   = PickupGraphic
FXList    = SlowRotateFX
Body      = PickupBody

Then the body section itself:

[PickupBody]
Dynamic  = false
PartList = PickupPart

Just like the wall, the pickups are not dynamic. We don't want them bouncing and traveling around as a result of being hit by the ufo. They are static and need to stay in place if they are hit.

Next to define the PickupPart:

[PickupPart]
Type      = sphere
Solid     = false
SelfFlags = pickup
CheckMask = ufo

The pickup is sort of roundish, so we're going with a spherical type.

It is not solid. We want the ufo to able to pass through it when it collides. It should not influence the ufo's travel at all.

The pickup is given a label of pickup and will only collide with an object with a label of ufo.

The ufo must reciprocate this arrangement (just like a good date) by adding pickup to its list of bodypart check masks:

[UfoBodyPart]
Type      = sphere
Solid     = true
SelfFlags = ufo
Friction  = 1.2
CheckMask = wall # pickup

This is a static bodypart, and we have specified collision actions to occur if the ufo collides with a pickup. But it's a little difficult to test this right now. However you can turn on the debug again to check the body parts:

[Physics]
Gravity   = (0, 0, 0)
ShowDebug = true

Re-run to see the body parts.

Switch off again:

[Physics]
Gravity   = (0, 0, 0)
ShowDebug = false

To cause a code event to occur when the ufo hits a pickup, we need something new: a physics hander. The hander will run a function of our choosing whenever two objects collide.

We can test for these two objects to see if they are the ones we are interested in, and run some code if they are.

First, add the physics hander to the end of the Init() function:

orxClock_Register(orxClock_FindFirst(orx2F(-1.0f), orxCLOCK_TYPE_CORE), Update,
orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_NORMAL);
orxEvent_AddHandler(orxEVENT_TYPE_PHYSICS, PhysicsEventHandler);

This will create a physics handler, and should any physics event occur, (like two objects colliding) then a function called PhysicsEventHandler will be executed.

Our new function will start as:

orxSTATUS orxFASTCALL PhysicsEventHandler(const orxEVENT *_pstEvent)
{

orxOBJECT *pstRecipientObject, *pstSenderObject;

/* Gets colliding objects */
pstRecipientObject = orxOBJECT(_pstEvent->hRecipient);
pstSenderObject = orxOBJECT(_pstEvent->hSender);

const orxSTRING recipientName = orxObject_GetName(pstRecipientObject);
const orxSTRING senderName = orxObject_GetName(pstSenderObject);

orxLOG("Object %s has collided with %s", senderName, recipientName);

return orxSTATUS_SUCCESS;
}
}

Every handler function passes an orxEVENT object in. This structure contains a lot of information about the event.

The eID is tested to ensure that the type of physics event that has occurred is a orxPHYSICS_EVENT_CONTACT_ADD which indicates when objects collide.

If true, then two orxOBJECT variables are declared, then set from the orxEVENT structure. They are passed in as the hSender and hRecipient objects.

Next, two orxSTRINGs are declared and are set by getting the names of the objects using the orxObject_GetName function. The name that is returned is the section name from the config.

Potential candidates are: UfoObject, BackgroundObject, and PickupObject1 to PickupObject8.

The names are then sent to the console.

Finally, the function returns orxSTATUS_SUCCESS which is required by an event function.

Compile and run.

If you drive the ufo into a pickup or the edge of the playfield, a message will display on the console. So we know that all is working.

Next is to add code to remove a pickup from the playfield if the ufo collides with it. Usually we could compare the name of one object to another and perform the action.

In this case, however, the pickups are named different things: PickupObject1, PickupObject2, PickupObject3… up to PickupObject8.

So we will need to actually just check if the name contains “PickupObject” which will match well for any of them.

In fact, we don't need to test for the “other” object in the pair of colliding objects. Ufo is a dynamic object and everything else on screen is static. So if anything collides with PickupObject*, it has to be the ufo. Therefore, we won't need to test for that.

First, remove the orxLOG line. We don't need that anymore.

Change the function to become:

orxSTATUS orxFASTCALL PhysicsEventHandler(const orxEVENT *_pstEvent)
{

orxOBJECT *pstRecipientObject, *pstSenderObject;

/* Gets colliding objects */
pstRecipientObject = orxOBJECT(_pstEvent->hRecipient);
pstSenderObject = orxOBJECT(_pstEvent->hSender);

const orxSTRING recipientName = orxObject_GetName(pstRecipientObject);
const orxSTRING senderName = orxObject_GetName(pstSenderObject);

if (orxString_SearchString(recipientName, "PickupObject") != orxNULL) {
}

if (orxString_SearchString(senderName, "PickupObject") != orxNULL) {
}
}

return orxSTATUS_SUCCESS;
}

You can see the new code additions after the object names.

If an object name contains the word “PickupObject”, then the ufo must have collided with it. Therefore, we need to kill it off. The safest way to do this is by setting the object's lifetime to 0.

This will ensure the object is removed instantly and deleted by Orx in a safe manner.

Notice that the test is performed twice. Once, if the pickup object is the sender, and again if the object is the recipient.

Therefore we need to check and handle both.

Compile and run.

Move the ufo over the pickups and they should disappear nicely.

We'll leave it there for the moment. In the final, Part 5, we'll cover adding sounds, a score, and winning the game.

Report Article

## User Feedback

There are no comments to display.

## Create an account

Register a new account

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 2
• 0
• 0
• 0
• 43

• 11
• 15
• 14
• 46
• 22
• ### Similar Content

• By SIr Pep
I have been making my game 2d in Unity and almost immediately came upon this 2D tile rendering issue.
All I've found online, and am using, is a hack to fix it which includes separating them all, and in some cases drawing lines in between every single tile to match colors.
I'm wondering if anyone else has this issue and how to fix it.
Also, @CrazyCdn here's what I meant. You see streaks across the tiles that shoudn't be there.

Also, here's a youtube video of that exact problem

• By datboi
Hello everyone. I have been trying to make a font renderer that uses freetype for the past couple of days but am currently stuck with getting uv tex values when rendering.
Here is the current code I use
struct SVertex { SVector4f        pos;     Color32           col;     SVector2f        tex; }; // D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 float CDisplayFont::DrawTextA( const char * szText, int textCount, const SVector2f& pos, const SColor & color, const SRectf * pClipRect ) {     SVector2f tmp = ( pos ); IRender * pRender = g_pCore->GetGraphics()->GetRender();          for ( int i = 0; i < textCount; ++i )     {         Codepoint_t cp = static_cast< Codepoint_t >( szText[ i ] );         if ( GlyphInfo_t * info = GetGlyphInfo( cp ) )         {             if ( szText[ i ] != ' ' )             {                 float sx = tmp.x + info->offsetX * m_fScaleHoriz;                 float sy = tmp.y - ( info->height - info->offsetY ) * m_fScaleVert;                 float w = info->width * m_fScaleHoriz;                 float h = info->height * m_fScaleVert;                                                      // column (u) and row (v) number                 // -- heres where i'm stuck                 float u = 0;                 float v = 0;             SVertex vtx[ ] =                 {                     { sx,     sy + h, 0.0f, 1.f, color, u, v },                     { sx,     sy,     0.0f, 1.f, color, u, v },                     { sx + w, sy + h, 0.0f, 1.f, color, u, v },                     { sx + w, sy,     0.0f, 1.f, color, u, v },                     { sx + w, sy + h, 0.0f, 1.f, color, u, v },                     { sx,     sy,     0.0f, 1.f, color, u, v }                 };             //   arguments ->    ( rl, vtx data, vtx count, topology, texture (IDirect3DTexture9) )                 pRender->PushVertices( NULL, vtx, 6, D3DPT_TRIANGLELIST, info->texture->GetInternalPtr() );                 }                 tmp.x += ( float )( info->advance >> 6 ) * m_fScaleHoriz;                 }     }          return tmp.x; } This obviously prints nothing because I am stuck on how exactly I should be getting the correct u & v coords.
I have confirmed that I am getting the correct texture by saving the IDirect3DTexture9 to a file, getting stuff like this - https://imgur.com/a/Lwl2Xws

I appreciate any advice/pointers in the right direction, thank you.
• By Ocarinha
I'm developing an engine for a 2D game in C ++ and for some days I've been looking for a way to protect the images and audio of my future game. I know there is no 100% protection and that someone would be able to open these files, but I mean the regular user who just installed the game, prevent it from modifying the sprites, change the sound, overwrite the xml files with game map data.
I downloaded some games made in Unity and noticed that a .assets extension is used, in Diablo 2 it is used .ma0, .mpq, .data, in FEZ .pak, in Super Meat Boy only a .tp file. In other words, you can not open and edit any of these files in a text editor or unzip with winrar, they offer a minimum level of protection. How is this done? Do I have to create my own binary file format or is there any program that makes it easier to work?

• First major update for bs::framework has launched. The update includes a brand new particle system, decals, various renderer enhancements and over 150 other new additions and changes!
General information
bs::framework is a C++ game development framework that aims to provide all the low-level systems and features you need for the development of games, tools or engines. It was built from the ground up to replace older similar libraries.
It provides a modern API through C++14, provide extensive documentation and a cleaner, more extensible design. While also focusing on high performance with its heavily multi-threaded core, and use of modern technologies such as Vulkan and physically based rendering.
www.bsframework.io

View full story
×