text:
CHEM101 Study Guide

5a. Use kinetic-molecular theory to explain the relationships among gas volume, temperature, number of moles, and pressure

• Describe the kinetic molecular theory of gases.
• Define the pressure of a gas.
• Explain how the Kinetic Molecular Theory of Gases gives relationships among volume, temperature, number of moles of gas, and pressure.

Chemists use the Kinetic Molecular Theory of Gases to explain the behavior of gases on a macroscopic (visible to the naked eye) scale. The Kinetic Molecular Theory of Gases describes how gases behave and can allow us to predict certain properties of gases. Review the basic rules in Section 1: The Basic Idea of Kinetic Molecular Theory in Gas Molecules in Motion.

Here are the five parts of the Kinetic Molecular Theory of Gases:

1. Gas particles are in constant motion and separated from each other by large distances. Therefore, the volume of the gas molecules in a sample is extremely small compared to the overall volume of the gas. Most of the volume of a gas is empty space.
2. Molecules of an ideal gas do not interact with each other or the walls of the container.
3. Molecules of a gas are in constant random motion. This random motion is in straight lines.
4. All collisions among gas molecules are elastic collisions. This means that there is no energy loss when gas molecules collide.
5. The temperature of a gas is directly proportional to its average kinetic energy, or energy of motion.

Particles in a gas phase are in constant motion and fill the entire container they inhabit. The gas particles are constantly hitting the surface of the container they are in, and exert force on the container surface. We define the pressure of the gas as the amount of force the gas exerts on the container they inhabit per unit area.

The Kinetic Molecular Theory of Gases explains the basic properties of gases. Review Section 2: How Kinetic Molecular Theory Explains Gas Laws in Gas Molecules in Motion.

According to the Kinetic Molecular Theory of Gases, gas must have pressure because it is constantly in motion in its container. When gas particles hit the wall of the container, they exert a force. Force divided by area is defined as pressure.

We can express the kinetic energy, the energy of motion, mathematically as:

$\mathrm{ke}=\frac{mv^2}{2}$

($\mathrm{ke}$ represents kinetic energy, $m$ represents mass, $v$ represents velocity).

Keep in mind that temperature corresponds directly with average kinetic energy. As temperature rises, the velocity (speed) of the gas particles, as per the equation above, also increases.

The pressure of a gas also corresponds directly with its kinetic energy. As kinetic energy rises, the force with which the gas particles hit the wall of the container increases. Consequently, the pressure also increases.

As we increase the number of moles of gas in a container at constant pressure, more gas particles will hit the walls of the container in a given amount of time. If the pressure is constant, this will force the volume of the container to increase.

5b. Perform dimensional analysis conversions for gas law calculations

• Use the gas constant with proper units to complete gas law equation calculations.
• Convert units given in a question to units consistent with the units of the gas constant.

Many gas laws describe the behavior of gases under specific sets of conditions. These mathematical relations allow us to perform calculations – to calculate properties, such as pressure, temperature, volume, and number of moles of a gas under given conditions.

We express the gas constant mathematically as:

R = 0.082 L atm/mol K

Keep in mind that for gas law calculations:

• Measurements of volume must be in L (liters);
• Measurements of pressure must be in atm (atmospheres);
• Measurements of substance must be in moles; and
• Measurements of temperature must be in K (the Kelvin temperature scale).

Review the Ideal Gas Law in Section 4: The Ideal Gas Equation of State in The Basic Gas Laws. See Problem Example 3 for an example of how to use the Ideal Gas Law.

5c. State the ideal gas law

The ideal gas law shows the relationship among pressure, temperature, volume, and number of moles of a gas in ideal conditions. We express the ideal gas law mathematically as:

PV = nRT

(P represents pressure in atm, or atmospheres; V represents volume in L, or liters; n represents the number of moles; R represents the gas constant, or 0.082 L atm/mol K; and T represents temperature, which is K or the Kelvin scale.)

Review the Ideal Gas Law in Section 4: The Ideal Gas Equation of State in The Basic Gas Laws. See Problem Example 3 for an example of how to use the Ideal Gas Law.

5d. Describe the motion of particles in liquids and the properties of liquids

• Describe the properties of a liquid.
• How do particles in a liquid move?

Liquids exist between a substance's melting and boiling point.

Liquids are mobile, or exhibit mobility, which means their molecules can move around and change shape according to the container they inhabit. Viscosity describes another property of liquids, which means their resistance to flow. A liquid with high viscosity flows slowly (think of maple syrup or molasses), while a liquid with low viscosity flows easily (such as water). Viscosity relates to the strength of the intermolecular forces within the liquid.

Liquids also exhibit surface tension, which results from the strength and types of intermolecular forces within the liquid. As its name suggests, surface tension occurs on the surface of the liquid.

Within the bulk of a liquid, a liquid particle interacts with all of its surrounding particles. However, a liquid particle on the surface can only interact with the particles next to and below it. In general, intermolecular forces work to minimize the amount of surface area of liquids, so the intermolecular forces are maximized. Consequently, liquids form drops.

Review the properties of liquids in Section 1: What is a Liquid? in Liquids and their Interfaces.

5e. Discuss the process by which liquids can change into a solid or a gas

• Define vapor pressure.
• How does vapor pressure lead to phase change for liquids?
• Define nucleation.
• How does nucleation lead to phase change for liquids?

Phase changes occur when a substance changes between different states – solid, liquid, or gas. All substances have a property known as free energy, which describes the tendency of a substance's thermal energy to escape and disperse.

Equilibrium vapor pressure, or vapor pressure, measure the tendency of surface liquid molecules to escape into the gas phase.

In the figure above, when the container of water is open, no pressure from water molecules that have gone into the gas phase exists (as they escape into the rest of the room).

We can express this statement mathematically as Pw = 0 (i.e., the pressure of water equals zero).

When the container is closed, the pressure of the water molecules in the gas phase directly above the liquid increases (since they can no longer escape the container). Some water molecules escape to the gas phase, and some go back into the liquid phase. This builds until an equilibrium is reached among particles going into the gas phase and particles going back into the liquid phase.

When the equilibrium is reached, the system is at its equilibrium vapor pressure. For a liquid to boil, the vapor pressure must equal the external pressure.

During freezing, liquids turn into solid: the vapor pressure of the liquid equals the vapor pressure of the solid. The liquid changes phase into a solid.

5f. Define the characteristics of bonding in ionic compounds

• What types of elements are generally involved in making ionic compounds?
• How does ionic bonding differ from covalent bonding?
• What do ionic compounds look like? What are their properties?

Ionic solids form a lattice of oppositely-charged ions held together by Coulombic charges. Ionic compounds are composed of positively and negatively charged ions held together by Coulombic charges. In other words, opposite charges are attracted to each other and the ionic solids form crystal lattices with a regular, repeating structure. This is different from covalently bonded compounds which are held together by covalent bonds.

This figure displays the crystal lattice of sodium chloride (table salt):

Ionic compounds are hard. Hardness measures how resistant a substance is to being deformed. Ionic compounds are also brittle. Brittleness means that one layer of the crystal lattice can "slip" over another when it is hit with a physical stress, which can cause the substance to break.

For more details and examples of ionic solid structure, review Section 1: Introducing Ionic Solids in Ionic and Ion-derived Solids.

5g. Interpret phase diagrams

• Identify the parts of a phase diagram, including the critical point and triple point.
• For a given temperature and pressure, determine the state of matter on a phase diagram.

A phase diagram details the phase a substance will be in at any temperature and pressure.

This figure details a general phase diagram for a given substance.

• The horizontal axis shows the temperature, and the vertical axis shows the pressure.
• The lines or curves are phase boundaries or conditions where the substance exists in equilibrium between two phases.
• The area on the left (colored in yellow) shows the set of temperature and pressure conditions where a solid exists.
• The area in the top middle (in green) shows the set of temperature and pressure conditions where a liquid exists.
• The area in the bottom to the right (in blue) shows the set of temperature and pressure conditions where a gas exists.
• The triple point displays the point where all three states of matter (solid, liquid, and gas) are in equilibrium.
• The critical point displays the point where you can no longer have a liquid or a gas. Rather, after the critical point, a form of matter called a supercritical fluid is formed. Supercritical fluids have a unique set of properties that are similar to both liquids and gases. Supercritical fluids flow through solids like gases and can dissolve substances like liquids.

This graph shows the phase diagram of water. Look at the four numbered points to determine the phase or phases of matter present at those conditions.

• At the pressure and temperature point labeled 1, the water is a solid, since the point is in the solid region of the diagram.
• At point 2, the water is at a phase boundary (the liquid-solid phase boundary). This means the water is in equilibrium between its solid and liquid state.
• At point 3, the water is in the gas or vapor state.
• At point 4, the water is above the critical point, which means it is in the state of supercritical fluid.

Review more examples of phase diagrams in Section 3: Phase Maps in Phases, Changes of State.

5f. Describe and explain the processes of boiling, evaporation, freezing, melting, and sublimation

There are five common types of phase changes.

1. Boiling describes the change from liquid to the gas phase. Boiling occurs when the vapor pressure of the liquid equals the vapor pressure of the external environment. At this point, surface liquid molecules can escape into the gas phase.
2. Evaporation occurs when the liquid container is open and the vapor pressure of the liquid is sufficient for surface molecules to escape into the gas phase.
3. Freezing occurs when the liquid particles do not have sufficient energy to remain in the mobile liquid phase. Freezing occurs when the vapor pressure of the liquid equals that of the solid.
4. Melting occurs when the solid molecules gain sufficient energy to escape into the liquid phase.
5. Sublimation occurs when the solid and gas phases are in equilibrium.

Unit 5 Vocabulary

• Atmosphere
• Boiling
• Brittleness
• Coulombic charge
• Constant pressure
• Critical point
• Crystal lattice
• Elastic collision
• Equilibrium vapor pressure/vapor pressure
• Evaporation
• Free energy
• Freezing
• Gas constant
• Hardness
• Ideal gas
• Ideal gas equation
• Ideal gas law
• Intermolecular forces
• Ionic compound
• Kelvin
• Kinetic energy
• The Kinetic Molecular Theory of Gases
• Melting
• Mobility
• Nucleation
• Phase boundaries
• Phase change
• Phase diagram
• Pressure
• Sublimation
• Supercritical fluid
• Surface tension
• Triple point
• Vapor pressure
• Viscosity


text:
# How to hide a part of a latex file?

I would like to have a generic command that basically reserves space for a set of commands, without actually rendering them in the PDF.

For example, \hide{this is some hidden text} will allocate space in the pdf for that string, but will never actually print it -- it will be just white.

Or alternatively, it should also work with \hide{\includegraphics[width=3in]{image.png}}. If there is no way to do it generically, I would at the very least want to know whether I can do it with the includegraphics command.

• This may be a duplicate of How do I create an invisible character?, as the answers actually apply to more than a single character. If not, please clarify. – Chris H Sep 25 '15 at 11:52
• Does my answer of your question is what you want or you want to create invisible character as suggest Chris? – Romain Picot Sep 25 '15 at 11:54

there are

\phantom{whatever}%  an empty box with width and height of the argument
\vphantom{whatever}%  an empty box with a zero width and height of the argument
\hphantom{whatever}%  an empty box with a width and zero height of the argument

• Per comments under other response, tested with floats and does not compile. Works well for simple text though. – Aubrey Blumsohn Sep 25 '15 at 16:45
• Use \phantom inside the float! – user2478 Sep 25 '15 at 17:27
• Yes indeed -that does work – Aubrey Blumsohn Sep 25 '15 at 18:08

You can use comment package:

\documentclass{article}

\usepackage{comment}

\begin{document}
\begin{comment}
not shown
\end{comment}
show on the pdf
\end{document}

output:

• The OP's question doesn't read like that to me -- it sounds like they want empty space to be shown in place of the text. – Chris H Sep 25 '15 at 11:50
• @ChrisH perhaps. In this case The answer should be \phantom{text} but not sure that is work with graphics. – Romain Picot Sep 25 '15 at 11:52
• @RomainPicot for floating content, I'm pretty sure it just wouldn't work. Only way it could would be to patch many different commands to respect some piece of state that's passed down implicitly. – Sean Allred Sep 25 '15 at 12:35

There are several different questions here so I am going to address only the main one which appears to be the hiding of specified graphics. It is presumed that the image file exists (and has a particular dimension) and the aim is to produce either a space or a placeholder that would be the same size as would be produced, while at the same time not making the image available to the reader. This could serve the purpose of reducing file size in a draft, or acting as a placeholder for an incorrect image. You could do something like the below, measuring the image and then inserting a tikz node in its place. By altering the code you could remove or alter the text inside, and remove the border at various times.

I did this by defining a variant of \includegraphics (\includegraphicsd)

\documentclass{article}
\usepackage{tikz}
\usepackage{xparse}
\usepackage{graphicx}

\newsavebox\abimagebox
\DeclareDocumentCommand \includegraphicsd { o m }{%
\sbox\abimagebox{\includegraphics[#1]{#2}}%
\begin{tikzpicture}
\node[draw, dashed, text width=\the\wd\abimagebox,minimum height=\the\ht\abimagebox, align=center, inner sep=0]{This is white};%
\end{tikzpicture}%
}%

\begin{document}

%This image is shown
\begin{figure}[htbp]
\centering
\includegraphics[width=0.345\textwidth]{example-image-a}
\caption{Close up of an opossum, part of the genus of piglet.}
\end{figure}

%This one is not shown
\begin{figure}[htbp]
\centering
\includegraphicsd[width=0.345\textwidth]{example-image-a}
\caption{Close up of an opossum, part of the genus of piglet.}
\end{figure}

\end{document}

If you want hide pictures to speed up compilations in a PDF preview or save ink cartridges in printer test, but a completely empty space is not essential, then the most simple method is use the draft option in the graphicx package to obtain only a frame with the name of the image.

And may be too obvious, but for most common texts without colors and without brackgrounds, is worth to note that an easy method could be use a white color. As simple \def\hide#1{\textcolor{white}{#1}} to hide and \def\hide#1{#1} to unhide. Obviously, the advantage/disadvantage of a white text with respect a true \phantom text is that you can still select and copy the hidden text in the PDF viewer.

\documentclass{article}
\usepackage[draft]{graphicx}
\usepackage{xcolor}
\def\hide#1{{\color{white}#1}}
\begin{document}
\begin{figure}[htbp]
\centering\includegraphics[width=0.345\textwidth]{example-image-a}
\caption{Close up of \hide{an opossum}, part of the \hide{genus} of piglet.}
\end{figure}
\end{document}

I know I'm late to this, but I think I found a good solution when trying to figure out the header for my resume.

The following command works to create a blank \raisebox with the dimensions of the input. It works for single-line text and \includegraphic commands, including wrap-text instances like the wrapfig package offers.

Note that you'll need the xspace package in order for the command to act like the given image or text with respect to surrounding spaces.

\documentclass{article}

\usepackage{xspace}
\usepackage{graphicx}

\newlength{\svarW}
\newlength{\svarH}
\newcommand{\makethismuchbox}[1]
{
\settowidth{\svarW}{#1}
\settoheight{\svarH}{#1}
\raisebox{0ex}[\the\svarH]{\hspace{\the\svarW}}\xspace
}

\begin{document}

% HEADER with two logos showing
{
\centering
\sffamily
\includegraphics[scale=.1]{my_logo}
\hfill
\Huge{My Name}
\hfill
\includegraphics[scale=.1]{my_logo}
}

\vspace{4ex}

% HEADER with one logo showing
{
\centering
\sffamily
\makethismuchbox{\includegraphics[scale=.1]{my_logo}}
\hfill
\Huge{My Name}
\hfill
\includegraphics[scale=.1]{my_logo}
}

\end{document}

Which outputs:

format: plain


text:
The Babylonian Number System

The ancient Babylonians lived in what is now Iraq. They had a number system using the base 60, compared to the now universally used base 10. The Babylonians constructed their system using only two symbols, a symbol representing 1 and a symbol representing 1 (we use ten symbols - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9). The numbers 1 to 59 as constructed as in the diagram.

The Babylonian system built on the earlier Arkadian and Sumerian systems by introducing place values. This made the writing of large numbers easier and more compact.
Consider the number written in Babylonian symbols as

We translate this into decimal as
$1 \times 60^3 + 57 \times 60^2 + 46 \times 60 + 40=424000$

We have inherited from the Babylonians the division of the circle into 360 degrees, the degree into 60 minutes, the minute into 60 seconds etc, and the hour into 60 minutes and the minute into 60 seconds.


text:
# prospeed

## Recommended Posts

There's more than one call to that function. You have to fix all calls, not just one of them. There may be other places where the wrong parameters are being passed. I wrote the corruption detection code and discovered the problem in Prospeed.au3. Once I did that and confirmed for myself that fixing the number of arguments caused a crash at a different place in the code, I quit work on it.

##### Share on other sites

sorry the udf and example's work only whit version autoit-v3.2.1.2

Tryit many diferent call's in last beta butt i dont't get it error free

i am working on it.

hope with some help from Valik

To fix all call's Valik is no problem in the udf when i know how to combine two argument's in one call.

##### Share on other sites

Jpam, thanks for your continued efforts on this, much appricated.

2015 - Still no flying cars, instead blankets with sleeves.

##### Share on other sites

Yes, it does indeed work with Autoit V.3.2.1.2

Its available from here http://www.autoitscript.com/autoit3/files/beta/autoit/sav/

I downloaded the zip and extracted it to a folder, I put the Prospeed.au3 UDF into the Include folder there.

I then created a shortcut to Autoit.exe and put in the folder where all my Prospeed examples are stored, you can put it anywhere, but put it somewhere so you cant get mixed up with the current version of autoit.

To run the ProSpeed Demos/examples click on the Autoit shortcut you have made, it should bring up a fileselect menu, click on any of the Prospeed examples to run them, it works!

Autoit Developers we really need your help here...

As you can see by the number of views to this topic, there is huge interest in this!

Thanks as always for everyones efforts to get this working.

2015 - Still no flying cars, instead blankets with sleeves.

##### Share on other sites

Valik

please can you look at this syntax

Dllcall using 1 argument

autoit-v3.2.1.2-beta

$S_PIC = DllCall($S_DLL,"long","LoadExtImage","str",$S_File) ;Works fine$S_PIC[0] gives data back

$S_PIC[1] gives Filestring back autoit-v3.2.2.0 Type "str"$S_PIC = DllCall($S_DLL,"long","LoadExtImage","str",$S_File) ;AutoIt Crash

Type "wstr"

$S_PIC = DllCall($S_DLL,"long","LoadExtImage","wstr",$S_File) ;No Crash$S_PIC[0] gives 0 back

$S_PIC[1] gives Filestring back Thanks in advange jpam #### Share this post ##### Link to post ##### Share on other sites I don't see anything obvious. This is crashing in a very strange place. It doesn't crash in a debug build and in fact, I don't even get any warnings which is strange. It's crashing when AutoIt tries to access a local variable which is unrelated to the DLL and the variables passed to it. I also don't see any changes that would affect this. This needs some further research. #### Share this post ##### Link to post ##### Share on other sites sorry the udf and example's work only whit version autoit-v3.2.1.2 Tryit many diferent call's in last beta butt i dont't get it error free i am working on it. hope with some help from Valik To fix all call's Valik is no problem in the udf when i know how to combine two argument's in one call. Isn't LoadExtImage suposed to have a pointer to a string and not a string? (LoadExtBmp and LoadExtImage does not have the same call syntax as fare as I can read from the documentation. I'm not sure if this will make AutoIt pass on the pointer to the string Local$S_background = DllCall($gDll,"long","LoadExtImage","ptr",$S_FILE)oÝ÷ Øêâ*.«Þ¶hÙbëaÆ®¶sb33c·âÒFÆÅ7G'V7D7&VFRgV÷C·7G"gV÷C² FÆÅ7G'V7E6WDFFb33c·âÂÂb33cµ5ôdÄR b33c·âÒFÆÅ7G'V7DvWEG"b33c·âÂ Æö6Âb33cµ5ö&6¶w&÷VæBÒFÆÄ6ÆÂb33c¶tFÆÂÂgV÷C¶ÆöærgV÷C²ÂgV÷C´ÆöDWDÖvRgV÷C²ÂgV÷C·G"gV÷C²Âb33c·â

When I tested AutoIt dont crash on that line, in the Background function. But I did not get a handle to the image either so it does crash on the next dllcall.

Why it works in the older beta beats me..

##### Share on other sites

The AutoIt str type is passed as char* which is a pointer to an array of char. You want to use "str". It's fine. This has nothing to do with that at all. The crash is somewhere else inside DllCall().

##### Share on other sites

I think that its something to do how Autoit stores the array after autoit v3.2.1.2-beta

When i play with different type's sometimes it give me an errror in memory allocation

only string type "str" gives me the pointer for the first byte of the image

thanks guys for looking in to this problem

##### Share on other sites

Hello jpam,

Not sure why this isn't working for me, I tried running with several betas, I tried this too:

I downloaded the zip and extracted it to a folder, I put the Prospeed.au3 UDF into the Include folder there.

I then created a shortcut to Autoit.exe and put in the folder where all my Prospeed examples are stored, you can put it anywhere, but put it somewhere so you cant get mixed up with the current version of autoit.

To run the ProSpeed Demos/examples click on the Autoit shortcut you have made, it should bring up a fileselect menu, click on any of the Prospeed examples to run them, it works!

And I'm still getting this error, everytime:

C:\PROGRA~1\AutoIt3\beta\Include\prospeed.au3 (364) : ==> Subscript used with non-Array variable.:
$S_WIDTH = DllCall($S_DLL,"long","GetBmpWidth","long",$S_background[0])$S_WIDTH = DllCall($S_DLL,"long","GetBmpWidth","long",$S_background^ ERROR

Am I doing something wrong? Perhaps it is a mistake in the updated version?

Kurt

Awaiting Diablo III..

##### Share on other sites

I found the reason for the crash. While the crash was in AutoIt, I think the DLL is to blame. Never-the-less, I can fix it in AutoIt and will. A future version of AutoIt will have this fix in it.

##### Share on other sites

Hello jpam,

Not sure why this isn't working for me, I tried running with several betas, I tried this too:

And I'm still getting this error, everytime:

C:\PROGRA~1\AutoIt3\beta\Include\prospeed.au3 (364) : ==> Subscript used with non-Array variable.:
$S_WIDTH = DllCall($S_DLL,"long","GetBmpWidth","long",$S_background[0])$S_WIDTH = DllCall($S_DLL,"long","GetBmpWidth","long",$S_background^ ERROR

Am I doing something wrong? Perhaps it is a mistake in the updated version?

Kurt

You MUST use Autoit V.3.2.1.2, UnZip into its own Folder, not where the current versions are installed and remember to put the ProSpeed.au3 file into the include folder where you have unziped this version to.

You could put something like this at the start of the ProSpeed code..

MsgBox(0,"You must Use Version V.3.2.1.2 !!", "You are using Version " &@AutoItVersion)
to check you are running the correct version (until it Autoit gets fixed to run this Dll anyway)

Also double check you have the Prospeed.dll either in the same folder, or even better, in your Windows/System32 folder.

Edited by Lakes

2015 - Still no flying cars, instead blankets with sleeves.

##### Share on other sites

I found the reason for the crash. While the crash was in AutoIt, I think the DLL is to blame. Never-the-less, I can fix it in AutoIt and will. A future version of AutoIt will have this fix in it.

2015 - Still no flying cars, instead blankets with sleeves.

##### Share on other sites

THanks Valik !!!

i am glad that you found the problem

and can fix it in the next beta !

Thanks again!

now i can continue working on the udf.

jpam

Edited by jpam

##### Share on other sites

@ kurt

The error is that the dll call does not give you the array back

he can not find your picture on disk

make sure that you specified the path where the dllcall can find it

##### Share on other sites

Yes, I knew that. I solved my problem by placing Prospeed.dll in the proper directory.. Hehe :"> stupid me.

Kurt

Awaiting Diablo III..

##### Share on other sites

I`ve been playing with the sprite functions, the sprites do seem to be arranged in an odd way, when I tried to do the same with some larger sprites, the frames for one direction (top row) are displayed fine, but the sprites are displayed out of place (black boarder at the bottom) for the return direction (bottom row), I even left a gap in the middle, like the example gif for the bee.

Do you have any info how the sprite function selects frames from a Sprite.gif?

Thanks.

2015 - Still no flying cars, instead blankets with sleeves.

##### Share on other sites

you need to set the offset X and Y for the sprite

greetings

jpam

##### Share on other sites

you need to set the offset X and Y for the sprite

greetings

jpam

Thanks Jpam, will do.

2015 - Still no flying cars, instead blankets with sleeves.

## Create an account

Register a new account

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...


text:
# RcppGSL 0.1.0

December 1, 2010
By

(This article was first published on Thinking inside the box , and kindly contributed to R-bloggers)

Earlier in the year, Romain and I did a bunch of initial work on a wrapper from R to the GNU GSL by way of our Rcpp package for seamless R and C++ integration. But other work kept us busy and this fell a little to the side.

We have now found some time to finish this work for a first release, together with a nicely detailed eleven page package vignette. As of today, the package is now a CRAN package, and Romain already posted a nice announcement on his blog and on the rcpp-devel list.

So what does RcppGSL do? I gave the package its own webpage here as well and listed these points as key features of RcppGSL:

• templated vector and matrix classes: these are similar to Rcpp's own vector and matrix classes, but really are just smart pointers around the C structure expected by the library
• this means you can transfer data from R to your GSL-using programs in pretty much the same way you would in other C++ programs using Rcpp---by relying on the Rcpp::as() and Rcpp::wrap() converterrs
• at the C++ level you can use these GSL vectors in a more C++-alike way (using eg foo[i] to access an element at index i)
• yet at the same time you can just pass these vector and matrix objects to the GSL functions expecting its C objects: thanks to some cleverness in these classes they pass the right object on (see the example below)
• we also provide the lightweight views for vectors and matrices as the GSL API uses these in many places.

Also provided is a simple example which is a simple implementation of a column norm (which we could easily compute directly in R, but we are simply re-using an example from Section 8.4.14 of the GSL manual):

#include <RcppGSL.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_blas.h>

extern "C" SEXP colNorm(SEXP sM) {

try {

RcppGSL::matrix<double> M = sM;     // create gsl data structures from SEXP
int k = M.ncol();
Rcpp::NumericVector n(k);           // to store results

for (int j = 0; j < k; j++) {
RcppGSL::vector_view<double> colview = gsl_matrix_column (M, j);
n[j] = gsl_blas_dnrm2(colview);
}
M.free() ;
return n;                           // return vector

} catch( std::exception &ex ) {
forward_exception_to_r( ex );

} catch(...) {
::Rf_error( "c++ exception (unknown reason)" );
}
return R_NilValue; // -Wall
}

This example function is implemented in an example package contained in the RcppGSL package itself -- so that users have a complete stanza to use in their packages. This will then build a user package on Linux, OS X and Windows provided the GSL is installed (and on Windows you have to do all the extra steps of defining an environment variable pointing to and of course install Rtools to build in the first place---Linux and OS X are so much easier for development).

Another complete example is in the package itself and provides a faster (compiled) alternative to the standard lm() function in R; this example is the continuation of the same example I had in several versions of my Intro to HPC with R tutorials and in the Rcpp package itself as an early example.

We will try to touch base with CRAN package authors using both GSL and Rcpp to see how this can help them. The API in our package may well be incomplete, but we are always happy to try to respond to requests for additional features brought to our attention, preferably via the rcpp-devel list.

More information is on the RcppGSL page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.


text:
## Dirichlet Inverses - The Mobius Inversion Formula

The derivative of an arithmetical function is defined as the arithmetical functionfor

Example

for all

Sincewe can write

The definition of derivative given above obeys many of the rules obeyed by the ordinary derivative in calculus.

Theorem

a)

b)

c)

a)True by linearity of the summation.

b)

c)0=so

Multiply both sides byto givesince

Example

DifferentiatinggivesDifferentiating again givesand usinggivesnow multiply both sides by u^{-1}=%mu to give

This last equation is called the Selberg Identity.


text:
# Program 1

## Logistics

• Due: Monday, May 24th no later than 11:59pm.
• Submission instructions: push a commit with the tag program1 to your git repository.
• Deadline reminder: after the deadline passes, you cannot earn any points for this assignment. If the deadline is approaching, submit what you have in order to earn partial credit.

## Learning outcomes

• Read a command line argument
• Create and manipulate arrays
• Sort arrays
• Organize your program into separate files
• Use makefiles

## Assignment

A network address is made up of 4 sections – each an integer from 0-255. Each section is separated by a period (.) when shown to the user. Depending on the class of the address, one or more sections identify the network and one or more sections identify the host within the network. For an IP addresses from Class A, the first 8 bits (the first number) represent the network part, while the remaining 24 bits (last 3 numbers) represent the host part. For Class B, the first 16 bits (the first two numbers) represent the network part, while the remaining 16 bits (last 2 numbers) represent the host part. For Class C, the first 24 bits represent the network part (the first 3 numbers), while the remaining 8 bits (the last number) represent the host part. To idenfity which class a network is, we can look at the first number.

• A: 0-127
• B: 128-191
• C: 192-223
• D: 224-239
• E: 240-255

For this assignment, you will read in a file of network addresses (using scanf and file redirection) and print out some statistics about the networks in the file. You should ignore Class D and Class E networks. Your program will also take in a command line argument indicating the number of network addresses to be processed.

The statistics you must compute are:

• The number of Class A, Class B, and Class C networks
• For each of Class A, Class B, and Class C, the network with the most hosts and the number of hosts it contains.

1. Convert the command line argument into an int. If there is no command line argument, print an error and end the program. This argument is the number of network addresses that will be in the file.
2. Read each address into a 2 dimensional array of 4 unsigned chars. The size of the first array dimension is the command line argument. (Note: you can use the int data type instead, but you will lose 5 points. If you feel more comfortable with int, you could write your program with int first and change it to unsigned char after it is working.)
3. Sort the array. (You will need to implement a sorting algorithm of your choice.)
4. Use the sorted array to compute the information you need.

### Sample input and output

There are a number of sample input files in the /public/pgm1 directory.

Here is what your output should look like when you run your program on the inp17.txt, inp2000.txt, inp5000.txt, and inp8000.txt sample files.

[p19t655@csci112 program1]$./pg1 17 < inp17.txt Class A has 5 networks Largest A network is 106 with 3 hosts Class B has 5 networks Largest B network is 137.249 with 2 hosts Class C has 2 networks Largest C network is 215.116.26 with 2 hosts [p19t655@csci112 program1]$ ./pg1 2000 < inp2000.txt
Class A has 128 networks
Largest A network is 38 with 16 hosts
Class B has 484 networks
Largest B network is 129.74 with 2 hosts
Class C has 256 networks
All C networks have only 1 host
[p19t655@csci112 program1]$./pg1 5000 < inp5000.txt Class A has 128 networks Largest A network is 95 with 35 hosts Class B has 1234 networks Largest B network is 144.40 with 3 hosts Class C has 640 networks All C networks have only 1 host [p19t655@csci112 program1]$ ./pg1 8000 < inp8000.txt
Class A has 128 networks
Largest A network is 106 with 50 hosts
Class B has 1961 networks
Largest B network is 141.175 with 4 hosts
Class C has 987 networks
Largest C network is 216.24.49 with 2 hosts

### Hints

• If you prefer, you can write your entire program in one single file and just separate it into four different files before you turn it in.
• Print an unsigned char using the placeholder %hhu.
• Start early!

### Requirements

• Write your program in a file called program1.c in your csci112-firstname-lastname/programs/program1/ directory.
• You must use at least three functions in addition to main. Each should be stored in a separate file. (If you use more than four total functions, you can use four or more files.)
• Since the network addresses are made up of integers between 0 and 255, use the unsigned char data type to store them instead of int. This way, they only take 1 byte (8 bits) instead of 4 bytes, meaning that your program will take only a quarter of the memory.
• You must use a makefile to compile and link your separate files.
• You may not use global variables.
• Your output formatting must match the example. Use a tool like diffchecker to compare your output with the sample output. Don’t worry about trailing spaces.

• 5 points - code is indented so that it is readable
• 5 points - there are no global variables
• 10 points – compiles successfully with -Wall – no warnings
• 5 points – successfully reads in and uses a command line parameter
• 5 points - has error msg if no command line parameter
• 10 points – reads all input into a 2 dimensional array of size command line number x 4
• 5 points - the array is of unsigned char data type
• 5 points – compiles and links with makefile
• 5 points - four functions are stored in different files
• 10 points – computes the number of networks for class A, B, C correctly.
• 15 points – identifies the largest networks for class A, B, C correctly, prints the largest network, and prints the correct largest count
• 5 points – sorts addresses in order to count them
• 10 points - correctly implements a sorting algorithm
• BONUS 5 points - uses a different sorting algorithm other than selection sort (which was shown in the lecture video)


text:
# Camber (aerodynamics)

Jump to: navigation, search

In aeronautics and aeronautical engineering, camber is the asymmetry between the top and the bottom surfaces of an aerofoil. An aerofoil that is not cambered is called a symmetrical aerofoil. The benefits of camber, in contrast to symmetrical aerofoils, were discovered and first utilized by Sir George Cayley in the early 19th century.[1]

## Overview

Camber is usually designed into an aerofoil to increase the maximum lift coefficient. This minimizes the stalling speed of aircraft using the aerofoil. Aircraft with wings based on cambered aerofoils usually have lower stalling speeds than similar aircraft with wings based on symmetric aerofoils.

An aircraft designer may also reduce the camber of the outboard section of the wings to increase the critical angle of attack (stall angle) at the wing tips. When the wing approaches the stall angle this will ensure that the wing root stalls before the tip, giving the aircraft resistance to spinning and maintaining aileron effectiveness close to the stall.[citation needed]

Some recent designs use negative camber. One such design is called the supercritical aerofoil. It is used for near-supersonic flight, and produces a higher lift to drag ratio at near supersonic flight than traditional aerofoils. Supercritical aerofoils employ a flattened upper surface, highly cambered (curved) aft section, and greater leading edge radius as compared to traditional aerofoil shapes. These changes delay the onset of wave drag.

## Definition

The camber of an aerofoil can be defined by a camber line, which is the curve that is halfway between the upper and lower surfaces of the aerofoil. Call this function Z(x). To fully define an aerofoil we also need a thickness function T(x), which describes the thickness of the aerofoil at any given point. Then, the upper and lower surfaces can be defined as follows:

${\displaystyle Z_{\text{upper}}(x)=Z(x)+{\frac {1}{2}}T(x)}$
${\displaystyle Z_{\text{lower}}(x)=Z(x)-{\frac {1}{2}}T(x)}$

### Example – An aerofoil with reflexed camber line

An aerofoil with reflex camber.

An aerofoil where the camber line curves back up near the trailing edge is called a reflexed camber aerofoil. Such an aerofoil is useful in certain situations, such as with tailless aircraft, because the moment about the aerodynamic center of the aerofoil can be 0. A camber line for such an aerofoil can be defined as follows (note that the lines over the variables indicates that they have been nondimensionalized by dividing through by the chord):

${\displaystyle {\overline {Z}}(x)=a\left[\left(b-1\right){\overline {x}}^{3}-b{\overline {x}}^{2}+{\overline {x}}\right]}$

An aerofoil with a reflexed camber line is shown at right. The thickness distribution for a NACA 4-series aerofoil was used, with a 12% thickness ratio. The equation for this thickness distribution is:

${\displaystyle {\overline {T}}(x)={\frac {t}{0.2}}\left(0.2969{\sqrt {\overline {x}}}-0.1260{\overline {x}}-0.3516{\overline {x}}^{2}+0.2843{\overline {x}}^{3}-0.1015{\overline {x}}^{4}\right)}$

Where t is the thickness ratio.

## References

1. ^ "U.S Centennial of Flight Commission.". Retrieved 2008-09-10. Experiments that he began to carry out in 1804 allowed him to learn more about aerodynamics and wing structures using a whirling arm device. Cayley observed that birds soared long distances by simply twisting their arched wing surfaces and deduced that fixed-wing machines would fly if the wings were cambered. This was the first scientific testing of aerofoils as the part of the aircraft that is designed to produce lift.
Sources


text:
## Tunnel Diode Oscillator Essentials

#### Chuck Agosta - Clark University

The tunnel diode oscillator (TDO) is a highly stable self resonating oscillator system that we use to measure rf penetration depth in conducting, superconducting, and magnetic materials. It allows us to study superconducting properties, resistivity, and magnetic properties of materials without attaching leads, an advantage with the small delicate samples that we study. In addition, working at frequencies in the tens or hundreds of megahertz is compatible with pulsed magnetic fields where we can study material properties up to 50 tesla in our own laboratory, or 100 tesla at the NHMFL at Los Alamos National Laboratory.

As an example of how simple it is to prepare a sample for study, a picture of a sample in a coil is shown to the left. The coil is attached to a circuit diagramed below to force it to ring at its resonant frequency. As the properties of the material change, the penetration depth changes, which in turn changes the inductance and the resonant frequency of the circuit. By measuring the frequency shift of the circuit we can infer the changes in the properties of the sample. The circuit we use is based on a tunnel diode which has an area of negative resistance (decreasing current with increasing voltage) due to quantum mechanical tunneling through an insulating layer between the PN junction, as shown in the figure below. If the diode is biased into its negative resistance region it becomes unstable, and if it is connected to a resonant circuit, the circuit will self resonate. We normally run the circuit at cryogenic temperatures, and at low temperatures the circuit can have a stability of 1 part in $10_9$ in the right situation. In most cases we place our sample in the coil of the resonant circuit as shown above, and as the penetration depth into the sample changes, the inductance of the coil changes which shifts the resonant frequency. The high stability of the circuit allows us to measure changes of penetration depth less than 1 angstrom.

The seminal paper on the use of the TDO is by Van Degrift 1, and we have adapted the design principles in that paper for studying solid state samples at high magnetic fields. Our basic methods and design criteria solve the problems of using small lower Q coils, pulsed magnetic fields, and very low (dilution refrigerator) temperatures.

An example of a TDO circuit that we use in our research is shown is the second figure. The tunnel diodes we use have a peak current of 150 - 400 $\mu$A. The diode voltage at the peak current is always about 40 mV, and a typical 300 $\mu$A diode corresponds to a negative resistance $R_n = -300\Omega$. The parasitic resistor $R_p = 75\Omega$ based on VanDegift's formula of $R_p = R_n/4$, and $R_2 = (R_n - R_p)/4$, or about $50Ω$ in our case. $R_1$ ideally forms the rest of the voltage divider, and helps to isolate the circuit from noise from the top of the cryostat, although it also adds heat to the cryostat. In the original paper it was set to the absolute value of $R_n$, but we tend to set it equal to $R_2$, and move that resistance to the bias box outside the cryostat. Because $R_1$ is now small, $C_c$ is moot, so we skip it. $C_b$ keeps the voltage more or less constant at the top of the voltage divider, and serves to isolate the oscillator from the outside world. A typical value of $C_b$ is $1000/(2\pi f |R_n|)$ where f is the resonant frequency of the oscillator. The inductor is the coil that we wind that will contain the sample we plan to study, as seen above. A high filling factor translates to a sensitive measurement, so we tend to wind custom coils for each sample with the goal of a 20-60% filling factor. The capacitor of the oscillator (tank circuit) is mostly from the parasitic capacitance, but we find that putting at least a 1-3 pf chip capacitor on the circuit board stabilizes the frequency against the variable diode capacitance and cable capacitance that inevitably couples to the circuit.
Click here to get to a calculator for setting up a TDO based on Van Degrift's design, in addition to other design considerations.

There are two important additions to the circuit critical to our work. As described in our paper 2 for pulsed fields there can be a large induced voltage coming from the coil which will push the diode off of its bias point. To avoid that problem we add a second identical coil, or any additional wire configuration, that has the equal and opposite area exposed to the changing magnetic field. This addition will cancel the induced voltage. The effective area of the coil will become larger and hence the filling factor of the sample coil system will become less, but we usually have enough signal to noise still get the data we need. A second modification to the circuit for our experiments is to move the bias resistors $R_1$ and $R_2$ to a higher point in our cryostat, 4 - 50 cm away from the rest of the circuit, to avoid heating the area where the sample is.

One of the advantages of the TDO penetration depth method is that the method is robust. It runs at a frequency that can be adjusted to fall in a quiet part of the spectrum, far away from the low frequency dB/dt induced voltages and switching noise in a pulsed magnetic field. It also can be arbitrarily small and the sample does not have to be isolated as in calorimetric measurements. A good example of the harsh environments where it works is in diamond anvil cells in pulsed magnetic fields. In a collaboration with Stan Tozer at the NHMFL in 2002, we placed a coil 300 µ in diameter on the face of a diamond in a plastic diamond anvil cell. We were able to run experiments up to 5 kbar in a dilution refrigerator in dc fields up 50 T at 0.5 K in a rotating sample holder.3 A picture of the setup is shown here. This setup has been developed further by Stan Tozer and his group and is now capable of achieving 20 kbar at 0.4 K in 65 T pulsed fields.
_______________________________________________

1 C. T. Van Degrift, "Tunnel diode oscillator for 0.001 ppm measurements at low temperatures," Rev. Sci. Instrum. 46, 599 (1975).
2 T. Coffey, Z. Bayindir, J. F. DeCarolis, M. Bennett, G. Esper, and C. C. Agosta, "Measuring radio frequency properties of materials in pulsed magnetic fields with a tunnel diode oscillator," Rev. Sci. Instrum., 71 4600 (2000).
3 C. Martin, C. C. Agosta, S.W. Tozer, H. A. Radovan, T. Kinoshota, and M. Tokumoto "Critical field and Shubnikov-de Haas oscillations of κ-(BEDT-TTF)2Cu(NCS)2 under pressure" J. Low Temp. Phys. 138, 1025 (2005).
Last updated 11 Dec 2018
Webmaster
cagosta@clarku.edu


text:
## Wednesday, September 29, 2010

### Antineutrons

Charged particles and their antiparticles, such as the electron and positron, are known to have remarkably similar masses. But what about other neutral particles? According to the Particle Data Group, the neutron and antineutron have different masses. That is, they report the result

$\frac{m_n - \overline{m}_n}{m_n} = 9 \pm 6 \times 10^{-5}$

where the neutron mass is $m_n = 939.565346 \pm 0.000023$ MeV. This amounts to a difference that is many orders of magnitude greater than the neutrino mass scale! Further evidence of CPT violation.

1. Interesting but a 1.5 sigma result is not very convincing. I wonder what it would take to measure the antineutron mass a bit better. The lifetime might be worth looking at too.

2. Well, the $1.5$ sigma is why nobody ever mentions it, I guess. If it wasn't for MINOS, I would not have looked at the result myself!

3. Wow! This is the kind of thing I would expect the experimentalists to be working on right now. And I was wondering about the hadrons, without some sort of difference, it's hard to justify extending Koide's formula to the neutrinos.

4. Yeah, pretty cool, isn't it? And the more data I look at, the more anomalies keep popping up ... on a roll here!

5. The mass difference is stated to be mn − mp = 1.2933317 ± 0.0000005 MeV. The formal accuracy is surprising. This is one roughly one fifth of u quark mass which is recently believe to be around 5 MeV. I could not find any reference to article where the result would be reported to see how the claimed difference is measured.

6. The only url I managed to find to the mass measurement of antineutron mass was this
Physics Letters B Volume 177, Issue 2, 11 September 1986, Pages 206-210.
It was measured in bubble chamber.

By putting this to the Google you get to the page which has much longer address.

7. Sorry, I had talked nonsense above. For some reason -probably related to the fact that I am approaching my sixties- I talked about proton neutron mass difference. The claim for the fractional mass difference is .9-1.5 *10^(-4) and gives .084 MeV. In any case this mass difference looks nonsensical.


text:
# sum of 8 squares

• Aug 7th 2009, 11:02 PM
simplependulum
sum of 8 squares
If $X$ and $Y$ can be written as the sum of 8 squares , then their product is also the sum of 8 squares .

that means

$( a^2 + b^2 + c^2 + d^2 + e^2 + f^2 +g^2 + h^2)( A^2 + B^2 + C^2 + D^2 + E^2 + F^2 + G^2 +H^2) =$

$\alpha^2 + \beta^2 + \gamma^2 + \delta^2 + \epsilon^2 + \zeta^2 + \eta^2 + \theta^2$

Show that the relationship between $a,b,c,d...A,B,C,D...\alpha , \beta , \gamma , \delta ...$ is :

$\left(\begin{array}{cccccccc}a&b&c&d&e&f&g&-h\\-b&a&-d&c&-f&e&h&g\\c&-d&-a&b&g&h&-e&f\\d&c&-b&-a&h&-g&f&e\\-e&f&g&h&a&-b&-c&d\\-f&-e&h&-g&b&a&d&c\\g&h&e&-f&-c&d&-a&b\\h&-g&f&e&-d&-c&b&a\end{array}\right)$ $\left( \begin{array}{c}A\\B\\C\\D\\E\\F\\G\\H\end{array}\ right) = \left(\begin{array}{c}\alpha\\ \beta\\ \gamma \\ \delta \\ \epsilon \\ \zeta \\ \eta \\ \theta\end{array}\right)$
• Aug 9th 2009, 09:12 AM
NonCommAlg
Quote:

Originally Posted by simplependulum
If $X$ and $Y$ can be written as the sum of 8 squares , then their product is also the sum of 8 squares .

that means

$( a^2 + b^2 + c^2 + d^2 + e^2 + f^2 +g^2 + h^2)( A^2 + B^2 + C^2 + D^2 + E^2 + F^2 + G^2 +H^2) =$

$\alpha^2 + \beta^2 + \gamma^2 + \delta^2 + \epsilon^2 + \zeta^2 + \eta^2 + \theta^2$

Show that the relationship between $a,b,c,d...A,B,C,D...\alpha , \beta , \gamma , \delta ...$ is :

$\left(\begin{array}{cccccccc}a&b&c&d&e&f&g&-h\\-b&a&-d&c&-f&e&h&g\\c&-d&-a&b&g&h&-e&f\\d&c&-b&-a&h&-g&f&e\\-e&f&g&h&a&-b&-c&d\\-f&-e&h&-g&b&a&d&c\\g&h&e&-f&-c&d&-a&b\\h&-g&f&e&-d&-c&b&a\end{array}\right)$ $\left( \begin{array}{c}A\\B\\C\\D\\E\\F\\G\\H\end{array}\ right) = \left(\begin{array}{c}\alpha\\ \beta\\ \gamma \\ \delta \\ \epsilon \\ \zeta \\ \eta \\ \theta\end{array}\right)$

it's straightforward if you're familiar with $\mathbb{O},$ the normed division algebra of octonions. your question then is equivalent to proving that for any $x,y \in \mathbb{O}: \ ||x|| \cdot ||y|| = ||xy||.$
• Sep 4th 2009, 04:37 PM
luobo
This problem is related to the Degen's eight-square identity.

Degen's eight-square identity - Wikipedia, the free encyclopedia
• Sep 4th 2009, 05:10 PM
ThePerfectHacker
You can also do this with 16 and 32 squares by generalizing the octions. Not sure about 64 and beyond.


text:
# What is Log-Normal Distribution?

Log-Normal Distribution in probability theory is a continuous probability distribution of a random variable whose logarithm is normally distributed. Thus, if the random variable is log-normally distributed, then has a normal distribution. Likewise, if Y has a normal distribution, then X=exp(y) has a log-normal distribution. A random variable which is log-normally distributed takes only positive real values. The distribution is occasionally referred to as the Galton distribution or Galton’s distribution, after Francis Galton.A log-normal process is the statistical realization of the multiplicative product of many independent random variables, each of which is positive. This is justified by considering the central limit theorem in the log domain. The log-normal distribution is the maximum entropy probability distribution for a random variate for which the mean and variance of are specified.


text:
# Attack XOR encryption of binary data compressed by zlib with known key length (very short key)

I am trying to break a packet format. The packet format simply packs several files into one big file. The file contents are plain. But the index data which contain offsets, file sizes and filenames are encrypted. The index data are about 1 KB and compressed by zlib (the DEFLATE algorithm with no zlib or gzip wrapper), and then XOR encrypted. In other words, the key is concatenated with itself many times to get a keystream of equal length as the zlib-compressed data, and then the zlib-compressed data is XORed with this keystream (like a Vigenère cipher). I know the key length is 8 bytes. Is it possible to decrypt the data?

-
What does XOR-encrypted mean? Repeat the key and then XOR with the plaintext? (This is the binary variant of the Vigenère-cipher.) –  Paŭlo Ebermann Feb 10 '13 at 18:21
Yes the 8-byte key is repeated. –  Jellyflower Feb 10 '13 at 20:13
It might help to have a more detailed specification of the situation. What compression algorithm was the data compressed with? DEFLATE? What does "I'm stuck with" mean? Do you have known plaintext? In other words, do you know the entire input to zlib? Part of the input? Do you know anything about the key, or is a uniformly random 64-bit value? –  D.W. Feb 11 '13 at 16:52
Check out the DEFLATE stream format. Long story short, the first bit is going to be a $1$, and the next two bits are highly likely to be a $10$. That'll get you somewhere, at least. –  Stephen Touset Feb 11 '13 at 17:43
First check if you have known plaintext; or the possibility to inject chosen plaintext (thus giving you known plaintext); or if there are known bits in the deflated stream, either at the beginning (as suggested by Stephen Touset), or at the end (not-so-unlikely implementation bug); then, if all else fails, something known about the plaintext that can guide a cryptanalytic effort (like: it is all ASCII). –  fgrieu Feb 11 '13 at 18:12

If you have known plaintext, namely one input file that is known in its entirety, this is trivial to break. So I'll explore methods that might lead to a break, if you don't know what's in the input file that was compressed.

I suggest that you start by analyzing the DEFLATE stream format carefully (see also these handy notes). This will probably help you derive some consistent relationships that the first handful of bits of the DEFLATE stream must satisfy.

On first glance, it looks to me like the beginning of the DEFLATE stream has the following structure:

• As Stephen Tousot explains, in normal operation the first 3 bits of the DEFLATE stream are likely to be 110. (You may want to double-check this with the compression program you are using.)

• The next three fields are HLIT (5 bits), HDIST (5 bits), and HCLEN (4 bits). I suggest that you take a bunch of sample inputs that would be typical for your application, compress them with the compression implementation you're using, and look at the typical range of values for HLIT, HDIST, and HCLEN in the resulting DEFLATE stream. I suspect you may find that not all values are equally likely.

• After the aforementioned 17 bits is a chunk of 3*(HCLEN+4) bits, which is interpreted as a sequence of 3-bit values. If I understand the DEFLATE algorithm correctly (and I might not), if you permute these appropriately using a fixed permutation found in the DEFLATE specification and ignore all 000-values, then the remaining 3-bit values should be in sorted order. This provides an additional constraint on possible values for those bits.

• Then there's some more stuff that I'm ignoring right now.

For example, if HCLEN=15, then the first three items above account for the first 74 bits of the DEFLATE stream. And, if I understand correctly, above structure imposes some consistency relationships on the bits: not all possible 74-bit sequences are possible (and not all possible ones are equally likely).

Now, I think you could use the following procedure to try to recover the key $K$.

• For each candidate value of the 64-bit key $K$, xor it against the first 64 bits of ciphertext to obtain $Y = C\oplus K$, a guess at the 64 bits of the DEFLATE stream. Check to see if $Y$ is consistent with the above-mentioned constraints. If it is not consistent, continue on to the next candidate for $K$.

• If it is consistent, then do a trial decryption of the entire ciphertext using $K$ (i.e., xor a repeated version of $K$ against the ciphertext, then decompress). See if the resulting plaintext looks like a plausible input. If yes, you may have found the key $K$. If not, continue on to the next candidate.

As described, this method would take $2^{64}$ iterations of the loop. However, I suspect you might be able to speed it up if you are a bit clever about how you check keys $K$. Rather than iterating over all possible 64-bit values one-by-one, I think you can use a tree-like iterative-deepening method. The idea is, roughly, if you reject a (say) 17-bit prefix of $K$ as impossible, then there is no need to try any of the keys that start with that prefix. So, an optimized algorithm might first check all candidate values for the first 17 bits of $K$ (say) to see which ones look consistent, then for each 17-bit prefix that survives, you look to find all plausible ways to extend it by 3 bits, and so on, repeating at each step.

I don't know what the running time of this more sophisticated algorithm will be, but if you study the DEFLATE format carefully and are able to identify enough consistency checks on the first 64 bits of the DEFLATE stream, you might be able to make this attack run efficiently enough to be practical.

I realize I haven't worked out all the details for you -- I've left something for you to do on your own. But hopefully this gets you started and gives you some ideas for a direction that might lead to a practical attack.

-

This sort of encryption scheme is susceptible to a straight-forward known-plaintext attack.

Every byte of the ciphertext will have been encrypted in the format:

$$C_i = P_i \oplus K_{i\ \bmod{\ len(K)}}$$

where $i$ is the byte index within the ciphertext and plaintext. This expression is easily solved for the key:

$$K_{i\ \bmod{\ len(K)}} = C_i \oplus P_i$$

In words: You obviously know the ciphertext, so if you can also learn the plaintext at a given byte position then you simply XOR the plaintext byte with its corresponding ciphertext byte to learn the corresponding key byte. (Since the key is repeated you then need to determine which key byte index between 0 and 7 this key byte was copied from.) Once you learn all 8 bytes of the key, just concatenate it in the same way the encryption was done and use the resulting stream to decrypt the ciphertext.

But how can you find plaintext? The easiest place to start is to look at the specification of the compressed data format. Determine the exact format used and then look up what sorts of header values and data structure it uses. Some formats have certain byte positions that always have certain fixed values, or some structures with easy-to-guess contents. Don't only look for full bytes, if you can determine just some of the bits of a byte that is also useful.

If that isn't enough, you may want to consider trying to generate known plaintext and then encrypt that. For example, take some text and compress it with a different program that follows the exact same compression specification and that will produce the plaintext (or something very close to the plaintext) before encryption (aka, a chosen-plaintext attack).

If you can only break a few bytes of the key using those methods then you may be able to finish with brute-force. (3 to 4 bytes are certainly brute-forcable on a reasonable modern home computer if you have the patience.) Fix the key bytes you are sure about and iterate over the unknown key bytes. Use each potential key to decrypt captured packet data and see if the key generates valid decrypted compressed data (perhaps call a decompression function and see if it returns success or an error). (If too many test keys produce valid compressed plaintext, get a few packets of data encrypted with the same key and the key against all of them, the more data you have to test the more likely you will eliminate a wrong key.)

From the keys that generate valid compressed data, test the decompressed data to see if it's about what you're expecting, since you say that you have an idea of what the encrypted data is. Check to see if it looks like valid filenames and such, ASCII where appropriate, or whatnot. Eyeballing it would work well here if you have reasonably few keys that make it this far.

-


text:
GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 10 Dec 2018, 18:27

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

## Events & Promotions

###### Events & Promotions in December
PrevNext
SuMoTuWeThFrSa
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
Open Detailed Calendar
• ### Free lesson on number properties

December 10, 2018

December 10, 2018

10:00 PM PST

11:00 PM PST

Practice the one most important Quant section - Integer properties, and rapidly improve your skills.
• ### Free GMAT Prep Hour

December 11, 2018

December 11, 2018

09:00 PM EST

10:00 PM EST

Strategies and techniques for approaching featured GMAT topics. December 11 at 9 PM EST.

# Is q^r + 1 an odd number? (1) q + r is even (2) q is even

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics
Author Message
TAGS:

### Hide Tags

Math Expert
Joined: 02 Sep 2009
Posts: 51072
Is q^r + 1 an odd number? (1) q + r is even (2) q is even  [#permalink]

### Show Tags

03 Jul 2018, 10:08
00:00

Difficulty:

75% (hard)

Question Stats:

19% (01:07) correct 81% (01:07) wrong based on 49 sessions

### HideShow timer Statistics

Is $$q^r + 1$$ an odd number?

(1) q + r is even
(2) q is even

_________________
Math Expert
Joined: 02 Aug 2009
Posts: 7100
Is q^r + 1 an odd number? (1) q + r is even (2) q is even  [#permalink]

### Show Tags

03 Jul 2018, 10:45
Is $$q^r + 1$$ an odd number?
$$q^r+1$$ odd means $$q^r$$ is even
Easy to wrong by believing q as even would be sufficient----
NO we have to know
a) q and r are positive integers
b) q is even

(1) q + r is even
3+(-1) is even
but $$q^r+1=3^{-1}+1=\frac{1}{3}+1$$.. not odd
2+2 is even.. yes $$q^r+1$$ is odd
insuff

(2) q is even
insuff

Combined
q is2 and r is 0...2^0+1=2.... Even
wish 2 and r is -2.....2^-2+1=5/2.... fraction
q is 2 and r is 4..... 2^4+1=17...odd
Insufficient

E
_________________

1) Absolute modulus : http://gmatclub.com/forum/absolute-modulus-a-better-understanding-210849.html#p1622372
2)Combination of similar and dissimilar things : http://gmatclub.com/forum/topic215915.html
3) effects of arithmetic operations : https://gmatclub.com/forum/effects-of-arithmetic-operations-on-fractions-269413.html

GMAT online Tutor

Director
Joined: 31 Oct 2013
Posts: 844
Concentration: Accounting, Finance
GPA: 3.68
WE: Analyst (Accounting)
Re: Is q^r + 1 an odd number? (1) q + r is even (2) q is even  [#permalink]

### Show Tags

03 Jul 2018, 14:40
Bunuel wrote:
Is $$q^r + 1$$ an odd number?

(1) q + r is even
(2) q is even

we are asked to determine whether $$q^r$$ + 1 = odd or not.

Statement 1 :

q + r = even . This fact can be proved by 2 ways.

1. even + even = even . 2 +2 = 4
2. odd + odd = even . 3 + 1 = 4

If both q and r are even , we will always get odd number but the scenario is different when q and r are odd.

NOT sufficient.

Statement 2 :

This statement is a trap. anyone can say that if q is even $$q^r$$ + 1 will be odd. But we don't sufficient information about r. Thus this statement becomes fruitless. r could be anything. so, NOT sufficient .

combining both statements:

if q is even r has to be even if we consider statement 1. even or odd can't be fraction .

So, both statements together are sufficient.

Thus the best answer is C.
SVP
Joined: 26 Mar 2013
Posts: 1904
Re: Is q^r + 1 an odd number? (1) q + r is even (2) q is even  [#permalink]

### Show Tags

03 Jul 2018, 16:36
Bunuel wrote:
Is $$q^r + 1$$ an odd number?

(1) q + r is even
(2) q is even

(1) q + r is even

Let q=2 & r= 0..........$$2^0 + 1$$=2..........Answer No

Let q=2 & r= 2..........$$2^2 + 1$$=5..........Answer Yes

Insufficient

(2) q is even

Use same examples above

Insufficient

Combine 1 & 2

Use same examples.............No clear answer

Insufficient

Intern
Joined: 28 Nov 2016
Posts: 7
Re: Is q^r + 1 an odd number? (1) q + r is even (2) q is even  [#permalink]

### Show Tags

03 Jul 2018, 19:16
selim wrote:
Bunuel wrote:
Is $$q^r + 1$$ an odd number?

(1) q + r is even
(2) q is even

we are asked to determine whether $$q^r$$ + 1 = odd or not.

Statement 1 :

q + r = even . This fact can be proved by 2 ways.

1. even + even = even . 2 +2 = 4
2. odd + odd = even . 3 + 1 = 4

If both q and r are even , we will always get odd number but the scenario is different when q and r are odd.

NOT sufficient.

Statement 2 :

This statement is a trap. anyone can say that if q is even $$q^r$$ + 1 will be odd. But we don't sufficient information about r. Thus this statement becomes fruitless. r could be anything. so, NOT sufficient .

combining both statements:

if q is even r has to be even if we consider statement 1. even or odd can't be fraction .

So, both statements together are sufficient.

Thus the best answer is C.
If you take r=0 then q^r+1=even.so together also it is insufficient to ans.
Hence E is right choice.

Sent from my ONEPLUS A6000 using GMAT Club Forum mobile app
Re: Is q^r + 1 an odd number? (1) q + r is even (2) q is even &nbs [#permalink] 03 Jul 2018, 19:16
Display posts from previous: Sort by

# Is q^r + 1 an odd number? (1) q + r is even (2) q is even

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics

 Powered by phpBB © phpBB Group | Emoji artwork provided by EmojiOne Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®.


text:
Blushing & Blooming in Paint: Precautions & Repairs

Paint gives us a feeling of newness and sense of completeness in our house. It makes our surroundings more attractive, live and vibrant. However, the deterioration of the paint earlier to its rated life is considered as a failure of the paint. The failures have many reasons and there are various defects.

Also Read: Importance of Primer in Painting

Several defects like efflorescence, peeling, sagging, etc. are observed in painting, either during painting or sometimes after the painting. These defects arise due to either chemical attacks, effects of atmosphere, sunlight, heat, humidity and dust or individually or jointly deteriorating it. Among them, blushing and blooming are one of the most common defects observed.

Courtesy - Shutterstock

Blushing and Blooming are usually described as the appearance of a whitish substance on a surface of varnish or enamel. Blooming is different from blushing, up to some extent. Blushing is a defect in the paint film. It occurs during the curing process due to condensation of moisture occurring on a coating surface and visible as water spot. Whereas in blooming, top coat of a painted surface dries out and develops haziness. We have already discussed causes of blushing or blooming defect in our recent article.

Precautions to Prevent Blushing and Blooming on Painted Surface:

• Don’t paint when the paint remains in a state of cure and exposed to cold damp conditions. Follow instruction given by paint manufacturers.
• Be aware of weather conditions that may occur later in the day or during the early evening.
• Use correct paint application.
• Apply the paint under the controlled environment condition.

Tips for Fixing or Repairing Blushing and Blooming:

• The bloom and blush are easily removed with warm soapy water.
• Top coat of paint affected by moisture will require sanding and recoating.
• Remove bloom with clean cloth or suitable solvent cleaners. If necessary, apply undercoat or topcoat following manufacturer’s instructions.
• If the paint has not cured, apply heat to the surface.
• If you seen blushing after a first coat, you can add some retarder or a thinner. Using a slower drying paint thinner will allow the water molecules to evaporate before the film locks the water in.

You have therefore to apply paint very carefully after reading the manufacturer’s instructions. Understanding fully the causes of blushing and blooming will prepare you enough for starting the painting process and will make the job easier for you.

Material Exhibition

Explore the world of materials.


text:
# Numerical methods for estimating the circular area in Python

Institute for Environmental and Spatial Analysis...University of North Georgia

## 1   Circle equation

$x^2+y^2=r^2$ where $r$ is the radius.

Rewriting the above equation yields $y=\pm\sqrt{r^2-x^2}.$

## 2   Sweeping algorithm

The basic idea is to split a circle with a radius of $r$ into multiple rectangles with the same base width $dx$ by sweeping a vertical line starting from the left-most point on the circumference at $(-r, 0)$ along the $x$-axis towards the right-most point on the circumference at $(r, 0)$.

There are three ways to calculate the height of each rectangle. Take two points at the current sweeping point $x$ and the next $x+dx$ which compose the width of the current rectangle. We can calculate its height at

1. $x$ (red),
2. $x+dx$ (blue), or
3. $x+0.5\,dx$ (magenta).

We will see how these different approaches work.

## 3   Homework: A biased numerical method for estimating the circular area

Please implement the for and while versions of method 2 (rectangular height at $x+dx$). Submit FirstLastname_circ_area.zip that contains circ_area_for.py and circ_area_while.py to the D2L assignment folder.


text:
## Tohidi, Emran

Compute Distance To:
 Author ID: tohidi.emran Published as: Tohidi, Emran; Tohidi, E. External Links: ORCID
 Documents Indexed: 54 Publications since 2011 Co-Authors: 55 Co-Authors with 53 Joint Publications 1,142 Co-Co-Authors
all top 5

all top 5

### Serials

 6 Applied Mathematics and Computation 6 Computational and Applied Mathematics 5 Computers & Mathematics with Applications 5 Abstract and Applied Analysis 4 Journal of Computational and Applied Mathematics 3 Mathematical Methods in the Applied Sciences 3 Mediterranean Journal of Mathematics 2 Applied Mathematical Modelling 2 Mathematical Problems in Engineering 2 Journal of Applied Mathematics 2 Advances in Mathematical Physics 1 Journal of Computational Physics 1 Chaos, Solitons and Fractals 1 Applied Numerical Mathematics 1 IMA Journal of Mathematical Control and Information 1 Mathematical and Computer Modelling 1 Numerical Algorithms 1 Journal of the Egyptian Mathematical Society 1 Journal of Applied Mathematics and Computing 1 Advances in Difference Equations 1 Journal of Applied Mathematics and Bioinformatics 1 Journal of Computations and Modelling 1 Kuwait Journal of Science 1 Journal of Applied Mathematics, Statistics and Informatics 1 International Journal of Applied and Computational Mathematics
all top 5

### Fields

 48 Numerical analysis (65-XX) 18 Partial differential equations (35-XX) 14 Integral equations (45-XX) 10 Ordinary differential equations (34-XX) 8 Calculus of variations and optimal control; optimization (49-XX) 7 Special functions (33-XX) 7 Approximations and expansions (41-XX) 6 Harmonic analysis on Euclidean spaces (42-XX) 2 Real functions (26-XX) 2 Probability theory and stochastic processes (60-XX) 2 Operations research, mathematical programming (90-XX) 2 Game theory, economics, finance, and other social and behavioral sciences (91-XX) 1 Number theory (11-XX) 1 Linear and multilinear algebra; matrix theory (15-XX) 1 Integral transforms, operational calculus (44-XX) 1 Mechanics of deformable solids (74-XX) 1 Fluid mechanics (76-XX) 1 Classical thermodynamics, heat transfer (80-XX) 1 Astronomy and astrophysics (85-XX) 1 Biology and other natural sciences (92-XX) 1 Systems theory; control (93-XX)

### Citations contained in zbMATH Open

48 Publications have been cited 516 times in 296 Documents Cited by Year
A collocation method based on Bernoulli operational matrix for numerical solution of generalized pantograph equation. Zbl 1273.34082
Tohidi, E.; Bhrawy, A. H.; Erfani, K.
2013
A new Bernoulli matrix method for solving high-order linear and nonlinear Fredholm integro-differential equations with piecewise intervals. Zbl 1302.65274
Bhrawy, A. H.; Tohidi, E.; Soleymani, F.
2012
A new Bernoulli matrix method for solving second order linear partial differential equations with the convergence analysis. Zbl 1329.65238
Toutounian, F.; Tohidi, E.
2013
A collocation method based on the Bernoulli operational matrix for solving high-order linear complex differential equations in a rectangular domain. Zbl 1275.65041
Toutounian, Faezeh; Tohidi, Emran; Shateyi, Stanford
2013
Optimal control of nonlinear Volterra integral equations via Legendre polynomials. Zbl 1275.49056
Tohidi, E.; Samadi, O. R. N.
2013
The spectral method for solving systems of Volterra integral equations. Zbl 1295.65128
Samadi, O. R. Navid; Tohidi, Emran
2012
A collocation method based on the Bernoulli operational matrix for solving nonlinear BVPs which arise from the problems in calculus of variation. Zbl 1299.49043
2013
Convergence analysis of Bernoulli matrix approach for one-dimensional matrix hyperbolic equations of the first order. Zbl 1368.65201
Tohidi, Emran; Toutounian, Faezeh
2014
An optimized derivative-free form of the Potra-Pták method. Zbl 1255.65096
Soleymani, Fazlollah; Sharma, Rajni; Li, Xiaowu; Tohidi, Emran
2012
Fourier operational matrices of differentiation and transmission: introduction and applications. Zbl 1275.65036
Toutounian, F.; Tohidi, Emran; Kilicman, A.
2013
A Legendre-Gauss collocation method for neutral functional-differential equations with proportional delays. Zbl 1380.65116
Bhrawy, Ali H.; Assas, Laila M.; Tohidi, Emran; Alghamdi, Mohammed A.
2013
Numerical solution of nonlinear weakly singular partial integro-differential equation via operational matrices. Zbl 1411.65139
Singh, Somveer; Patel, Vijay Kumar; Singh, Vineet Kumar; Tohidi, Emran
2017
Robustness of operational matrices of differentiation for solving state-space analysis and optimal control problems. Zbl 1272.49066
Tohidi, Emran; Soleymani, F.; Kilicman, Adem
2013
A new matrix approach for solving second-order linear matrix partial differential equations. Zbl 1350.35061
2016
A new tau method for solving nonlinear Lane-Emden type equations via Bernoulli operational matrix of differentiation. Zbl 1266.65138
Tohidi, E.; Erfani, Kh.; Gachpazan, M.; Shateyi, S.
2013
Müntz-Legendre spectral collocation method for solving delay fractional optimal control problems. Zbl 1462.65161
Hosseinpour, Soleiman; Nazemi, Alireza; Tohidi, Emran
2019
An efficient Legendre pseudospectral method for solving nonlinear quasi bang-bang optimal control problems. Zbl 1277.65104
Tohidi, Emran; Noghabi, Somayyeh Lotfi
2012
A new matrix method for solving two-dimensional time-dependent diffusion equations with Dirichlet boundary conditions. Zbl 1410.65408
Zogheib, Bashar; Tohidi, Emran
2016
A parameterized multi-step Newton method for solving systems of nonlinear equations. Zbl 1350.65046
Ahmad, Fayyaz; Tohidi, Emran; Carrasco, Juan A.
2016
A Bessel collocation method for solving fractional optimal control problems. Zbl 1432.49046
Tohidi, Emran; Saberi Nik, Hassan
2015
Numerical solution of nonlinear fractional Volterra integro-differential equations via Bernoulli polynomials. Zbl 1470.65145
Tohidi, Emran; Ezadkhah, M. M.; Shateyi, S.
2014
Application of Bernoulli matrix method for solving two-dimensional hyperbolic telegraph equations with Dirichlet boundary conditions. Zbl 1409.65078
Singh, Somveer; Patel, Vijay Kumar; Singh, Vineet Kumar; Tohidi, Emran
2018
Two dimensional wavelets collocation scheme for linear and nonlinear Volterra weakly singular partial integro-differential equations. Zbl 1401.35306
Patel, Vijay Kumar; Singh, Somveer; Singh, Vineet Kumar; Tohidi, Emran
2018
Numerical solution of two-dimensional Volterra integral equations by spectral Galerkin method. Zbl 1270.65079
2011
A new approach for a class of nonlinear optimal control problems using linear combination property of intervals. Zbl 1238.49047
2011
A fourth-order least-squares based reproducing kernel method for one-dimensional elliptic interface problems. Zbl 1460.65095
Xu, Minqiang; Zhang, Lufang; Tohidi, Emran
2021
Convergence analysis of space-time Jacobi spectral collocation method for solving time-fractional Schrödinger equations. Zbl 07328855
Yang, Yin; Wang, Jindi; Zhang, Shangyou; Tohidi, Emran
2020
Taylor matrix method for solving linear two-dimensional Fredholm integral equations with piecewise intervals. Zbl 1326.65180
Tohidi, Emran
2015
Numerical solution of multi-pantograph delay boundary value problems via an efficient approach with the convergence analysis. Zbl 1438.65258
Yang, Yin; Tohidi, Emran
2019
A numerical framework for solving high-order pantograph-delay Volterra integro-differential equations. Zbl 1463.65429
Mirzaee, Farshid; Bimesl, Saeed; Tohidi, Emran
2016
An efficient pseudospectral method for solving a class of nonlinear optimal control problems. Zbl 1291.49020
Tohidi, Emran; Pasban, Atena; Kilicman, A.; Lotfi Noghabi, S.
2013
An accurate space-time pseudospectral method for solving nonlinear multi-dimensional heat transfer problems. Zbl 1362.65116
Zogheib, Bashar; Tohidi, Emran
2017
A new approach for solving a class of delay fractional partial differential equations. Zbl 1407.65214
Hosseinpour, Soleiman; Nazemi, Alireza; Tohidi, Emran
2018
An efficient spectral approximation for solving several types of parabolic PDEs with nonlocal boundary conditions. Zbl 1407.65228
Tohidi, E.; Kılıçman, A.
2014
Rigorous convergence analysis of Jacobi spectral Galerkin methods for Volterra integral equations with noncompact kernels. Zbl 1436.45008
Yang, Yin; Tohidi, Emran; Ma, Xiaohua; Kang, Sujuan
2020
Higher order multi-step Jarratt-like method for solving systems of nonlinear equations: application to PDEs and ODEs. Zbl 1443.65070
Ahmad, Fayyaz; Tohidi, Emran; Ullah, Malik Zaka; Carrasco, Juan A.
2015
Legendre spectral method for the fractional Bratu problem. Zbl 1451.65162
Singh, Harendra; Ghassabzadeh, Fahimeh Akhavan; Tohidi, Emran; Cattani, Carlo
2020
Bernoulli collocation method for solving linear multidimensional diffusion and wave equations with Dirichlet boundary conditions. Zbl 1404.65206
Zogheib, Bashar; Tohidi, Emran; Shateyi, Stanford
2017
Modal Hermite spectral collocation method for solving multi-dimensional hyperbolic telegraph equations. Zbl 1419.65086
Zogheib, Bashar; Tohidi, Emran
2018
LSMR iterative method for solving one- and two-dimensional linear Fredholm integral equations. Zbl 1438.65042
Asgari, Z.; Toutounian, F.; Babolian, E.; Tohidi, E.
2019
Convergence analysis of Legendre pseudospectral scheme for solving nonlinear systems of Volterra integral equations. Zbl 1303.65112
Tohidi, Emran; Samadi, O. R. Navid; Shateyi, S.
2014
An extended block Golub-Kahan algorithm for large algebraic and differential matrix Riccati equations. Zbl 1439.65052
Asgari, Z.; Toutounian, F.; Babolian, E.; Tohidi, E.
2020
A new least-squares-based reproducing kernel method for solving regular and weakly singular Volterra-Fredholm integral equations with smooth and nonsmooth solutions. Zbl 07394281
Xu, Minqiang; Niu, Jing; Tohidi, Emran; Hou, Jinjiao; Jiang, Danhua
2021
A computational method to price with transaction costs under the nonlinear Black-Scholes model. Zbl 1448.91322
Al-Zhour, Zeyad; Barfeie, Mahdiar; Soleymani, Fazlollah; Tohidi, Emran
2019
Numerical solution of time-dependent diffusion equations with nonlocal boundary conditions via a fast matrix approach. Zbl 1332.65150
Tohidi, Emran; Toutounian, Faezeh
2016
A fourth order product integration rule by using the generalized Euler-Maclaurin summation formula. Zbl 1387.41017
Rządkowski, Grzegorz; Tohidi, Emran
2018
A radial basis function – Hermite finite difference approach to tackle cash-or-nothing and asset-or-nothing options. Zbl 1437.91458
Yang, Yin; Soleymani, Fazlollah; Barfeie, Mahdiar; Tohidi, Emran
2020
High accurate pseudo-spectral Galerkin scheme for pantograph type Volterra integro-differential equations with singular kernels. Zbl 07422801
Deng, Guoting; Yang, Yin; Tohidi, Emran
2021
A fourth-order least-squares based reproducing kernel method for one-dimensional elliptic interface problems. Zbl 1460.65095
Xu, Minqiang; Zhang, Lufang; Tohidi, Emran
2021
A new least-squares-based reproducing kernel method for solving regular and weakly singular Volterra-Fredholm integral equations with smooth and nonsmooth solutions. Zbl 07394281
Xu, Minqiang; Niu, Jing; Tohidi, Emran; Hou, Jinjiao; Jiang, Danhua
2021
High accurate pseudo-spectral Galerkin scheme for pantograph type Volterra integro-differential equations with singular kernels. Zbl 07422801
Deng, Guoting; Yang, Yin; Tohidi, Emran
2021
Convergence analysis of space-time Jacobi spectral collocation method for solving time-fractional Schrödinger equations. Zbl 07328855
Yang, Yin; Wang, Jindi; Zhang, Shangyou; Tohidi, Emran
2020
Rigorous convergence analysis of Jacobi spectral Galerkin methods for Volterra integral equations with noncompact kernels. Zbl 1436.45008
Yang, Yin; Tohidi, Emran; Ma, Xiaohua; Kang, Sujuan
2020
Legendre spectral method for the fractional Bratu problem. Zbl 1451.65162
Singh, Harendra; Ghassabzadeh, Fahimeh Akhavan; Tohidi, Emran; Cattani, Carlo
2020
An extended block Golub-Kahan algorithm for large algebraic and differential matrix Riccati equations. Zbl 1439.65052
Asgari, Z.; Toutounian, F.; Babolian, E.; Tohidi, E.
2020
A radial basis function – Hermite finite difference approach to tackle cash-or-nothing and asset-or-nothing options. Zbl 1437.91458
Yang, Yin; Soleymani, Fazlollah; Barfeie, Mahdiar; Tohidi, Emran
2020
Müntz-Legendre spectral collocation method for solving delay fractional optimal control problems. Zbl 1462.65161
Hosseinpour, Soleiman; Nazemi, Alireza; Tohidi, Emran
2019
Numerical solution of multi-pantograph delay boundary value problems via an efficient approach with the convergence analysis. Zbl 1438.65258
Yang, Yin; Tohidi, Emran
2019
LSMR iterative method for solving one- and two-dimensional linear Fredholm integral equations. Zbl 1438.65042
Asgari, Z.; Toutounian, F.; Babolian, E.; Tohidi, E.
2019
A computational method to price with transaction costs under the nonlinear Black-Scholes model. Zbl 1448.91322
Al-Zhour, Zeyad; Barfeie, Mahdiar; Soleymani, Fazlollah; Tohidi, Emran
2019
Application of Bernoulli matrix method for solving two-dimensional hyperbolic telegraph equations with Dirichlet boundary conditions. Zbl 1409.65078
Singh, Somveer; Patel, Vijay Kumar; Singh, Vineet Kumar; Tohidi, Emran
2018
Two dimensional wavelets collocation scheme for linear and nonlinear Volterra weakly singular partial integro-differential equations. Zbl 1401.35306
Patel, Vijay Kumar; Singh, Somveer; Singh, Vineet Kumar; Tohidi, Emran
2018
A new approach for solving a class of delay fractional partial differential equations. Zbl 1407.65214
Hosseinpour, Soleiman; Nazemi, Alireza; Tohidi, Emran
2018
Modal Hermite spectral collocation method for solving multi-dimensional hyperbolic telegraph equations. Zbl 1419.65086
Zogheib, Bashar; Tohidi, Emran
2018
A fourth order product integration rule by using the generalized Euler-Maclaurin summation formula. Zbl 1387.41017
Rządkowski, Grzegorz; Tohidi, Emran
2018
Numerical solution of nonlinear weakly singular partial integro-differential equation via operational matrices. Zbl 1411.65139
Singh, Somveer; Patel, Vijay Kumar; Singh, Vineet Kumar; Tohidi, Emran
2017
An accurate space-time pseudospectral method for solving nonlinear multi-dimensional heat transfer problems. Zbl 1362.65116
Zogheib, Bashar; Tohidi, Emran
2017
Bernoulli collocation method for solving linear multidimensional diffusion and wave equations with Dirichlet boundary conditions. Zbl 1404.65206
Zogheib, Bashar; Tohidi, Emran; Shateyi, Stanford
2017
A new matrix approach for solving second-order linear matrix partial differential equations. Zbl 1350.35061
2016
A new matrix method for solving two-dimensional time-dependent diffusion equations with Dirichlet boundary conditions. Zbl 1410.65408
Zogheib, Bashar; Tohidi, Emran
2016
A parameterized multi-step Newton method for solving systems of nonlinear equations. Zbl 1350.65046
Ahmad, Fayyaz; Tohidi, Emran; Carrasco, Juan A.
2016
A numerical framework for solving high-order pantograph-delay Volterra integro-differential equations. Zbl 1463.65429
Mirzaee, Farshid; Bimesl, Saeed; Tohidi, Emran
2016
Numerical solution of time-dependent diffusion equations with nonlocal boundary conditions via a fast matrix approach. Zbl 1332.65150
Tohidi, Emran; Toutounian, Faezeh
2016
A Bessel collocation method for solving fractional optimal control problems. Zbl 1432.49046
Tohidi, Emran; Saberi Nik, Hassan
2015
Taylor matrix method for solving linear two-dimensional Fredholm integral equations with piecewise intervals. Zbl 1326.65180
Tohidi, Emran
2015
Higher order multi-step Jarratt-like method for solving systems of nonlinear equations: application to PDEs and ODEs. Zbl 1443.65070
Ahmad, Fayyaz; Tohidi, Emran; Ullah, Malik Zaka; Carrasco, Juan A.
2015
Convergence analysis of Bernoulli matrix approach for one-dimensional matrix hyperbolic equations of the first order. Zbl 1368.65201
Tohidi, Emran; Toutounian, Faezeh
2014
Numerical solution of nonlinear fractional Volterra integro-differential equations via Bernoulli polynomials. Zbl 1470.65145
Tohidi, Emran; Ezadkhah, M. M.; Shateyi, S.
2014
An efficient spectral approximation for solving several types of parabolic PDEs with nonlocal boundary conditions. Zbl 1407.65228
Tohidi, E.; Kılıçman, A.
2014
Convergence analysis of Legendre pseudospectral scheme for solving nonlinear systems of Volterra integral equations. Zbl 1303.65112
Tohidi, Emran; Samadi, O. R. Navid; Shateyi, S.
2014
A collocation method based on Bernoulli operational matrix for numerical solution of generalized pantograph equation. Zbl 1273.34082
Tohidi, E.; Bhrawy, A. H.; Erfani, K.
2013
A new Bernoulli matrix method for solving second order linear partial differential equations with the convergence analysis. Zbl 1329.65238
Toutounian, F.; Tohidi, E.
2013
A collocation method based on the Bernoulli operational matrix for solving high-order linear complex differential equations in a rectangular domain. Zbl 1275.65041
Toutounian, Faezeh; Tohidi, Emran; Shateyi, Stanford
2013
Optimal control of nonlinear Volterra integral equations via Legendre polynomials. Zbl 1275.49056
Tohidi, E.; Samadi, O. R. N.
2013
A collocation method based on the Bernoulli operational matrix for solving nonlinear BVPs which arise from the problems in calculus of variation. Zbl 1299.49043
2013
Fourier operational matrices of differentiation and transmission: introduction and applications. Zbl 1275.65036
Toutounian, F.; Tohidi, Emran; Kilicman, A.
2013
A Legendre-Gauss collocation method for neutral functional-differential equations with proportional delays. Zbl 1380.65116
Bhrawy, Ali H.; Assas, Laila M.; Tohidi, Emran; Alghamdi, Mohammed A.
2013
Robustness of operational matrices of differentiation for solving state-space analysis and optimal control problems. Zbl 1272.49066
Tohidi, Emran; Soleymani, F.; Kilicman, Adem
2013
A new tau method for solving nonlinear Lane-Emden type equations via Bernoulli operational matrix of differentiation. Zbl 1266.65138
Tohidi, E.; Erfani, Kh.; Gachpazan, M.; Shateyi, S.
2013
An efficient pseudospectral method for solving a class of nonlinear optimal control problems. Zbl 1291.49020
Tohidi, Emran; Pasban, Atena; Kilicman, A.; Lotfi Noghabi, S.
2013
A new Bernoulli matrix method for solving high-order linear and nonlinear Fredholm integro-differential equations with piecewise intervals. Zbl 1302.65274
Bhrawy, A. H.; Tohidi, E.; Soleymani, F.
2012
The spectral method for solving systems of Volterra integral equations. Zbl 1295.65128
Samadi, O. R. Navid; Tohidi, Emran
2012
An optimized derivative-free form of the Potra-Pták method. Zbl 1255.65096
Soleymani, Fazlollah; Sharma, Rajni; Li, Xiaowu; Tohidi, Emran
2012
An efficient Legendre pseudospectral method for solving nonlinear quasi bang-bang optimal control problems. Zbl 1277.65104
Tohidi, Emran; Noghabi, Somayyeh Lotfi
2012
Numerical solution of two-dimensional Volterra integral equations by spectral Galerkin method. Zbl 1270.65079
2011
A new approach for a class of nonlinear optimal control problems using linear combination property of intervals. Zbl 1238.49047
2011
all top 5

### Cited by 467 Authors

 24 Applied Mathematics and Computation 21 Abstract and Applied Analysis 19 Journal of Computational and Applied Mathematics 17 Computational and Applied Mathematics 15 Applied Numerical Mathematics 10 International Journal of Applied and Computational Mathematics 9 Advances in Difference Equations 8 Computers & Mathematics with Applications 8 Mathematics and Computers in Simulation 7 International Journal of Computer Mathematics 7 Advances in Mathematical Physics 6 Chaos, Solitons and Fractals 6 Computational Methods for Differential Equations 5 Numerical Algorithms 5 Applied Mathematical Modelling 5 Mathematical Problems in Engineering 5 Mathematical Sciences 4 Applied Mathematics Letters 4 Journal of the Egyptian Mathematical Society 4 Journal of Applied Mathematics 4 Journal of Applied Mathematics and Computing 4 Mediterranean Journal of Mathematics 4 Algorithms 4 S$$\vec{\text{e}}$$MA Journal 4 Journal of Mathematics 3 Journal of Mathematical Chemistry 3 Mathematical Modelling and Analysis 3 Boletim da Sociedade Paranaense de Matemática. Terceira Série 3 Journal of Function Spaces 2 Mathematical Methods in the Applied Sciences 2 Journal of Optimization Theory and Applications 2 Bulletin of the Iranian Mathematical Society 2 Turkish Journal of Mathematics 2 Fractals 2 Journal of Vibration and Control 2 Hacettepe Journal of Mathematics and Statistics 2 International Journal of Differential Equations 2 Advances in Applied Mathematics and Mechanics 2 Iranian Journal of Numerical Analysis and Optimization 2 International Journal of Systems Science. Principles and Applications of Systems and Integration 1 International Journal of Control 1 Indian Journal of Pure & Applied Mathematics 1 Acta Mathematica Vietnamica 1 Automatica 1 Information Sciences 1 International Journal of Mathematics and Mathematical Sciences 1 Journal of Functional Analysis 1 Acta Mathematicae Applicatae Sinica. English Series 1 Optimization 1 Journal of Scientific Computing 1 Computational Mathematics and Mathematical Physics 1 Indagationes Mathematicae. New Series 1 Filomat 1 Advances in Computational Mathematics 1 Integral Transforms and Special Functions 1 Complexity 1 Engineering Analysis with Boundary Elements 1 Journal of Difference Equations and Applications 1 Journal of Applied Analysis 1 Mathematical Communications 1 Nonlinear Dynamics 1 Soft Computing 1 Journal of Inequalities and Applications 1 Discrete Dynamics in Nature and Society 1 International Journal of Nonlinear Sciences and Numerical Simulation 1 Nonlinear Analysis. Modelling and Control 1 Kragujevac Journal of Mathematics 1 Proceedings of the National Academy of Sciences, India. Section A. Physical Sciences 1 Iranian Journal of Science and Technology. Transaction A: Science 1 Thai Journal of Mathematics 1 International Journal of Computational Methods 1 Boundary Value Problems 1 Proyecciones 1 Annali dell’Università di Ferrara. Sezione VII. Scienze Matematiche 1 Mathematics in Computer Science 1 Asian-European Journal of Mathematics 1 International Journal of Biomathematics 1 Journal of Nonlinear Science and Applications 1 Revista de la Real Academia de Ciencias Exactas, Físicas y Naturales. Serie A: Matemáticas. RACSAM 1 Journal of Mathematics and Computer Science. JMCS 1 ISRN Mathematical Analysis 1 Afrika Matematika 1 Iranian Journal of Mathematical Sciences and Informatics 1 Arabian Journal of Mathematics 1 Journal of Applied Mathematics, Statistics and Informatics 1 Journal of Linear and Topological Algebra 1 Journal of Mathematical Modeling 1 Transactions of A. Razmadze Mathematical Institute 1 AIMS Mathematics 1 Electronic Research Archive


text:
# When does $2hxy + 2gx + 2fy + c =0$, with $h\neq 0$, represent a pair of straight lines?

For the standard conic equation in 2-D plane i.e $$ax^2 + 2hxy + by^2 +2gx +2fy +c =0$$ If $$a=b=0$$ and $$h\neq 0$$, then the equation reduces to $$2hxy + 2gx + 2fy + c =0$$

Under what conditions will the above equation represent a pair of straight lines?

when $$c = \frac{2fg}{h}$$

Try a few examples

....................

• @Sameernilkhan you did not finish your sentence. Also, instead of telling me what you were thinking, try a few examples. – Will Jagy Nov 23 '19 at 23:44
• I was thinking about conditions like C1) f=0 and c=0 then the equation becomes 2hxy + 2gx = 0 this implies x(hy + g) = 0 i.e. 2 real pair of straight lines. C2) g=0 and c=0 then the equation becomes 2hxy + 2fy = 0 this implies y(hx + f) = 0 i.e. 2 real pair of straight lines. C3) g=0, f=0 and c=0 then the equation becomes 2hxy=0 this implies x=0 and y=0 i.e. 2 real pair of straight lines. Are any more conditions possible? – Sameer nilkhan Nov 23 '19 at 23:59
• I will surely try some examples if you explain the logic behind your condition i. e. c=fg/h. – Sameer nilkhan Nov 24 '19 at 0:02
• I checked the example 6xy + 4x + 12y + 4 = 0. It represents a hyperbola. – Sameer nilkhan Nov 24 '19 at 0:17
• @Sameernilkhan good, I mistakenly left off a factor of $2.$ Let's see, your $h=3$ $g=2$ $f=6$ so $\frac{2fg}{h}= \frac{24}{3} = 8$ – Will Jagy Nov 24 '19 at 0:31

The equation $$2hxy + 2gx + 2fy + c =0$$ is expected to be factorized as

$$(px+q)(ty+s)=0$$

in order for it to present two lines. Match the coefficients to get,

$$pt = 2h, \>\>\> qt = 2g,\>\>\> sp=2f, \>\>\> qs = c$$

Then,

$$\frac pq =\frac hg = \frac {2f}c$$

Thus, the condition is $$hc = 2fg$$.

• Thanks i got it. – Sameer nilkhan Nov 24 '19 at 1:13