text:
## Visualisation of irrational numbers as vectors

### Beauty in irrationality?

Plotting irrational numbers (pi, e, sqrt2, golden ratio) as vectors allows their complexity to be visualised

I have always wanted to visualise irrational numbers. Our brains are capable of recognising patterns in nature and I wanted to know if these patterns could be visualised in irrational numbers, and whether beautiful patterns could be seen that could lead to an further understanding of the irrational nature of the numbers. Just found out after publishing this article that the idea has been round for a while! (here is an interesting blog article). Here I have extended the technique to 3 dimensions for better visualisation and give results and computer code.

### Experimental Technique

In this experiment the fractional parts of the irrational numbers, pi, e, sqrt2 and golden ratio are transformed into vectors in cartesian space for visualisation purposes. Each digit of the number sequence (from left to right) is transformed into a spatial vector with unit length. The orientation is calculated from the number as: angle = (digit/10)*2*pi. Sine and cosine functions are used to derive a position in the cartesian plane relative to the position of the previous digit (see code below for more details). As the irrational number is described to greater precision its decimal place increases, this occurs on the number string from left to right. As we are traversing the number sequence this corresponds to increasing time steps of the number analysis. On the plots the sequence position of the digit (its decimal place) is colour coded using a heat mapping (blue->red on increasing significant digits). The 3D plots also gives the sequence position of the digit on the Z axis, this helps to separate overlapping sequences in cartesian space.

### Visualisation/Results

These plots are the results of the analysis, please click them for more detail

### Data and Matlab/Octave computer code

Below is the Matlab/Octave code used for generating the plots. Data can be downloaded here: pi, e, golden ratio, sqrt2 (data is without decimal point!)

function  irrational_number_plot_as_vector(filepathname)
%   requires file name containing string of irrational number delete decimal point from string ie 3.14... -> 314...

% read text file containing number
format = "%1c"

fileID = fopen('pi.txt','r');

p = fscanf(fileID, format);

_p=0;

% convert character string to matlab array
for i=1:length(p); _p(i)  = str2double(strcat(p(i),".0")); end

% create arrays for plotting
x_array = zeros(1,length(_p));
y_array = zeros(1,length(_p));

% polar angle
for i=2:length(_p); x_array(i) = x_array(i-1)+cos((_p(i-1)/10.0)*2.0*pi); y_array(i) = y_array(i-1)+sin((_p(i-1)/10.0)*2.0*pi); end

% surface plot with z axis and colour blue->red as increased fractional part
h = surface([x_array(:), x_array(:)], [y_array(:), y_array(:)], [[1:length(_p)]', [1:length(_p)]'], [[1:length(_p)]', [1:length(_p)]'], 'EdgeColor','flat', 'FaceColor','none');

end

## Understanding mortgages/loans

### How mortgages or loans companies make money from you

In our mortgage example we are going to borrow 140,000 pounds at an interest of 6.5% annually for a term lasting 30 years. The main calculation will be how much of the principal (amount borrowed is paid back every month). For this we will use the annuity formula, where r is the monthly interest rate expressed as a decimal (r=yearly_rate/12/100), P is the principal or the amount borrowed and N the number of months in the full term.

c=(r*P)/((1-(1+r)^-N))

Using this formula we can calculate our monthly payment (c=885 pounds). The other formula we need is for the debt schedule which tells us how much of the principal gets paid off every month which we will term p.

p=((1+r)*P’)-c

Where P’ is the previous months outstanding amount (p) which at the beginning of the term will be equal to P (More information on the formulas used can be found here).

I have generated a few plots from the formulas given above to try to demonstrate what happens to your money when you pay back a mortgage or loan. For example the plot of p vs N below shows a typical repayment curve for the borrowed money

You can see in this figure that the amount of the capital that you pay back in the beginning years is not much with most of the money being spent paying back the interest. This means that if you move early on in the term you wont get much money back from the mortgage, therefore it is better if possible to hang in there until the full term has ended.

The next figure shows the proportions of the monthly mortgage payment split between capital and interest payments as the mortgage progresses. It actually takes 19 years 4 months before capital payments are greater than the interest payments in a 30 year mortgage.

The final figure shows just how much extra money is made from lending the money and which proportion of this is interest or capital repayment. You actually pay more money towards interest than you do towards capital and the total money spent during the mortgage term is more than double the money borrowed.

Thank you Wikkipedia, Gnumeric and MathJax

## Tutorial using Matlab to show how to perform transforms in 3D from one coordinate system to another

For real world vision or Robotic operations it is sometimes necessary to transform between coordinates in different coordinate systems. In this tutorial we will transform a 3D spiral from one coordinate system to another. The coordinate systems are specified in terms of their position in Cartesian space and converted to a vectorial representation.

First let us create and display the spiral

t = 0:pi/50:10*pi;
st = sin(t);
ct = cos(t);

The spiral is in 3D but we need a 4D matrix to perform the matrix transformations, so we also add a row of ones to it

spiral = [st; ct; t; ones(501,1)']

Ok, lets plot the relevant data

plot3(spiral(1,:), spiral(2,:), spiral(3,:), 'b')

we use the hold on command to keep plotting to the same chart

hold on

We are going to translate this spiral from its world coordinates to another local coordinate system

the coordinates are specified by a matrix = [X1, X2, X3, Y1, Y2, Y3, Z1, Z2, Z3]

world = [1,0,0;0,1,0;0,0,1]
local = [3,6,3;3,3,6;3,3,0]

The 3,3,0 in the last row (Z axis) of the matrix creates a 45 degree plane

Lets turn our local coordinate system into a vector

local_vector = zeros(3,3)
local_vector(:,1) = local(:,2)-local(:,1)
local_vector(:,2) = local(:,3)-local(:,1)
local_vector(:,3) = cross(local_vector(:,1),local_vector(:,2))

The vectors should be normalised to unit length like our world vector is

local_vector(:,1) = local_vector(:,1)/norm(local_vector(:,1))
local_vector(:,2) = local_vector(:,2)/norm(local_vector(:,2))
local_vector(:,3) = local_vector(:,3)/norm(local_vector(:,3))

Now we have to create our transform matrix using the dot product between our world and local vectors, this sets up the skew, reflection, rotation elements

transform = zeros(4,4)
transform(1,1) = dot(world(1,:), local_vector(1,:))
transform(1,2) = dot(world(1,:), local_vector(2,:))
transform(1,3) = dot(world(1,:), local_vector(3,:))
transform(2,1) = dot(world(2,:), local_vector(1,:))
transform(2,2) = dot(world(2,:), local_vector(2,:))
transform(2,3) = dot(world(2,:), local_vector(3,:))
transform(3,1) = dot(world(3,:), local_vector(1,:))
transform(3,2) = dot(world(3,:), local_vector(2,:))
transform(3,3) = dot(world(3,:), local_vector(3,:))

we also add the translated origin of our coordinate system to the last column of the matrix, this performs the X,Y,Z translation

transform(1,4) = local(1,1)
transform(2,4) = local(2,1)
transform(3,4) = local(3,1)
transform(4,4) = 1

So using our transform we can rotate the spiral by 45 degrees and translate it by 3 in X and 3 in Y

tspiral = transform*spiral;

let’s plot it in green next to the original spiral

plot3(tspiral(1,:), tspiral(2,:), tspiral(3,:), 'g')

(you might want to rotate the plot axis now to see the two spirals in 3D)

now to get it back again we use the inverse of our transformation matrix

tunspiralInv = inv(transform)*tspiral;

and plot it using markers so we can see the orginal spiral beneath

plot3(tunspiralInv(1,:), tunspiralInv(2,:), tunspiralInv(3,:), ‘r*’)

The plot should look like this

For the mathematical details behind the transform, these MIT lecture notes provide an excellent explanation.

If you find the article useful, please feel free to post a link to it


text:
# Bridge interface

A bridge should implement the following functions to be usable by a bridge optimizer:

MathOptInterface.Bridges.Variable.concrete_bridge_typeFunction
concrete_bridge_type(
BT::Type{<:AbstractBridge},
S::Type{<:MOI.AbstractSet},
)::Type

Return the concrete type of the bridge supporting variables in S constraints. This function can only be called if MOI.supports_constrained_variable(BT, S) is true.

Examples

As a variable in MathOptInterface.GreaterThan is bridged into variables in MathOptInterface.Nonnegatives by the VectorizeBridge:

MOI.Bridges.Variable.concrete_bridge_type(
MOI.Bridges.Variable.VectorizeBridge{Float64},
MOI.GreaterThan{Float64},
)

# output

MathOptInterface.Bridges.Variable.VectorizeBridge{Float64, MathOptInterface.Nonnegatives}
MathOptInterface.Bridges.Variable.bridge_constrained_variableFunction
bridge_constrained_variable(
BT::Type{<:AbstractBridge},
model::MOI.ModelLike,
set::MOI.AbstractSet,
)

Bridge the constrained variable in set using bridge BT to model and returns a bridge object of type BT. The bridge type BT should be a concrete type, that is, all the type parameters of the bridge should be set. Use concrete_bridge_type to obtain a concrete type for given set types.

constraint bridges should implement:

MathOptInterface.supports_constraintMethod
MOI.supports_constraint(
BT::Type{<:AbstractBridge},
F::Type{<:MOI.AbstractFunction},
S::Type{<:MOI.AbstractSet},
)::Bool

Return a Bool indicating whether the bridges of type BT support bridging F-in-S constraints.

MathOptInterface.Bridges.Constraint.concrete_bridge_typeFunction
concrete_bridge_type(
BT::Type{<:AbstractBridge},
F::Type{<:MOI.AbstractFunction},
S::Type{<:MOI.AbstractSet}
)::Type

Return the concrete type of the bridge supporting F-in-S constraints. This function can only be called if MOI.supports_constraint(BT, F, S) is true.

Examples

MOI.Bridges.Constraint.concrete_bridge_type(
MOI.Bridges.Constraint.SplitIntervalBridge{Float64},
MOI.VariableIndex,
MOI.Interval{Float64},
)

# output

MathOptInterface.Bridges.Constraint.SplitIntervalBridge{Float64, MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}, MathOptInterface.GreaterThan{Float64}, MathOptInterface.LessThan{Float64}}
MathOptInterface.Bridges.Constraint.bridge_constraintFunction
bridge_constraint(
BT::Type{<:AbstractBridge},
model::MOI.ModelLike,
func::AbstractFunction,
set::MOI.AbstractSet,
)

Bridge the constraint func-in-set using bridge BT to model and returns a bridge object of type BT. The bridge type BT should be a concrete type, that is, all the type parameters of the bridge should be set. Use concrete_bridge_type to obtain a concrete type for given function and set types.

and objective bridges should implement:

MathOptInterface.Bridges.Objective.concrete_bridge_typeFunction
concrete_bridge_type(
BT::Type{<:MOI.Bridges.Objective.AbstractBridge},
F::Type{<:MOI.AbstractScalarFunction},
)::Type

Return the concrete type of the bridge supporting objective functions of type F. This function can only be called if MOI.supports_objective_function(BT, F) is true.

MathOptInterface.Bridges.Objective.bridge_objectiveFunction
bridge_objective(
BT::Type{<:MOI.Bridges.Objective.AbstractBridge},
model::MOI.ModelLike,
func::MOI.AbstractScalarFunction,
)

Bridge the objective function func using bridge BT to model and returns a bridge object of type BT. The bridge type BT should be a concrete type, that is, all the type parameters of the bridge should be set. Use concrete_bridge_type to obtain a concrete type for a given function type.

When querying the NumberOfVariables, NumberOfConstraints ListOfVariableIndices, and ListOfConstraintIndices, the variables and constraints created by the bridges in the underlying model are hidden by the bridge optimizer. For this purpose, the bridge should provide access to the variables and constraints it has created by implementing the following methods of get:

MathOptInterface.getMethod
MOI.get(b::AbstractBridge, ::MOI.NumberOfVariables)

The number of variables created by the bridge b in the model.

MathOptInterface.getMethod
MOI.get(b::AbstractBridge, ::MOI.ListOfVariableIndices)

The list of variables created by the bridge b in the model.

MathOptInterface.getMethod
MOI.get(b::AbstractBridge, ::MOI.NumberOfConstraints{F, S}) where {F, S}

The number of constraints of the type F-in-S created by the bridge b in the model.

MathOptInterface.getMethod
MOI.get(b::AbstractBridge, ::MOI.ListOfConstraintIndices{F, S}) where {F, S}

A Vector{ConstraintIndex{F,S}} with indices of all constraints of type F-inS created by the bride b in the model (i.e., of length equal to the value of NumberOfConstraints{F,S}()).

# SetMap bridges

Implementing a constraint bridge relying on linear transformation between two sets is easier thanks to the SetMap interface. The bridge simply needs to be a subtype of [Bridges.Variable.SetMapBridge] for a variable bridge and [Bridges.Constraint.SetMapBridge] for a constraint bridge and the linear transformation is represented with Bridges.map_set, Bridges.map_function, Bridges.inverse_map_set, Bridges.inverse_map_function, Bridges.adjoint_map_function and Bridges.inverse_adjoint_map_function. Note that the implementing last 4 methods is optional in the sense that if they are not implemented, bridging constraint would still work but some features would be missing as described in the docstrings. See [L20, Section 2.1.2] for more details including [L20, Example 2.1.1] that illustrates the idea for Bridges.Variable.SOCtoRSOCBridge, Bridges.Variable.RSOCtoSOCBridge, Bridges.Constraint.SOCtoRSOCBridge and Bridges.Constraint.RSOCtoSOCBridge.

[L20] Legat, Benoît. Set Programming: Theory and Computation. PhD thesis. 2020.

format: plain


text:
# Question 7ba62

Nov 6, 2015

$\text{355 mg}$

#### Explanation:

Parts per million, or ppm, are used when dealing with very small concentrations of solute.

In simple terms, a concentration of one ppm is equivalent to one part solute per ${10}^{6}$ parts solvent.

$\textcolor{b l u e}{\text{ppm" = "mass of solute"/"mass of solvent} \times {10}^{6}}$

You can assume that one liter of rain water has a density of approximately ${\text{1 g/cm}}^{3}$. Keeping in mind that you have

${\text{1 L" = "1 dm"^3 = 10^3"cm}}^{3}$

you can say that one liter of rain water will have a mass of

1color(red)(cancel(color(black)("L"))) * "1 g"/(1color(red)(cancel(color(black)("cm"^3)))) * (10^3color(red)(cancel(color(black)("cm"^3))))/(1color(red)(cancel(color(black)("dm"^3)))) = 10^3"g"

So, you know that if you take the ratio between the mass of the solute and the mass of the solvent, and multiply the result by ${10}^{6}$, you get the concentration in ppm.

$\text{ppm" = m_(CO_2)/m_"water} \times {10}^{6}$

This means that the mass of the solute can be determined by rearranging the equation

${m}_{C {O}_{2}} = \frac{\text{ppm" xx m_"water}}{10} ^ 6$

m_(CO_2) = (355 * 10^3"g")/10^6 = 355 * 10^(-3)"g"#

If you want, you can express this value in miligrams

${m}_{C {O}_{2}} = \textcolor{g r e e n}{\text{355 mg}}$


text:
1. A hard riddle!

Hello there!

I didn't manage to solve a specific math riddle (anyway, i'm not a maths freak), maybe you can, so here it is:

where you can notice that:
An=n
Cn=An+Bn
Σ Cn= Σ odd Cn + Σ even Cn

The "odd Cn" and "even Cn" columns must be filled respectively with odd results of An+Bn and even results of An+Bn
For instance: If the result of A6+B6 is even, place the result in "Even Cn" column in the 6th line, and you put a 0 at the "Odd Cn" column in the same line.
if the result is odd, it's the other way round.

Warning: An, Bn and Cn are natural numbers (zero excluded) !
And the result of Σ odd Cn must be also an odd number.

However , the terms B1, B2, B3, B4, ect... -of the sum ΣBn- have not to be increasing or decreasing numbers.

Accepting these instructions, how do you proceed to determine n max and replace B1, B2, B3, ect.. with number in such manner we get
ΣAn= Σ odd Cn and ΣBn= Σ even Cn at the same time?

Good luck!

2. Nice try, snowtea! but Bn can never be equal to 0, for all n,
as my instruction said, it must be a natural number.

Sorry for this ambiguity because there are 2 kinds of natural numbers, the one including 0 and another excluding 0.
I intended to deal with the second one.

3. Originally Posted by termina
Hello there!

I didn't manage to solve a specific math riddle (anyway, i'm not a maths freak), maybe you can, so here it is:

where you can notice that:
An=n
Cn=An+Bn
Σ Cn= Σ odd Cn + Σ even Cn

The "odd Cn" and "even Cn" columns must be filled respectively with odd results of An+Bn and even results of An+Bn
For instance: If the result of A6+B6 is even, place the result in "Even Cn" column in the 6th line, and you put a 0 at the "Odd Cn" column in the same line.
if the result is odd, it's the other way round.

Warning: An, Bn and Cn are natural numbers (zero excluded) !
And the result of Σ odd Cn must be also an odd number.

However , the terms B1, B2, B3, B4, ect... -of the sum ΣBn- have not to be increasing or decreasing numbers.

Accepting these instructions, how do you proceed to determine n max and replace B1, B2, B3, ect.. with number in such manner we get
ΣAn= Σ odd Cn and ΣBn= Σ even Cn at the same time?

Good luck!
Riddle me this, riddle me that,
Based on how this question is asked,
It appears to come from an assignment
That counts for a final grade. Sorry to say,
We don't help people do that thing they call cheating.

Poetry isn't my thing, but I can tell you this:
If you can prove to me this isn't an assignment
That counts for a final grade, then I will reopen the thread.
But until that time comes,


text:
(13 votes, average: 5.00 out of 5)

## Project Euler 15: Find the number of routes from the top left corner to the bottom right corner in a rectangular grid.

#### Problem Description

Starting in the top left corner of a 2×2 grid, there are 6 routes (without backtracking) to the bottom right corner.

How many routes are there through a 20×20 grid?

#### Analysis

This question has been posed as: "Starting at the top left corner, how many ways through town are possible using only one-way streets and ending at the bottom right corner of a n x n grid?"

Another analogy might be: "Place a single rook on the top left corner of an empty chess board and count the number of tours to the bottom right corner moving only left and down." This would assume an 8 × 8 grid.

Determining the number of routes for a square grid (n × n) is the central binomial coefficient or the center number in the 2nth row of Pascal's triangle.

${2n \choose n} = \frac{(2n)!}{n!~\times~n!}~.$

The formula in general for any rectangular grid (n × m) using the notation for the binomial coefficient is:

${n+m \choose n} = \frac{(n~+~m)!}{n!~\times~m!}~.$

Any combination using nDowns(D) and mRights(R) would be a valid move.

In the example provided in the problem description there would be (2 + 2)! or 24 possible moves, but many would be indistinguishable, and we would have to divide by (2! × 2!) to eliminate them. So, (2 + 2)! / (2! × 2!) = 24 / 4 = 6. Namely, RRDD, RDRD, RDDR, DRRD, DRDR and DDRR. By indistinguishable we mean DDR1R2 is the same move as DDR2R1.

#### Project Euler 15 Solution

Runs < 0.001 seconds in Python 2.7.
from Euler import factorial as fact, binomial

n, m = 20, 20
# method 1, n == m, square grid, central number in row 2*n of Pascal's triangle
if n == m:
print "Project Euler 15 Solution (square grid) =", binomial(2*n, n)

# method 2, n != m or n == m, rectangular grid
print "Project Euler 15 Solution (rectangular grid) =", fact(n+m) / (fact(n)*fact(m))
Use this link to get the Project Euler 15 Solution Python 2.7 source.


text:
# Dimension too large on a PNG figure under xelatex and beamer

I have PNG image I want to introduce into my presentation. The figure is black and white and the edges are small. When I compile the file in pdflatex everything is fine but when I Compile it with xelatex I get !dimension too large error:

[1] <use  "./figs/surface.png" > [2]
! Dimension too large.
b
l.31 \end{frame}

The line I use:

  \includegraphics<2> [width=0.8\textwidth]{./figs/surface.png}\par

And the file:

Here is a MWE:

\documentclass[bigger]{beamer}
\begin{document}

\begin{frame}{Coarse-Grained (CG) simulation of a membrane}
\begin{columns}
\begin{column}{0.6\textwidth}
\includegraphics<2> [width=0.8\textwidth]{./figs/surface.png}\par
\includegraphics<3> [width=1.0\textwidth]{./figs/a_lipid_CG.jpg}
\end{column}
\begin{column}{0.4\textwidth}
\begin{itemize}
\item bla
\end{itemize}
\end{column}
\end{columns}
\end{frame}

\end{document}

Here are links to the used files: http://www.4shared.com/photo/EK4CPOF2/a_lipid_CG.html http://www.4shared.com/photo/un7JtzXa/surface.html

-
Make a complete example that demonstrates your error (I have a lot doubts that really the graphics itself is the problem) –  Ulrike Fischer Apr 8 '12 at 11:19
Using your image in both places I don't get any error. –  egreg Apr 8 '12 at 12:50
A complete example should start with \documentclass. And make sure that you make the real graphic available. –  Ulrike Fischer Apr 8 '12 at 13:36
@Yotam The error message makes it clear that the image ./figs/surface.png has been successively included and even shipped out (on page [2]). So the error must come later. –  Stephan Lehmke Apr 10 '12 at 8:40
The a_lipid_CG.jpg seems to cause the issue. I get the same error with \documentclass{beamer} \begin{document} \begin{frame} \includegraphics{a_lipid_CG.jpg} \end{frame} \end{document}. Note that the [1] <use "./figs/surface.png" > [2] is not part of the error message, but only a info message printed before it. –  Martin Scharrer Apr 10 '12 at 8:51

The a_lipid_CG.jpg seems to cause the issue. As explained below this specific JPG seems to be incompatible with XeTeX.

I get the same error with the following MWE:

\documentclass{beamer}
\begin{document}
\begin{frame}
\includegraphics{a_lipid_CG.jpg}
\end{frame}
\end{document}.

Note that the [1] <use "./figs/surface.png" > [2] is not part of the error message, but only a info message printed before it.

After running the JPG image through the conversion tool of Image Magick convert, i.e. convert a_lipid_CG.jpg a_lipid_CG2.jpg and testing the document with this new JPG file, the error disappears. This leads me to the conclusion that your particular JPG file is not fully compatible with XeTeX. Apparently XeTeX has issues reading the size from the meta-data from the JPG, which somehow leads to the "too-large" error.

To fix this please open the JPG file in an image manipulation program and save it again.

-
As an aside, I know that pdftex has issues with some JFIF headers, resulting in wrong resolution info and thus wrong image dimensions. For instance, it may be that the image has 300dpi, but pdftex doesn't get this info and assumes 72dpi, resulting in scaling the image too large. AFAIK, the source of the error lies in the xpdf library used by pdftex for image inclusion. There could also be issues with included thumbnails, i.e. the dimensions of the thumbnail are reported, but the whole image is output. Correct me if I'm wrong, this isn't really my area of expertise. –  Stephan Lehmke Apr 10 '12 at 9:40
I had to convert mine to a png to solve the problem. Very weird bug. –  Meekohi Dec 16 '14 at 18:39

Similarly to what @Martin-Scharrer said, convert/mogrify worked for me too, but only by explicitly adding a resolution, which seemed to have been missing. So the following fixed the problem (the files had been produced with matplotlib, btw):

mogrify -density 90 myfile.png

-
Thank you, this did for me too. Without specifying a resolution, it wouldn't go. –  Nikos Alexandris Nov 18 '14 at 11:04
Worked for me without resolution, although I was resizing which I wanted to do for other reasons: convert picture.jpg -resize 50% picture.png. I hoped that converting back to JPG using ImageMagic convert will give me a valid JPG, but it did not. However, JPG in general works for me with pdflatex. –  wenzeslaus Jun 30 at 3:05


text:
Inconsistent arithmetic of TimeSeries with non-equally spaced data?

Consider the following non-equally spaced TimeSeries:

ts = TimeSeries[
Prepend[ConstantArray[1, 99],
0], {Prepend[(100 + Range[99])/100, 0]}];
ListLinePlot[ts, PlotMarkers -> {Automatic, 12}]

Visually, geometry suggests the Mean ought to be roughly 3/4. However,

Mean[ts]
(*99/100*)

This is the same as Mean[ts["Values"]]. In other words, Mean is computed using the underlying values, assuming they're equally spaced... even if they're not.

In contrast, Mean@TimeSeriesResample@ts returns $149/200\approx 3/4$. By resampling with equal spacing, which roughly corresponds to applying Mean to the underlying continuous interpolating function, we get the expected result.

As a result, my initial hypothesis of how functions are applied to TimeSeries was f_[t_TimeSeries]:=f_[t["Values"]].

Now consider Differences, which provides a counterexample:

Differences[ts]["Values"][[1 ;; 3]]
(*{1/101, 1/101, 0}*)

Differences[ts["Values"]][[1 ;; 3]]
(*{1, 0, 0}*)

Unlike Mean, it appears Differences of a TimeSeries somehow takes into account the spacing of the datapoints.

So my question is:

• Is there a consistent rule for how functions (such as Mean or Differences) are computed for TimeSeries with unequally-spaced data?

Personally, my intuition is that applying a function to a TimeSeries ought to roughly correspond to applying that function to the underlying InterpolatingFunction of the data. However, that's debatable, and Mean clearly wasn't implemented that way.

This has caused some unexpected results while I was working with unequally-spaced TimeSeries.

1/2 NIntegrate[ts[t], {t, 0, 2}]


text:
# I A proper Thermodynamic system

1. Nov 11, 2016

### MathematicalPhysicist

I have this question that in it there's this expression "A proper Thermodynamic system".

I thought that means that the first law (or is it the second) that $dS \ge 0$, i.e. the change of entropy always increase.

But I am not sure, can someone clear to me this matter?

2. Nov 11, 2016

### Khashishi

Have you tried looking it up? Your question can be answered in a second of searching on the internet.

3. Nov 11, 2016

### MathematicalPhysicist

I tried searching google, and didn't find the exact phrasing:"A proper Thermodynamic system" then what is it?

4. Nov 11, 2016

### Khashishi

I guess I didn't understand your question. I thought you were confused by what the first and second laws of thermodynamics are, since you got them mixed up above. You still should look them up for that reason.
I think you are expecting a technical definition for "proper thermodynamic system", when it just means proper "thermodynamic system", where proper is just a non-technical English word, and thermodynamic system is just a system that obeys thermodynamics, which is basically anything that isn't some make-believe model.

5. Nov 11, 2016

### MathematicalPhysicist

I have this question which I don't know how to start with and the teacher assistant isn't well responsive in the email.

Maybe you know better than me:

We have: the equations of system: $u =3/2 pv , p=av T^n$, I first was ask to find $T(u,v), p(u,v)$ which I found ($n$ is an integer and $a$ some constant).
Now I am asked to find for which values of $n$ is the system a proper theormodynamic system?

I thought of using $dS \ge 0$ in the end I got that: $n \ge constant/ (av^3 \ln T)$, I thought that since should be valid for every $T>0$ then when $T\ to \infty$ we get: $n \ge 0$, but I am not sure.

Do you know of this problem before?
I searched my reference with no help.


text:
## After CSC’16 (cont’): The best paper

Now that the Proceedings of the CSC Workshop 2016 has appeared (link), we can look at the papers. In this post, we are going to look at the best paper by Manne, Naim, Lerring, and Halappanavar, “On stable marriages and greedy matchings” (doi).

As noted in the citation of the award, this paper brings together  recent half-approximation algorithms  for  weighted matchings  and the classical  Gale-Shapley and McVitie-Wilson algorithms for the Stable Marriage problem. This is helpful in two ways.

First, the authors show that a  recent half-approximation algorithm for computing greedy matchings, the Suitor algorithm and its variants,  is equivalent to  the classical algorithms for the Stable Marriage problem. This correspondence enables the authors to propose multi-core and many-core parallel algorithms for the Stable Marriage problem, based on the greedy matching algorithms. This way, if I am not mistaken, they develop the first GPU algorithm for the Stable Marriage problem.

Second, the extensive theoretical work on the Stable Marriage algorithms  explains the  behavior of the Suitor matching algorithm. The worst-case number of proposals in the Suitor algorithm can be $O(n^2)$,  where n is the number of vertices  in the bipartite graph. However, if the weights are assigned randomly, the expected number of proposals is $O(n \log n)$, which follows from a classical analysis of Donald Knuth [1, 2].

This work represents a nice marriage between theory and practice: the practical algorithms for the greedy matching help in designing parallel algorithms for the Stable Marriage problem, and the theoretical understanding of the Stable Marriage problem sheds light into the behavior of the greedy weighted matching algorithms.

### Vocabulary

Stable marriage problem: This is described on a full bipartite graph $G=(L\cup R, L\times R)$.  Each vertex on the left has a total ranking of the vertices on the right; similarly each vertex on the right has a total ranking of all vertices on the left. The aim is to find a matching $M$ such that no $l\in L$ and $r\in R$  would obtain a higher ranked partner if they were to abandon their current partners in $M$ and rematch with each other.

Greedy matching algorithm: Here we compute approximations to matchings of maximum  weight in weighted graphs. The Greedy algorithm  considers edges in a non-increasing order of weights and the heaviest remaining edge $(u,v)$ is added to the matching, whereupon all edges incident on $u$ and $v$ are removed. The Greedy matching is a half-approximate matching.

Suitor algorithm: This is a proposal based algorithm [3]. Vertices can propose in any order, however, each vertex proposes to a neighbor with the  heaviest weight  that already does not have a better weight offer to match with it.  A vertex could annul the proposal received by a neighbor if it has a better weight edge to offer the neighbor.  When two vertices propose to each other, they are matched. The Suitor algorithm computes the same matching as the one obtained by the Greedy algorithm and the Locally Dominant edge algorithm described by Robert Preis [4]!

### References

1. Vicki Knoblauch, Marriage matching: A conjecture of Donald Knuth, Economics Working Papers. Paper 200715, http://digitalcommons.uconn.edu/econ_wpapers/200715, 2007.
2. Donald E. Knuth, Stable Marriage and its Relation to Other Combinatorial Problems, CRM Proceedings and Lecture Notes, Vol. 10 American Mathematical Society, (1997).
3. Fredrik Manne and Mahantesh Halappanavar, New effective multithreaded matching algorithms, in Proc. IPDPS 2014, IEEE 28th International Parallel and Distributed Processing Symposium, Phoenix, AZ, USA, pp. 519–528, 2014.
4. Robert Preis, Linear time $1/2$-approximation algorithm for maximum weighted matching in general graphs, in Proc. STACS 99, 16th Annual Symposium on Theoretical Aspects of Computer Science Trier, Germany, pp. 259–269, 1999.

## After CSC16

CSC16 was held last week. Kudos to Assefaw and Erik as the chair of the workshop.

There are so much to talk about. We will have a series of posts about the workshop and related things. Here are some bits and pieces.

The workshop had three invited talks, 19 contributed talks, and eight posters, and attended by 60+ people. There will be a proceedings with 11 papers. The proceedings will be published by SIAM and will be hosted at its publication platform.

We had also celebrated the 60th birthdays of Alex Pothen and Rob Bisseling.

There was a best paper award. It went to Fredrik Manne, Md. Naim, Håkon Lerring, and Mahantesh Halappanavar for their paper titled On Stable Marriages and Greedy Matching. Congratulations. The citation by the best paper award committee (Uwe Naumann, Alex Pothen, and Sivan Toledo) reads as:

for the way the paper brings together several decades of work on stable marriages with the more recent work on approximation algorithms for weighted matchings, and the consequences for the average case complexity of the latter algorithms.

A heads up: the CSC18 meeting will likely be in Bergen, Norway. Erik cracked a joke about this in saying that the best paper awardees should take on organizing the next meeting.

## A recent survey on direct methods

I have just read a recent survey by

Timothy A. Davis, Sivasankaran Rajamanickam, and Wissam Sid-Lakhdar,“A survey of direct methods for sparse linear systems (link)”. The authors state their goal in the abstract:

The goal of this survey article is to impart a working knowledge of the underlying theory and practice of sparse direct methods for solving linear systems and least-squares problems, and to provide an overview of the algorithms, data structures, and software available to solve these problems, so that the reader can both understand the methods and know how best to use them.

I have very much appreciated the breadth of the survey. It reviews the earlier work on methods for the classical problems (e.g., LU, QR, Cholesky factorizations) and gives the context of the recent work  (e.g., GPU acceleration of the associated software; most recent problems of updating/downdating; exploiting low-rank approximations for efficiency).

One of the most impressive parts of the surveys are their reference lists. This one has 604 bibliographic items  (if I did not do any errors in counting). There is great scholarly work in collecting 604 bibliographic items, reading through them, and putting them into a well-organized survey. There is virtually no bulk references; all citations come with at least a few words. This assiduous approach got me excited and I dug into the reference list. The earliest cited work is from 1957 (one by Berge [1], and one by Markowitz [2]); the latests are from 2015 (there are a number of them).  There are no cited papers from the years 1958, 1959, 1960, 1962, 1964, and 1965. Here is a histogram of the number of papers per 5-year periods (centered at years 1955 to 2015 by increments of 5, e.g., 1955:5:2015).

The histogram tells at least two things: (i) much of the activities at the foundations of today’s methods are from the years 1990–2000; (ii) the field is very active, considering that the survey gives an overview of fundamentals, and recent developments which did not fit neatly into the grand/traditional lines of the world of direct methods are only summarized in a relatively short section (Section 12).

I underlined another quotation from the survey:

Well-designed mathematical software has long been considered a cornerstone of scholarly contributions in computational science.

This is a great survey, even for those who know the area. Kudos to Tim, Siva, and Wissam for having crafted it.

### References

1. Claude Berge, Two theorems in graph theory, Proceedings of the National Academy of Sciences of the United States of America 43(9), 842–844, 1957  (link).
2. Harry M. Markowitz, The elimination form of the inverse and its application to linear programming, Management Science, 3 (3), 255–269, 1957 (link).

## On the Birkhoff-von Neumann decomposition

Michele Benzi, Alex Pothen and I have been making use of the celebrated Birkhoff-von Neumann theorem on doubly stochastic matrices. The theorem says that any doubly stochastic matrix can be written as a convex combination of a finitely many permutation matrices. Formally, let $\mathbf{A}$ be a doubly stochastic matrix. Then,

$\mathbf{A}=\sum_{j=1}^k \alpha_j \mathbf{P}_j\;,$

where $\alpha_j>0, \sum_j \alpha_j=1$ and each $\mathbf{P}_j$ is a permutation matrix.

Given this formulation, one wonders if the decomposition is unique. Well, the answer is “No”. Then, one asks what can be said about the number $k$. And this is the main topic of this post.

Richard A. Brualdi [1] discusses many things among which a lower bound and an upper bound on $k$. The minimum number of permutation matrices is equal to the maximum cardinality of a set of nonzeros positions of $\mathbf{A}$ no two of which could appear together in a single permutation matrix in the pattern of $\mathbf{A}$. An easy lower bound is then equal to the maximum number of nonzeros in a row or a column of $\mathbf{A}$. The upper bound is $\mathrm{nnz}(\mathbf{A})-2n+2$, for a fully indecomposable matrix $\mathbf{A}$ with $\mathrm{nnz}(\mathbf{A})$ nonzeros; more generally if there are $b$ fully indecomposable blocks, then the upper bound is $\mathrm{nnz}(\mathbf{A})-2n+b+1$.

What about the minimum number of permutation matrices? It turns out that this is an NP-complete problem. Let’s state it in the form of a standard NP-completeness result.

Input:  A doubly stochastic matrix $\mathbf{A}$.
Output: A Birkhoff-von Neumann decomposition of $\mathbf{A}$ as $\mathbf{A} = \alpha_1\mathbf{P}_1 + \alpha_2\mathbf{P}_2 + \cdots +\alpha_k\mathbf{P}_k$.
Measure: The number $k$ of permutation matrices in the decomposition.

The NP-completeness of the decision version of this problem is shown in a recent technical report [2].

### References

1. Richard A. Brualdi, Notes on the Birkhoff algorithm for doubly stochastic matrices, Canadian Mathematical Bulletin, 25(2), 191–199, 1982 (doi).
2. Fanny Dufossé and Bora Uçar, Notes on Birkhoff-von Neumann decomposition of doubly stochastic matrices, Technical Report, RR-8852, Inria Grenoble Rhône-Alpes, 2016 (link).

## CSC Research Blog is up and running

We, Alex Pothen and Bora Uçar, are going to blog about Combinatorial Scientific Computing (CSC).

CSC is an interdisciplinary research area where discrete mathematics and algorithms are applied to combinatorial problems from Computational Science and Engineering. CSC links scientific computing to algorithmic computer science.


text:
If you're running AdBlock, please consider whitelisting this site if you'd like to support LearnOpenGL; and no worries, I won't be mad if you don't :)

# Parallax Mapping

Parallax mapping is a technique similar to normal mapping, but based on different principles. Just like normal mapping it is a technique that significantly boosts a textured surface's detail and gives it a sense of depth. While also an illusion, parallax mapping is a lot better in conveying a sense of depth and together with normal mapping gives incredibly realistic results. While parallax mapping isn't necessarily a technique directly related to (advanced) lighting, I'll still discuss it here as the technique is a logical follow-up of normal mapping. Note that getting an understanding of normal mapping, specifically tangent space, is strongly advised before learning parallax mapping.

Parallax mapping is closely related to the family of displacement mapping techniques that displace or offset vertices based on geometrical information stored inside a texture. One way to do this, is to take a plane with roughly 1000 vertices and displace each of these vertices based on a value in a texture that tells us the height of the plane at that specific area. Such a texture that contains height values per texel is called a height map. An example height map derived from the geometric properties of a simple brick surface looks a bit like this:

When spanned over a plane, each vertex is displaced based on the sampled height value in the height map, transforming a flat plane to a rough bumpy surface based on a material's geometric properties. For instance, taking a flat plane displaced with the above heightmap results in the following image:

A problem with displacing vertices this way is that a plane needs to contain a huge amount of triangles to get a realistic displacement, otherwise the displacement looks too blocky. As each flat surface may then require over 10000 vertices this quickly becomes computationally infeasible. What if we could somehow achieve similar realism without the need of extra vertices? In fact, what if I were to tell you that the previously shown displaced surface is actually rendered with only 2 triangles. This brick surface shown is rendered with parallax mapping, a displacement mapping technique that doesn't require extra vertex data to convey depth, but (similar to normal mapping) uses a clever technique to trick the user.

The idea behind parallax mapping is to alter the texture coordinates in such a way that it looks like a fragment's surface is higher or lower than it actually is, all based on the view direction and a heightmap. To understand how it works, take a look at the following image of our brick surface:

Here the rough red line represents the values in the heightmap as the geometric surface representation of the brick surface and the vector $$\color{orange}{\bar{V}}$$ represents the surface to view direction (viewDir). If the plane would have actual displacement, the viewer would see the surface at point $$\color{blue}B$$. However, as our plane has no actual displacement the view direction is calculated from point $$\color{green}A$$ as we'd expect. Parallax mapping aims to offset the texture coordinates at fragment position $$\color{green}A$$ in such a way that we get texture coordinates at point $$\color{blue}B$$. We then use the texture coordinates at point $$\color{blue}B$$ for all subsequent texture samples, making it look like the viewer is actually looking at point $$\color{blue}B$$.

The trick is to figure out how to get the texture coordinates at point $$\color{blue}B$$ from point $$\color{green}A$$. Parallax mapping tries to solve this by scaling the fragment-to-view direction vector $$\color{orange}{\bar{V}}$$ by the height at fragment $$\color{green}A$$. So we're scaling the length of $$\color{orange}{\bar{V}}$$ to be equal to a sampled value from the heightmap $$\color{green}{H(A)}$$ at fragment position $$\color{green}A$$. The image below shows this scaled vector $$\color{brown}{\bar{P}}$$:

We then take this vector $$\color{brown}{\bar{P}}$$ and take its vector coordinates that align with the plane as the texture coordinate offset. This works because vector $$\color{brown}{\bar{P}}$$ is calculated using a height value from the heightmap. So the higher a fragment's height, the more it effectively gets displaced.

This little trick gives good results most of the time, but it is still a really crude approximation to get to point $$\color{blue}B$$. When heights change rapidly over a surface the results tend to look unrealistic as the vector $$\color{brown}{\bar{P}}$$ will not end up close to $$\color{blue}B$$ as you can see below:

Another issue with parallax mapping is that it's difficult to figure out which coordinates to retrieve from $$\color{brown}{\bar{P}}$$ when the surface is arbitrarily rotated in some way. We'd rather do this in a different coordinate space where the x and y component of vector $$\color{brown}{\bar{P}}$$ always align with the texture's surface. If you've followed along in the normal mapping chapter you probably guessed how we can accomplish this. And yes, we would like to do parallax mapping in tangent space.

By transforming the fragment-to-view direction vector $$\color{orange}{\bar{V}}$$ to tangent space, the transformed $$\color{brown}{\bar{P}}$$ vector will have its x and y component aligned to the surface's tangent and bitangent vectors. As the tangent and bitangent vectors are pointing in the same direction as the surface's texture coordinates we can take the x and y components of $$\color{brown}{\bar{P}}$$ as the texture coordinate offset, regardless of the surface's orientation.

But enough about the theory, let's get our feet wet and start implementing actual parallax mapping.

## Parallax mapping

For parallax mapping we're going to use a simple 2D plane for which we calculated its tangent and bitangent vectors before sending it to the GPU; similar to what we did in the normal mapping chapter. Onto the plane we're going to attach a diffuse texture, a normal map, and a displacement map that you can download from their urls. For this example we're going to use parallax mapping in conjunction with normal mapping. Because parallax mapping gives the illusion of displacing a surface, the illusion breaks when the lighting doesn't match. As normal maps are often generated from heightmaps, using a normal map together with the heightmap makes sure the lighting is in place with the displacement.

You may have already noted that the displacement map linked above is the inverse of the heightmap shown at the start of this chapter. With parallax mapping it makes more sense to use the inverse of the heightmap as it's easier to fake depth than height on flat surfaces. This slightly changes how we perceive parallax mapping as shown below:

We again have a points $$\color{green}A$$ and $$\color{blue}B$$, but this time we obtain vector $$\color{brown}{\bar{P}}$$ by subtracting vector $$\color{orange}{\bar{V}}$$ from the texture coordinates at point $$\color{green}A$$. We can obtain depth values instead of height values by subtracting the sampled heightmap values from 1.0 in the shaders, or by simply inversing its texture values in image-editing software as we did with the depthmap linked above.

Parallax mapping is implemented in the fragment shader as the displacement effect is different all over a triangle's surface. In the fragment shader we're then going to need to calculate the fragment-to-view direction vector $$\color{orange}{\bar{V}}$$ so we need the view position and a fragment position in tangent space. In the normal mapping chapter we already had a vertex shader that sends these vectors in tangent space so we can take an exact copy of that chapter's vertex shader:

#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aNormal;
layout (location = 2) in vec2 aTexCoords;
layout (location = 3) in vec3 aTangent;
layout (location = 4) in vec3 aBitangent;

out VS_OUT {
vec3 FragPos;
vec2 TexCoords;
vec3 TangentLightPos;
vec3 TangentViewPos;
vec3 TangentFragPos;
} vs_out;

uniform mat4 projection;
uniform mat4 view;
uniform mat4 model;

uniform vec3 lightPos;
uniform vec3 viewPos;

void main()
{
gl_Position      = projection * view * model * vec4(aPos, 1.0);
vs_out.FragPos   = vec3(model * vec4(aPos, 1.0));
vs_out.TexCoords = aTexCoords;

vec3 T   = normalize(mat3(model) * aTangent);
vec3 B   = normalize(mat3(model) * aBitangent);
vec3 N   = normalize(mat3(model) * aNormal);
mat3 TBN = transpose(mat3(T, B, N));

vs_out.TangentLightPos = TBN * lightPos;
vs_out.TangentViewPos  = TBN * viewPos;
vs_out.TangentFragPos  = TBN * vs_out.FragPos;
}

Within the fragment shader we then implement the parallax mapping logic. The fragment shader looks a bit like this:

#version 330 core
out vec4 FragColor;

in VS_OUT {
vec3 FragPos;
vec2 TexCoords;
vec3 TangentLightPos;
vec3 TangentViewPos;
vec3 TangentFragPos;
} fs_in;

uniform sampler2D diffuseMap;
uniform sampler2D normalMap;
uniform sampler2D depthMap;

uniform float height_scale;

vec2 ParallaxMapping(vec2 texCoords, vec3 viewDir);

void main()
{
// offset texture coordinates with Parallax Mapping
vec3 viewDir   = normalize(fs_in.TangentViewPos - fs_in.TangentFragPos);
vec2 texCoords = ParallaxMapping(fs_in.TexCoords,  viewDir);

// then sample textures with new texture coords
vec3 diffuse = texture(diffuseMap, texCoords);
vec3 normal  = texture(normalMap, texCoords);
normal = normalize(normal * 2.0 - 1.0);
// proceed with lighting code
[...]
}

We defined a function called ParallaxMapping that takes as input the fragment's texture coordinates and the fragment-to-view direction $$\color{orange}{\bar{V}}$$ in tangent space. The function returns the displaced texture coordinates. We then use these displaced texture coordinates as the texture coordinates for sampling the diffuse and normal map. As a result, the fragment's diffuse and normal vector correctly corresponds to the surface's displaced geometry.

Let's take a look inside the ParallaxMapping function:

vec2 ParallaxMapping(vec2 texCoords, vec3 viewDir)
{
float height =  texture(depthMap, texCoords).r;
vec2 p = viewDir.xy / viewDir.z * (height * height_scale);
return texCoords - p;
}

This relatively simple function is a direct translation of what we've discussed so far. We take the original texture coordinates texCoords and use these to sample the height (or depth) from the depthMap at the current fragment $$\color{green}{A}$$ as $$\color{green}{H(A)}$$. We then calculate $$\color{brown}{\bar{P}}$$ as the x and y component of the tangent-space viewDir vector divided by its z component and scaled by $$\color{green}{H(A)}$$. We also introduced a height_scale uniform for some extra control as the parallax effect is usually too strong without an extra scale parameter. We then subtract this vector $$\color{brown}{\bar{P}}$$ from the texture coordinates to get the final displaced texture coordinates.

What is interesting to note here is the division of viewDir.xy by viewDir.z. As the viewDir vector is normalized, viewDir.z will be somewhere in the range between 0.0 and 1.0. When viewDir is largely parallel to the surface, its z component is close to 0.0 and the division returns a much larger vector $$\color{brown}{\bar{P}}$$ compared to when viewDir is largely perpendicular to the surface. We're adjusting the size of $$\color{brown}{\bar{P}}$$ in such a way that it offsets the texture coordinates at a larger scale when looking at a surface from an angle compared to when looking at it from the top; this gives more realistic results at angles.
Some prefer to leave the division by viewDir.z out of the equation as default Parallax Mapping could produce undesirable results at angles; the technique is then called Parallax Mapping with Offset Limiting. Choosing which technique to pick is usually a matter of personal preference.

The resulting texture coordinates are then used to sample the other textures (diffuse and normal) and this gives a very neat displaced effect as you can see below with a height_scale of roughly 0.1:

Here you can see the difference between normal mapping and parallax mapping combined with normal mapping. Because parallax mapping tries to simulate depth it is actually possible to have bricks overlap other bricks based on the direction you view them.

You can still see a few weird border artifacts at the edge of the parallax mapped plane. This happens because at the edges of the plane the displaced texture coordinates can oversample outside the range [0, 1]. This gives unrealistic results based on the texture's wrapping mode(s). A cool trick to solve this issue is to discard the fragment whenever it samples outside the default texture coordinate range:

texCoords = ParallaxMapping(fs_in.TexCoords,  viewDir);
if(texCoords.x > 1.0 || texCoords.y > 1.0 || texCoords.x < 0.0 || texCoords.y < 0.0)

All fragments with (displaced) texture coordinates outside the default range are discarded and Parallax Mapping then gives proper result around the edges of a surface. Note that this trick doesn't work on all types of surfaces, but when applied to a plane it gives great results:

You can find the source code here.

It looks great and is quite fast as well as we only need a single extra texture sample for parallax mapping to work. It does come with a few issues though as it sort of breaks down when looking at it from an angle (similar to normal mapping) and gives incorrect results with steep height changes, as you can see below:

The reason that it doesn't work properly at times is that it's just a crude approximation of displacement mapping. There are some extra tricks however that still allows us to get almost perfect results with steep height changes, even when looking at an angle. For instance, what if we instead of one sample take multiple samples to find the closest point to $$\color{blue}B$$?

## Steep Parallax Mapping

Steep Parallax Mapping is an extension on top of Parallax Mapping in that it uses the same principles, but instead of 1 sample it takes multiple samples to better pinpoint vector $$\color{brown}{\bar{P}}$$ to $$\color{blue}B$$. This gives much better results, even with steep height changes, as the accuracy of the technique is improved by the number of samples.

The general idea of Steep Parallax Mapping is that it divides the total depth range into multiple layers of the same height/depth. For each of these layers we sample the depthmap, shifting the texture coordinates along the direction of $$\color{brown}{\bar{P}}$$, until we find a sampled depth value that is less than the depth value of the current layer. Take a look at the following image:

We traverse the depth layers from the top down and for each layer we compare its depth value to the depth value stored in the depthmap. If the layer's depth value is less than the depthmap's value it means this layer's part of vector $$\color{brown}{\bar{P}}$$ is not below the surface. We continue this process until the layer's depth is higher than the value stored in the depthmap: this point is then below the (displaced) geometric surface.

In this example we can see that the depthmap value at the second layer (D(2) = 0.73) is lower than the second layer's depth value 0.4 so we continue. In the next iteration, the layer's depth value 0.6 is higher than the depthmap's sampled depth value (D(3) = 0.37). We can thus assume vector $$\color{brown}{\bar{P}}$$ at the third layer to be the most viable position of the displaced geometry. We then take the texture coordinate offset $$T_3$$ from vector $$\color{brown}{\bar{P_3}}$$ to displace the fragment's texture coordinates. You can see how the accuracy increases with more depth layers.

To implement this technique we only have to change the ParallaxMapping function as we already have all the variables we need:

vec2 ParallaxMapping(vec2 texCoords, vec3 viewDir)
{
// number of depth layers
const float numLayers = 10;
// calculate the size of each layer
float layerDepth = 1.0 / numLayers;
// depth of current layer
float currentLayerDepth = 0.0;
// the amount to shift the texture coordinates per layer (from vector P)
vec2 P = viewDir.xy * height_scale;
vec2 deltaTexCoords = P / numLayers;

[...]
}

Here we first set things up: we specify the number of layers, calculate the depth offset of each layer, and finally calculate the texture coordinate offset that we have to shift along the direction of $$\color{brown}{\bar{P}}$$ per layer.

We then iterate through all the layers, starting from the top, until we find a depthmap value less than the layer's depth value:

// get initial values
vec2  currentTexCoords     = texCoords;
float currentDepthMapValue = texture(depthMap, currentTexCoords).r;

while(currentLayerDepth < currentDepthMapValue)
{
// shift texture coordinates along direction of P
currentTexCoords -= deltaTexCoords;
// get depthmap value at current texture coordinates
currentDepthMapValue = texture(depthMap, currentTexCoords).r;
// get depth of next layer
currentLayerDepth += layerDepth;
}

return currentTexCoords;

Here we loop over each depth layer and stop until we find the texture coordinate offset along vector $$\color{brown}{\bar{P}}$$ that first returns a depth that's below the (displaced) surface. The resulting offset is subtracted from the fragment's texture coordinates to get a final displaced texture coordinate vector, this time with much more accuracy compared to traditional parallax mapping.

With around 10 samples the brick surface already looks more viable even when looking at it from an angle, but steep parallax mapping really shines when having a complex surface with steep height changes; like the earlier displayed wooden toy surface:

We can improve the algorithm a bit by exploiting one of Parallax Mapping's properties. When looking straight onto a surface there isn't much texture displacement going on while there is a lot of displacement when looking at a surface from an angle (visualize the view direction on both cases). By taking less samples when looking straight at a surface and more samples when looking at an angle we only sample the necessary amount:

const float minLayers = 8.0;
const float maxLayers = 32.0;
float numLayers = mix(maxLayers, minLayers, max(dot(vec3(0.0, 0.0, 1.0), viewDir), 0.0));

Here we take the dot product of viewDir and the positive z direction and use its result to align the number of samples to minLayers or maxLayers based on the angle we're looking towards a surface (note that the positive z direction equals the surface's normal vector in tangent space). If we were to look at a direction parallel to the surface we'd use a total of 32 layers.

You can find the updated source code here. You can also find the wooden toy box surface here: diffuse, normal and depth.

Steep Parallax Mapping also comes with its problems though. Because the technique is based on a finite number of samples, we get aliasing effects and the clear distinctions between layers can easily be spotted:

We can reduce the issue by taking a larger number of samples, but this quickly becomes too heavy a burden on performance. There are several approaches that aim to fix this issue by not taking the first position that's below the (displaced) surface, but by interpolating between the position's two closest depth layers to find a much closer match to $$\color{blue}B$$.

Two of the more popular of these approaches are called Relief Parallax Mapping and Parallax Occlusion Mapping of which Relief Parallax Mapping gives the most accurate results, but is also more performance heavy compared to Parallax Occlusion Mapping. Because Parallax Occlusion Mapping gives almost the same results as Relief Parallax Mapping and is also more efficient it is often the preferred approach.

## Parallax Occlusion Mapping

Parallax Occlusion Mapping is based on the same principles as Steep Parallax Mapping, but instead of taking the texture coordinates of the first depth layer after a collision, we're going to linearly interpolate between the depth layer after and before the collision. We base the weight of the linear interpolation on how far the surface's height is from the depth layer's value of both layers. Take a look at the following picture to get a grasp of how it works:

As you can see, it's largely similar to Steep Parallax Mapping with as an extra step the linear interpolation between the two depth layers' texture coordinates surrounding the intersected point. This is again an approximation, but significantly more accurate than Steep Parallax Mapping.

The code for Parallax Occlusion Mapping is an extension on top of Steep Parallax Mapping and not too difficult:

[...] // steep parallax mapping code here

// get texture coordinates before collision (reverse operations)
vec2 prevTexCoords = currentTexCoords + deltaTexCoords;

// get depth after and before collision for linear interpolation
float afterDepth  = currentDepthMapValue - currentLayerDepth;
float beforeDepth = texture(depthMap, prevTexCoords).r - currentLayerDepth + layerDepth;

// interpolation of texture coordinates
float weight = afterDepth / (afterDepth - beforeDepth);
vec2 finalTexCoords = prevTexCoords * weight + currentTexCoords * (1.0 - weight);

return finalTexCoords;

After we found the depth layer after intersecting the (displaced) surface geometry, we also retrieve the texture coordinates of the depth layer before intersection. Then we calculate the distance of the (displaced) geometry's depth from the corresponding depth layers and interpolate between these two values. The linear interpolation is a basic interpolation between both layer's texture coordinates. The function then finally returns the final interpolated texture coordinates.

Parallax Occlusion Mapping gives surprisingly good results and although some slight artifacts and aliasing issues are still visible, it's a generally a good trade-off and only really visible when heavily zoomed in or looking at very steep angles.

You can find the source code here.

Parallax Mapping is a great technique to boost the detail of your scene, but does come with a few artifacts you'll have to consider when using it. Most often, parallax mapping is used on floor or wall-like surfaces where it's not as easy to determine the surface's outline and the viewing angle is most often roughly perpendicular to the surface. This way, the artifacts of Parallax Mapping aren't as noticeable and make it an incredibly interesting technique for boosting your objects' details.


text:
# Reference frame and conservation of energy [duplicate]

Say spaceship $\alpha$ burns a portion of its fuel to leave planet A and is cruising through space at 10 m/s relative to the surface from which it launched. Spaceship $\alpha$ is being observed by spaceship $\beta$, which launched from planet B. The relative velocities of the two planets are such that spaceship $\alpha$ is moving at 50 m/s relative to planet B.

Spaceship $\alpha$ plans to increase its speed by burning some amount of fuel (which is converted completely to kinetic energy), and it communicates its intentions to spaceship $\beta$. Astronauts on each ship use conservation of energy to predict the change in velocity of the ship after the fuel is burned, with $$\frac{1}{2}m v_2^2 = \frac{1}{2}m v_1^2 + E_{burn}$$ and $$\Delta v = v_2 - v_1$$ The chemical potential of the fuel burned shouldn't be affected by the observer's reference frame. However, astronauts on spaceship $\alpha$ consider their initial velocity to be 10 m/s, but from the perspective of astronauts on spaceship $\beta$ who launched from planet B, it is 50 m/s. This will cause the astronauts to calculate different values for $\Delta v$.

Clearly, $\Delta v$ won't depend on reference frame. What, then, is the criteria for selecting $v_1$ such that the correct $\Delta v$ is calculated? With the spaceship flying through space, choosing planet A to have zero velocity seems as arbitrary as choosing planet B.

## marked as duplicate by knzhou, user191954, Kyle Kanos, AccidentalFourierTransform, ZeroTheHeroOct 3 '18 at 12:51

When you burn the fuel it releases an energy $E_\text{burn}$, but your mistake is to assume that this all goes into the kinetic energy of the ship.
Rocket fuel works by accelerating itsef relative to the ship and leaving the ship at high velocity as exhaust gases. Momentum is conserved so when the fuel goes one way the ship goes the other way. The energy $E_\text{burn}$ is divided between the kinetic energy of the ship and the kinetic energy of the exhaust gas:
$$E_\text{burn} = \Delta E_\text{ship} + \Delta E_\text{exhaust}$$
As you change reference frames you change the velocities, and hence the kinetic energies, of both the ship and the exhaust gas. The individual values of $\Delta E_\text{ship}$ and $\Delta E_\text{exhaust}$ will be different for different observers, however when you add together the change in the two kinetic energies it always adds up to the energy released by the fuel regardless of what observer is doing the calculation.


text:
# Is the mean of a stationary timeseries the same everywhere?

Say for example I have the white noise process $$Y_t\sim\text{WN}(\mu,\sigma^2)$$. Is it true that $$\mathbb{E}[Y_t]=\mathbb{E}[Y_{t-h}]$$, where $$h\in\mathbb{N}?$$

• Yes. This is true for both the strong and weak version of stationarity. Be aware, that in many cases when working with time-series analysis, we only assume weak stationarity (also called covariance stationarity), ie. the mean and variance do not vary with time. Nevertheless, a strictly stationary process with finite mean and variance is also weakly stationary. I'd advise you to read the wiki page. – Pleb Apr 17 at 17:02
• @Pleb - Thanks. But how come then according to definition, if $X_t$ is a stochastic process with mean function $\mu_X(t)$, then the covariance function is given by $\text{Cov}(X_r,X_s)=E(X_rX_s)-\mu_X(r)\mu_X(s)?$ Shouldn't by your comment $\mu_X(r) = \mu_X(s) = \mu$ so we can just set $-\mu^2?$ – Parseval Apr 17 at 17:44
• For a weak sense stationary process we can indeed do what you say and have $-\mu^2$ in the covariance formula. – noob2 Apr 17 at 18:20


text:
# Homework Help: Floating points

1. Feb 19, 2009

### Codezion

This should be an easy one, but my PC is bugging me!!! Based on the floating point definition:

F = $$\pm$$( $$\stackrel{m}{\overline{B^{t}}}$$)$$B^{e}$$

Where B is the base (usually 2), m is the mantissa and varies from 1 $$\leq$$ $$B^{t}$$ - 1. e is the exponent (1024 for double and 128 for single precision machines).

Quetion: what is the smallest intenger that DOES NOT belong to this floating point definition.

Solution: Since we want to minimize the denominator term we will let t=1, This would again let m =1. Hence, we can conclude that this said integer is 2$$^{1023}$$. However, I cannot verify this on the computer. In matlab, if I have this number and I add 1 to it, it gives me back the same number instead of Inf as I expect it. Can someone tell me how to verify this on a computer, or if my analysis is wrong?

Thanks!


text:
# A Pushforward of Smooth Vector Fields

1. Jan 12, 2018 at 11:09 AM

### Zag

Hello everyone, my question is: what are the criteria that must be satisfied for the pushforward of a smooth vector field to be a smooth vector field on its own right?

Consider a smooth map $\phi : M \longrightarrow N$ between the smooth manifolds $M$ and $N$. The pushforward associated with this map is a map $\phi_{\ast} : TM \longrightarrow TN$ between the respective tangent bundles associated with $M$ and $N$. (For simplicity I am omitting here the point-wise nature of the pushforward definition).

Smooth vector fields on $M$ are smooth sections $\sigma : TM \longrightarrow M$ of the tangent bundle $TM$. My question is: what are the criteria that must be satisfied for the pushforward of a smooth vector field $\sigma$ on $M$ to be a smooth vector field on its own right on the target manifold $N$? In other words, what would be the conditions which guarantee $\phi_{\ast}\sigma$ to be a smooth section of $TN$?

It seems to me that a basic necessary requirement would be that $\phi$ must be bijective, so that $\phi_{\ast}$ would define a unique vector at every point of $N$. However, I am not sure what would be a set of sufficient conditions.

Any thoughts would be greatly appreciated.


text:
OpenStudy (anonymous):

the half-life of radium 226 is 1590 years. a) if a sample has a mass of 150 mg find the mass that will remain after 1000 years. A=150(1/2)^(1000/1590)= 96.9 mg remain. b) after how many years will only 50 mg remain???

4 years ago
OpenStudy (campbell_st):

well you need to find t so the equation sets up as $50 = 150\times (\frac{1}{2})^{\frac{t}{1590}}$ just solve for t you'll need logs...

4 years ago
OpenStudy (anonymous):

when do the logs come in? i tried the problem but did it wrong

4 years ago


text:
(a) How can we get the following colloidal solutions:

(i) Silver in water

(ii) Fe$\left(\mathrm{OH}{\right)}_{3}$ in water

(b) List two applications of adsorption.


text:
## Mathematical Sciences Faculty Publications

Article

4-19-2013

#### Publication Title

Mathematische Annalen

#### Abstract

We study the Harnack inequality for weak solutions of a class of degenerate parabolic quasilinear PDE \p_t u=-X_i^* A_i(x,t,u,Xu)+ B(x,t,u,Xu), in cylinders $\Om\times (0,T)$ with $\Om \subset M$ is an open subset of a manifold M endowed with control metric d corresponding to a system of Lipschitz continuous vector fields \X=X_1.,,,.X_m)\ and a measure dσ. We show that the Harnack inequality follows from the basic hypothesis of doubling condition and a weak Poincar\'e inequality in the metric measure space (M, d, dσ). We also show that such hypothesis hold for a class of Riemannian metrics $g_\e$ collapsing to a sub-Riemannian metric $\lim_{\e\to 0} g_\e=g_0$ uniformly in the parameter $\e\ge 0$.

357

3

1175

1198

#### DOI

10.1007/s00208-013-0937-y

Preprint


text:
# Project Settings

Set up relative file paths for your Projects

Project Settings create a relationship between Scenes, Assets and Renders (and more). When you set a Project a Project Description is created in a location on your file system of your choosing. A Project Description is simply a .json file specifying default file paths to other directories. The result of this is that when you, for example, double click in the Assets Window to import an Asset , Finder (macOS) or Explorer (Windows) will open in the directory you have specified.

There are various benefits to this. For example, if you work in a studio with other artists you can set a Project and use that to help the team stay organised. Renders go here, scenes go here etc. In other words, a pipeline😉. Or perhaps you need to share a project with a client/ colleague/ freelancer outside of your studio. With a Project set, all file paths to images, audio, fonts etc are relative to the Project and so if your client/ colleague/ freelancer also sets their Project to the directory you've sent them (local to their file system), all links to any imported assets are maintained.

Name - the name for the project. By default this will use the name of the directory you set the project to.

##### caution

Changing the project Name will not change the name of the actual directory on your file system.

Scenes - the default location to save scenes to or open them from.

Renders - the default location to save renders to.

Assets - the default location to import assets from.

Autosave - the default location to store autosave files.

Palettes - .pal files saved here will appear as Library Palettes in the Color Window. See - Palettes.

##### tip

Example usage:

1. Click the folder icon in the bottom left of the Assets Window (or go File > Project Settings)
2. In the Project Settings window, click Create....
3. Create a new folder/ directory on your file system called 'Cavalry' (or anything you like).
4. Click Choose.

You should now have directories called Assets, Renders, Scenes and Autosave created within your 'Cavalry' (or whatever you named it) directory along with a file called projectDescription.json.

Now, if you go File > Open, Finder/ Explorer will open into the Scenes directory within your Cavalry directory (same with File > Save). If you double click in the Assets Window, Finder/ Explorer will open into Assets. If you open the Render Manager the Path will be pre-populated with 'Renders' and hitting render will write files into that directory.

When a project is set, a file called path-to-project is created alongside any scene files. This is required for scenes which include assets (images, svg, audio etc) to work with Cavalry Player and Cavalry Command. It also means that if you open a scene with a different Project set to the one you're currently using, Cavalry will automatically switch to the correct Project.

##### info

You can use the drop down at the bottom of the Assets Window to quickly switch to recently used Projects.

You can edit the directories created when you set up a Project. In the Project Settings Window, either click on the folder icon and browse to a different directory or manually edit the path.

##### caution

Changing the names of directories in the Project Settings will also change the names of directories on your filesystem. For example, if the path to Assets was @project/Assets and you changed it in project settings to @project/Images the Assets directory on your filesystem will be renamed to Images.

You can manually edit the projectDescription.json file in a text editor but ensure that it is not in use if you do.

{    "description": {        "assets": "@project/Assets",        "autoSave": "@project/Autosave",        "name": "Cavalry",        "palettes": "@project/Assets/Palettes",        "renders": "@project/Renders",        "scenes": "@project/Scenes"    }}


text:
# 4.2 Graphs of exponential functions  (Page 5/6)

 Page 5 / 6

Find and graph the equation for a function, $\text{\hspace{0.17em}}g\left(x\right),$ that reflects $\text{\hspace{0.17em}}f\left(x\right)={1.25}^{x}\text{\hspace{0.17em}}$ about the y -axis. State its domain, range, and asymptote.

The domain is $\text{\hspace{0.17em}}\left(-\infty ,\infty \right);\text{\hspace{0.17em}}$ the range is $\text{\hspace{0.17em}}\left(0,\infty \right);\text{\hspace{0.17em}}$ the horizontal asymptote is $\text{\hspace{0.17em}}y=0.$

## Summarizing translations of the exponential function

Now that we have worked with each type of translation for the exponential function, we can summarize them in [link] to arrive at the general equation for translating exponential functions.

Translations of the Parent Function $\text{\hspace{0.17em}}f\left(x\right)={b}^{x}$
Translation Form
Shift
• Horizontally $\text{\hspace{0.17em}}c\text{\hspace{0.17em}}$ units to the left
• Vertically $\text{\hspace{0.17em}}d\text{\hspace{0.17em}}$ units up
$f\left(x\right)={b}^{x+c}+d$
Stretch and Compress
• Stretch if $\text{\hspace{0.17em}}|a|>1$
• Compression if $\text{\hspace{0.17em}}0<|a|<1$
$f\left(x\right)=a{b}^{x}$
Reflect about the x -axis $f\left(x\right)=-{b}^{x}$
Reflect about the y -axis $f\left(x\right)={b}^{-x}={\left(\frac{1}{b}\right)}^{x}$
General equation for all translations $f\left(x\right)=a{b}^{x+c}+d$

## Translations of exponential functions

A translation of an exponential function has the form

Where the parent function, $\text{\hspace{0.17em}}y={b}^{x},$ $\text{\hspace{0.17em}}b>1,$ is

• shifted horizontally $\text{\hspace{0.17em}}c\text{\hspace{0.17em}}$ units to the left.
• stretched vertically by a factor of $\text{\hspace{0.17em}}|a|\text{\hspace{0.17em}}$ if $\text{\hspace{0.17em}}|a|>0.$
• compressed vertically by a factor of $\text{\hspace{0.17em}}|a|\text{\hspace{0.17em}}$ if $\text{\hspace{0.17em}}0<|a|<1.$
• shifted vertically $\text{\hspace{0.17em}}d\text{\hspace{0.17em}}$ units.
• reflected about the x- axis when $\text{\hspace{0.17em}}a<0.$

Note the order of the shifts, transformations, and reflections follow the order of operations.

## Writing a function from a description

Write the equation for the function described below. Give the horizontal asymptote, the domain, and the range.

• $f\left(x\right)={e}^{x}\text{\hspace{0.17em}}$ is vertically stretched by a factor of $\text{\hspace{0.17em}}2\text{\hspace{0.17em}}$ , reflected across the y -axis, and then shifted up $\text{\hspace{0.17em}}4\text{\hspace{0.17em}}$ units.

We want to find an equation of the general form We use the description provided to find $\text{\hspace{0.17em}}a,$ $b,$ $c,$ and $\text{\hspace{0.17em}}d.$

• We are given the parent function $\text{\hspace{0.17em}}f\left(x\right)={e}^{x},$ so $\text{\hspace{0.17em}}b=e.$
• The function is stretched by a factor of $\text{\hspace{0.17em}}2$ , so $\text{\hspace{0.17em}}a=2.$
• The function is reflected about the y -axis. We replace $\text{\hspace{0.17em}}x\text{\hspace{0.17em}}$ with $\text{\hspace{0.17em}}-x\text{\hspace{0.17em}}$ to get: $\text{\hspace{0.17em}}{e}^{-x}.$
• The graph is shifted vertically 4 units, so $\text{\hspace{0.17em}}d=4.$

Substituting in the general form we get,

The domain is $\text{\hspace{0.17em}}\left(-\infty ,\infty \right);\text{\hspace{0.17em}}$ the range is $\text{\hspace{0.17em}}\left(4,\infty \right);\text{\hspace{0.17em}}$ the horizontal asymptote is $\text{\hspace{0.17em}}y=4.$

Write the equation for function described below. Give the horizontal asymptote, the domain, and the range.

• $f\left(x\right)={e}^{x}\text{\hspace{0.17em}}$ is compressed vertically by a factor of $\text{\hspace{0.17em}}\frac{1}{3},$ reflected across the x -axis and then shifted down $\text{\hspace{0.17em}}2$ units.

$f\left(x\right)=-\frac{1}{3}{e}^{x}-2;\text{\hspace{0.17em}}$ the domain is $\text{\hspace{0.17em}}\left(-\infty ,\infty \right);\text{\hspace{0.17em}}$ the range is $\text{\hspace{0.17em}}\left(-\infty ,2\right);\text{\hspace{0.17em}}$ the horizontal asymptote is $\text{\hspace{0.17em}}y=2.$

Access this online resource for additional instruction and practice with graphing exponential functions.

## Key equations

 General Form for the Translation of the Parent Function $f\left(x\right)=a{b}^{x+c}+d$

## Key concepts

• The graph of the function $\text{\hspace{0.17em}}f\left(x\right)={b}^{x}\text{\hspace{0.17em}}$ has a y- intercept at domain range and horizontal asymptote $\text{\hspace{0.17em}}y=0.\text{\hspace{0.17em}}$ See [link] .
• If $\text{\hspace{0.17em}}b>1,$ the function is increasing. The left tail of the graph will approach the asymptote $\text{\hspace{0.17em}}y=0,$ and the right tail will increase without bound.
• If $\text{\hspace{0.17em}}0 the function is decreasing. The left tail of the graph will increase without bound, and the right tail will approach the asymptote $\text{\hspace{0.17em}}y=0.$
• The equation $\text{\hspace{0.17em}}f\left(x\right)={b}^{x}+d\text{\hspace{0.17em}}$ represents a vertical shift of the parent function $\text{\hspace{0.17em}}f\left(x\right)={b}^{x}.$
• The equation $\text{\hspace{0.17em}}f\left(x\right)={b}^{x+c}\text{\hspace{0.17em}}$ represents a horizontal shift of the parent function $\text{\hspace{0.17em}}f\left(x\right)={b}^{x}.\text{\hspace{0.17em}}$ See [link] .
• Approximate solutions of the equation $\text{\hspace{0.17em}}f\left(x\right)={b}^{x+c}+d\text{\hspace{0.17em}}$ can be found using a graphing calculator. See [link] .
• The equation $\text{\hspace{0.17em}}f\left(x\right)=a{b}^{x},$ where $\text{\hspace{0.17em}}a>0,$ represents a vertical stretch if $\text{\hspace{0.17em}}|a|>1\text{\hspace{0.17em}}$ or compression if $\text{\hspace{0.17em}}0<|a|<1\text{\hspace{0.17em}}$ of the parent function $\text{\hspace{0.17em}}f\left(x\right)={b}^{x}.\text{\hspace{0.17em}}$ See [link] .
• When the parent function $\text{\hspace{0.17em}}f\left(x\right)={b}^{x}\text{\hspace{0.17em}}$ is multiplied by $\text{\hspace{0.17em}}-1,$ the result, $\text{\hspace{0.17em}}f\left(x\right)=-{b}^{x},$ is a reflection about the x -axis. When the input is multiplied by $\text{\hspace{0.17em}}-1,$ the result, $\text{\hspace{0.17em}}f\left(x\right)={b}^{-x},$ is a reflection about the y -axis. See [link] .
• All translations of the exponential function can be summarized by the general equation $\text{\hspace{0.17em}}f\left(x\right)=a{b}^{x+c}+d.\text{\hspace{0.17em}}$ See [link] .
• Using the general equation $\text{\hspace{0.17em}}f\left(x\right)=a{b}^{x+c}+d,$ we can write the equation of a function given its description. See [link] .

I've run into this: x = r*cos(angle1 + angle2) Which expands to: x = r(cos(angle1)*cos(angle2) - sin(angle1)*sin(angle2)) The r value confuses me here, because distributing it makes: (r*cos(angle2))(cos(angle1) - (r*sin(angle2))(sin(angle1)) How does this make sense? Why does the r distribute once
How can you tell what type of parent function a graph is ?
generally by how the graph looks and understanding what the base parent functions look like and perform on a graph
William
if you have a graphed line, you can have an idea by how the directions of the line turns, i.e. negative, positive, zero
William
y=x will obviously be a straight line with a zero slope
William
y=x^2 will have a parabolic line opening to positive infinity on both sides of the y axis vice versa with y=-x^2 you'll have both ends of the parabolic line pointing downward heading to negative infinity on both sides of the y axis
William
y=x will be a straight line, but it will have a slope of one. Remember, if y=1 then x=1, so for every unit you rise you move over positively one unit. To get a straight line with a slope of 0, set y=1 or any integer.
Aaron
yes, correction on my end, I meant slope of 1 instead of slope of 0
William
what is f(x)=
I don't understand
Joe
Typically a function 'f' will take 'x' as input, and produce 'y' as output. As 'f(x)=y'. According to Google, "The range of a function is the complete set of all possible resulting values of the dependent variable (y, usually), after we have substituted the domain."
Thomas
Sorry, I don't know where the "Â"s came from. They shouldn't be there. Just ignore them. :-)
Thomas
Darius
Thanks.
Thomas
Â
Thomas
It is the Â that should not be there. It doesn't seem to show if encloses in quotation marks. "Â" or 'Â' ... Â
Thomas
Now it shows, go figure?
Thomas
what is this?
i do not understand anything
unknown
lol...it gets better
Darius
I've been struggling so much through all of this. my final is in four weeks 😭
Tiffany
this book is an excellent resource! have you guys ever looked at the online tutoring? there's one that is called "That Tutor Guy" and he goes over a lot of the concepts
Darius
thank you I have heard of him. I should check him out.
Tiffany
is there any question in particular?
Joe
I have always struggled with math. I get lost really easy, if you have any advice for that, it would help tremendously.
Tiffany
Sure, are you in high school or college?
Darius
Hi, apologies for the delayed response. I'm in college.
Tiffany
how to solve polynomial using a calculator
So a horizontal compression by factor of 1/2 is the same as a horizontal stretch by a factor of 2, right?
The center is at (3,4) a focus is at (3,-1), and the lenght of the major axis is 26
The center is at (3,4) a focus is at (3,-1) and the lenght of the major axis is 26 what will be the answer?
Rima
I done know
Joe
What kind of answer is that😑?
Rima
I had just woken up when i got this message
Joe
Rima
i have a question.
Abdul
how do you find the real and complex roots of a polynomial?
Abdul
@abdul with delta maybe which is b(square)-4ac=result then the 1st root -b-radical delta over 2a and the 2nd root -b+radical delta over 2a. I am not sure if this was your question but check it up
Nare
This is the actual question: Find all roots(real and complex) of the polynomial f(x)=6x^3 + x^2 - 4x + 1
Abdul
@Nare please let me know if you can solve it.
Abdul
I have a question
juweeriya
hello guys I'm new here? will you happy with me
mustapha
The average annual population increase of a pack of wolves is 25.
how do you find the period of a sine graph
Period =2π if there is a coefficient (b), just divide the coefficient by 2π to get the new period
Am
if not then how would I find it from a graph
Imani
by looking at the graph, find the distance between two consecutive maximum points (the highest points of the wave). so if the top of one wave is at point A (1,2) and the next top of the wave is at point B (6,2), then the period is 5, the difference of the x-coordinates.
Am
you could also do it with two consecutive minimum points or x-intercepts
Am
I will try that thank u
Imani
Case of Equilateral Hyperbola
ok
Zander
ok
Shella
f(x)=4x+2, find f(3)
Benetta
f(3)=4(3)+2 f(3)=14
lamoussa
14
Vedant
pre calc teacher: "Plug in Plug in...smell's good" f(x)=14
Devante
8x=40
Chris
Explain why log a x is not defined for a < 0
the sum of any two linear polynomial is what
Momo
how can are find the domain and range of a relations
the range is twice of the natural number which is the domain
Morolake
A cell phone company offers two plans for minutes. Plan A: $15 per month and$2 for every 300 texts. Plan B: $25 per month and$0.50 for every 100 texts. How many texts would you need to send per month for plan B to save you money?
6000
Robert
more than 6000
Robert
For Plan A to reach $27/month to surpass Plan B's$26.50 monthly payment, you'll need 3,000 texts which will cost an additional \$10.00. So, for the amount of texts you need to send would need to range between 1-100 texts for the 100th increment, times that by 3 for the additional amount of texts...
Gilbert
...for one text payment for 300 for Plan A. So, that means Plan A; in my opinion is for people with text messaging abilities that their fingers burn the monitor for the cell phone. While Plan B would be for loners that doesn't need their fingers to due the talking; but those texts mean more then...
Gilbert


text:
Article Contents
Article Contents

# The stability of the equilibrium for a perturbed asymmetric oscillator

• In this paper we will derive some stability criteria for the equilibrium of a perturbed asymmetric oscillator

$\ddot x + a^+ x^+ - a^-$$x^-$ $+ b(t)x^2+r(t,x)=0,$

where $a^+,a^-$ are two different positive numbers, $b(t)$ is a $2\pi$-periodic function, and the remaining term $r(t,x)$ is $2\pi$-periodic with respect to the time $t$ and dominated by the power $x^3$ in a neighborhood of the equilibrium $x=0$.

Mathematics Subject Classification: 34D20; 34C15; 37J40.

 Citation: