text:
# Constrained optimization in R

My data is categorized by two different parameters (say F having n groups and S having m groups) and I want to get a relationship between the two. For example $F =${$f_1 , f_2 , f_3$} = {$10,10,5$} and $S =${$s_1, s_2 , s_3, s_4$} = {$8,8,8,4$}. (Read $f_1$ has 10 elements in it, $s_1$ has 8 elements in it.)

The problem is to get a relationship like $f_1 = p_{11}.s_1 + p_{12}.s_2 + p_{13}.s_3$ for all groups in F. The exact relationship is not possible (due to constraint 1 below), so we have to find the most approximate solution. The constraints are:

1. Sum of all the numbers in F (10+10+5) < sum of all the numbers in S (8+8+8+4). Note that, this is a default property of data and we don't have to apply this.

2. Total contribution of any $s_i$ can not be more than 100%. That is if $s_1$ contribute 40% in all 3 equations its total contribution will be 120% which should not happen.

3. Contribution can not be negative.

I framed this as an optimization problem as

Given:

$F = (f_1, f_2, ... f_n)$

$S = (s_1, s_2, ... s_m)$

Each $f_i$ can be represented as: $f_i = p_{i1} s_1 + p_{i2}s_2 + ... + p_{im}s_m + \epsilon_i$

That is: $P =${$p_{ij}$} is a $n * m$ matrix of row vectors $P_1, P_2, ..., P_n$ then $f_i = P_i.S+ \epsilon_i$

where . is the dot product (element by element multiplication).

I have to minimize $\sum_{i} \epsilon_i^2$, with following constraints:

1. $p_{11} + p_{12}+ ... + p_{1m}<=1$ That is some of each row of matrix P is less than 1.

2. $p_{ij} >=0$ for all i,j

I am trying to use constrOptim in R to solve this problem, however I am getting stuck with following:

1. Framing the constraints

2. How to create a code in which I just pass F and S and it gives me the matrix P and error vector as output.

Below is my code:

F = c(10,10,5)
S = c(8,8,8,4)
n = length(F)
m = length(S)
P_init = matrix(rep(0,m*n),nrow=n, ncol=m)

loss_fun <- function(P){

T = S*P #proportion matrix * S
F2 = rowSums(T) # Predicted values of F
E = F - F2  # Error
return(sum(E*E))
}
x = loss_fun(P_init)
z = constrOptim(P_init,loss_fun,NULL,ui=c(rep(-1,n)), ci=rep(-1,m))

Since the constraints are defined by: ui %*% theta - ci >= 0, I believe in my case ui = {-1,-1,-1}, theta = P_init ( a 3 x 4 matrix) and ci = {-1,-1,-1,-1}. However I get the following if I run the code. Error in ui %\*% theta : non-conformable arguments. Is theta = P_init is not true? Or there is some other error. As this is just one approach, I can also explore other approaches like optim or any other function.

I'm not sure if I'm right but help constrOptim {stats} say theta: numeric (vector) starting value (of length p): must be in the feasible region, and your theta is a matrix.

I think here is near to your idea (Input is a vector and the function makes it a matrix).
[EDITED] NOT NEAR because of difference constraints. Please refer to OP's ANSWER.

F = c(10,10,5)
S = c(8,8,8,4)
n = length(F)
m = length(S)
P_init2 = rep(0, 12)

loss_fun2 <- function(a){
P <- matrix(a, nrow=n, ncol=m)
T = S*P
F2 = rowSums(T)
E = F - F2
return(sum(E*E))
}

x = loss_fun2(rep(0, 12))
x  # 225
z = constrOptim(P_init2, loss_fun2, NULL, ui = rep(-1, n * m), ci = -1)

• Thanks for the answer, it clears the mistake I was doing, but it does not constraints the variables as I wanted. First constraint: $p_{i1} + p_{i2} + p_{i3} + p_{i4} < 0$ and 2nd: $p_{ij}>0$. z$par [1] 0.3908330 0.7895228 0.4255702 -0.6770411 0.8194554 0.7260158 [7] 1.8119389 -3.9910594 -0.3568335 -0.6142514 1.6365515 -0.3395050. Certainly it violates the 2nd constraint. In this example, it does not violate first constraint as rowSums(matrix(z$par, nrow = 3, byrow=T)) gives [1] 0.929 -0.634 0.326, so all rowSums are < 1, but I can't figure out if it will be true always – Gaurav Singhal Jun 15 '16 at 16:02
• @GauravSinghal How on earth is the sum of the $pi$s negative but each is positive? – AdamO Jun 15 '16 at 16:07
• @AdamO, sorry my bad, this was a typo in the comment, it should be $p_{i1}+p_{i2}+p_{i3}+p_{i4}<1$ as in the question. Thanks for pointing it out. – Gaurav Singhal Jun 15 '16 at 17:21
• @crayfish44, I used your advice to define P inside the function using P_init2, and to put constraints I used help from here stackoverflow.com/questions/16345271/…. Finally I was able to put the constraints as I wanted. – Gaurav Singhal Jun 15 '16 at 19:40
• @GauravSinghal I'm glad I could be of help. – cuttlefish44 Jun 15 '16 at 23:51

Using answer given by @crayfish and a detailed answer on how to put construct constraints here, I was able to come up with a solution.

#define F and S here
F = c(10,10,5)
S = c(8,8,9,8,4)

#loss_fun: to be minimized
loss_fun <- function(A){
P = matrix(A, nrow = n,ncol = m, byrow=T)
T = S*P #proportion matrix * S
F2 = rowSums(T) # Predicted values of F
E = F - F2  # Error
return(sum(E*E))
}

n = length(F)
m = length(S)
#Initial solution (theta)
P_init = c(rep(0.1,n*m))

# Creating Constraints

vi = matrix(rep(0,n*m*n*(m+1)),ncol = n*m, byrow = T)
for (i in 1:n){
for (j in 1:(n*m)) {
if (j <= m *  i & j > m * (i-1)) vi[i,j] = -1
}
}
for (i in (n+1):(n*m+n)) {
for (j in 1:(n*m)) {

if ((i-n) == j)  vi[i,j] = 1
}
}

myci = c(rep(-1,n),rep(0,n*m))

# check if initial value is in feasible region
vi %*% P_init - myci

#run the optimization module
z = constrOptim(P_init,loss_fun,NULL,ui=vi, ci=myci)

#result
P_final = matrix(z\$par,nrow=n,byrow=T)

Since creation of constraints may not be very easy to understand from the code, here is a visualization of constraints when n = 3 and m = 4

-1. p11 + -1. p12 + -1. p13 + -1. p14                                                                               >= -1
-1. p21 + -1. p22 + -1. p23 + -1. p24                                         >= -1
-1. p31 + -1. p32 + -1. p33 + -1. p34     >= -1
p11                                                                                >= 0
p12                                                                                >= 0
p13                                                                                >= 0
p14                                                                               >= 0
p21                                                                       >= 0
p22                                                              >= 0
p23                                                   >= 0
p24                                          >= 0
p31                                   >= 0
p32                         >= 0
p33               >= 0
p34     >= 0


text:
# Introduction to principles of macroeconomics/Measuring unemployment

Measuring unemployment
Unemployment rate calculation

First, in the United States, economists derive the data of unemployment from the various state workforce commissions. Once unemployed, citizens report to a state’s workforce commission (typically there are several locations within a state); these citizens become a statistic in the unemployment database. Second, the types of unemployment that the Bureau of Labor Statistics collects to determine the unemployment rate is comprised of people who are frictionally unemployed (citizens between jobs) as well as people who are structurally unemployed (citizens whose jobs have become obsolete). This data collectively goes into the unemployment rate formula.

In regards to the formula used to determine the unemployment rate, as well as the amount of money an economy loses because of unemployment, the following is the process that economists use in its calculations. The labor force is the combined total of all unemployed people who are actively seeking employment and all the people who are actually working. The coefficient of this calculation gives us the unemployment rate times 100. The unemployment rate formula is the following:

Unemployment (UE) rate = UE / Labor Force (LF) x 100

The index for unemployment is 4.5%, which indicates a healthy unemployment rate. If the unemployment calculations are less than 4.5%, this is great for an economy! However, if the data exceeds 4.5%, then we begin to experience a high rate of unemployment. High unemployment rates are often correlated with recessions. When an economy has a high rate of unemployment, it loses money or its GDP shrinks. This loss is measured by the difference of the natural unemployment rate, which is also referred to as full employment at 4.5%. When economists subtract the natural rate of unemployment from the actual rate of unemployment, for example, 9%, this is an indication that there is a negative GDP gap of -4.5%. Additionally, there is a constant 2% that is multiplied times the -4.5%. This measurement indicates a .09% negative GDP gap. The .09% data is a measurement of the number of people who are unemployed and is referred to as a negative percentage in the GDP gap. After this .095 is determined (measurement of the GDP gap), this data is computed, 09% times the $14 billion of a given country. Please note the following example. Let us say that the potential GDP of a given country is$14 billion; therefore, $14 billion times .09% will equal$1.26 billion. What this means is that this country’s economy due to unemployment in the GPD gap has lost \$1.26 billion due to unemployment. One might think that unemployment to an economy is as horrific as inflation.

• Read Chapter 8: Unemployment from OpenStax College's: "Macroeconomics" text book, which provides analyses and insights into the composition of the labor force and connections to the nature and duration of unemployment periods.

While reading, consider the following questions:

1. What challenges are there to measuring unemployment?
2. Do you think the current models of measurement capture a complete picture?
3. Do you think the alternative metrics solve the problems of the mainstream measurement systems?

format: plain


text:
# The mass of gas adsorbed, x, per unit mass of adsorbate, m, was measured at various pressures, p. A graph between

more_vert

The mass of gas adsorbed, x, per unit mass of adsorbate, m, was measured at various pressures, p. A graph between $\log{x\over m}$ and $\log p$ gives a straight line with slope equal to 2 and the intercept equal to 0.4771. The value of $x\over m$ at a pressure of 4 atm is :

(Given log 3 = 0.4771)

Numerical Value Type

more_vert

more_vert

done_all

Ans. (48) [NTA answer is given 6]

Sol. $\left(x\over m\right)=k(P)^{1\over n}$

$\log\left(x\over m\right)=\log k+{1\over n}\log P$

Slop $={1\over n}=2$

So $n={1\over2}$

Intercept $\implies\log k=0.477$ So $k=$ Antilog $(0.477)=3$

So $\left(x\over m\right)=k(P)^{1\over n}$

$=3[4]^2=48$


text:
# Variable Gain Stages

This chapter deals with amplifier stages that are required to have a variable gain, usually over a wide range of +20 dB, +30 dB, or more. It does not include volume controls, which typically only have a maximum gain of +10 dB or so and have their own chapter (Chapter 13). Nor does it include balanced microphone preamplifiers, which can have a variable gain range of 80 dB or more, and also have their own chapter (Chapter 17).

These amplifier stages are very common in audio electronics. A typical application would be a guitar amplifier input that has to cover a range of playing styles and pickup sensitivities. Another major use is in compact mixers that have only one control performing the functions of both input gain control and channel fader.

The examples given in this chapter have a maximum gain of +30 dB. In some places, it is assumed that ideally the gain law would be linear in dB. This not always the case; if the gain control will spend almost all its working life at mid settings, making the gain change faster at high and low settings will allow the middle gain range to be more spread out, giving easier adjustment.

Pot rotation is described here as the Mark on a scale calibrated 0–10, so Mark 5 is the middle setting and Mark 10 the maximum. No provisions are made for turning anything up to 11 (Spinal Tap reference).

## Amplifier Stages With Gain From Unity Upwards: Single-Gain Pot

In many cases a minimum gain of unity (0 dB) is quite acceptable, and this simplifies matters considerably. A series-feedback amplifier configuration can be used, which inherently has a minimum gain of unity, and can also provide a high or very high input impedance. In contrast, a shunt-feedback amplifier can have gain adjustable down to zero but will have a relatively low input impedance, which may vary with the gain setting. This can be addressed by putting a unity-gain buffer in front of the gain control, but its noise is being added at the most sensitive part of the circuit, and this is usually not a very good idea.

If we require gain from unity upwards, this is best achieved by varying the amount of negative feedback. The simplest way to control the feedback factor is to make one of the resistors in the feedback network variable. Figure 8.1a shows how not to do it; this works OK at high gains, but at low gains, the resistance of RV1 is low and, in conjunction with R2, puts an excessive load on the opamp output. If the opamp is happy with a 1 kΩ load, then R2 could be increased to 1 kΩ, with the value of RV1 increased proportionally. That will solve the loading problem but gives a relatively high-impedance feedback network that will be noisy.

The method shown in Figure 8.1b is often a better choice. The variable resistor is now in the bottom arm of the feedback network. This means that the opamp output can never see a load less than R3 + R2. The downside is that at low gain settings, the impedance seen by the inverting input is relatively high; at high gain settings, it reduces to the value of R2. Thus the equivalent input noise is lower at high gains, keeping the noise output low.

If a linear pot is used for RV1, the gain law is a long way from linear in dB, as shown in Figure 8.2. When the control is turned clockwise, virtually nothing happens for the first 80% of rotation, and 20 of the 30 dB gain range is constricted into the last 10% of rotation. The obvious answer is to use an anti-log pot, where the resistance changes more rapidly at the start of rotation. This is demonstrated in Figure 8.2, where the gain laws are compared with the dotted ideal linear-in-dB line; the pot laws are anti-log C and ant-log D as used by Alps. Both are a considerable improvement on linear, making the control usable, but the D-law is clearly the better of the two. However, even the D-law is some 6 dB away from the ideal line for most of the pot rotation.

It appears as if the C-law may be implemented with two resistance slopes on the track and the D-law with three, though this is speculative. Be aware that it is usually necessary to read the law of a pot from a rather small graph on the data sheet, so the accuracy is limited.

The gain does not go down as far as unity (0 dB), because this would require the maximum value of RV1 to be infinite. That is a limitation of this configuration, though in many cases a minimum gain of 1 or 2 dB would not be a big problem.

Both circuits in Figure 8.1 have the disadvantage that the gain depends on the track resistance of the pot, which is unlikely to have a tolerance closer than ±20%. This makes stereo gain control tricky –channel balance will be poor, especially if dual or triple slopes are used.

A better gain control law can be obtained from a linear pot if it is arranged so that the entire track is always in the feedback network, with the wiper position deciding how much of it is in the upper feedback arm and how much in the lower. This is illustrated in Figure 8.3; the a-version uses the pot alone, while the b-version has pot-loading resistor R3 added to give some control over the law shape.

The resulting gain laws for linear, C-law, and D-law pots are shown in Figure 8.4. Because both halves of the pot are controlling the gain, a linear pot gives a better law than when it is used only as a variable resistance. To a first approximation, variations in track resistance will cancel out and not affect the gain. Also, now the gain can be reduced to exactly unity.

As Figure 8.4 shows, the linear law gain increases by 12 dB in going from 9 to 10, whereas in Figure 8.2 it increases by 21 dB. The new law is more usable, but still a long way from the dashed linear-in-dB line. Using a C-law pot gives a much closer fit to the ideal line, the resulting gain law being only 2 or 3 dB away over most of the pot travel. Using a D-law pot now gives worse results, further away from and above the ideal line.

It may be that only linear pots are available. In this case, the circuit of Figure 8.3b will be useful.

The loading resistor R3 has no effect on the minimum or maximum gain but increases the gain in the centre portion of pot travel. This is demonstrated in Figure 8.5.

When the pot wiper is at the top of the track (i.e. minimum gain), R3 is connected from the opamp output to ground through R2 and so directly loads the opamp. This puts a minimum value on it if good opamp distortion performance is to be preserved. The lowest recommended value with a 5532 opamp is 620 Ω, but improve the gain law over R3 =1 kΩ, as shown in Figure 8.5. With 620 Ω, there is a good linear-in-dB law from 0 dB to +20 dB, but the last 10 dB of gain comes in too fast. In applications where this amount of gain is rarely needed, this may be acceptable. The only way to prevent improve it is to use C- or D-law pots, as demonstrated in Figure 8.4.

## Amplifier Stages With Gain From Unity Upwards: Dual-Gain Pot

If only linear pots are available, a better approach to a linear-in-dB law can be obtained by using a dual pot, with the sections cascaded, as in Figure 8.6a. This gives a modified square-law gain characteristic (modified because of the loading effect of the second pot section on the first pot section), which fits very well with our 0–30 dB ideal line, especially when loading resistor R3 is added as in Figure 8.6b.

Figure 8.7 shows that the gain law for the circuit of Figure 8.6a is close to the dashed ideal line, being within 2 dB of it. Adding a 4k7 loading resistor R3 increases the gain slightly in the middle of the pot travel and puts the gain law nicely on top of the ideal line. This is more than good enough for the normal use of audio equipment.

You might think that because there are two 5 kΩ pots, it would be necessary to halve the value of R2 to get the same +30 dB maximum gain; this is not so. At maximum gain, the first half of the pot is short circuited by the wiper position of the second half of the pot and plays no part in setting the gain.

## Combining Gain Stages With Active Filters

Combining one stage with another so that less total parts are needed to perform two functions is certainly good practice economically but rarely done unless really necessary, because it is usually difficult to design a stage so that the two functions do not interact or interfere with each other. An application in which a special effort to do it is worthwhile is the stereo input module of a mixing console, which has to fit approximately twice the amount of circuitry into the same space. The facilities available often have to be simplified somewhat, if only to avoid unwelcome quadruple pots. Here I demonstrate combining a variable-gain stage with an active filter.

Figure 8.8 shows a second-order high-pass filter with -3 dB cutoff at 50 Hz and a Q of 0.707 (Butterworth maximally flat) combined with a variable gain from unity to 10 times (0 to +20 dB). This is the sort of gain range that might be found on a mixing console line input, and the high-pass filter is used to reduce mic proximity effect and environmental rumblings. The Sallen and Key filter is conventional except that both R2 and the inverting input of A1 are driven from the wiper of pot RV1; this means the filter characteristic does not change with the gain. The cutoff frequency is nominally 50 Hz, but actually nearer 48 Hz as a result of using E24 resistors; this is of no consequence. The -3 dB point is of course with reference to the passband gain, whatever it might be set to be. The maximum gain is actually +20.8 dBu, which is as close as you can get with E24 resistors and E3 pot values; customers might complain about slightly too little gain range, but they won’t complain about a little more than spec.

Filters like this need to be switched out when not required; since the stage also gives gain, it cannot simply be by-passed by a changeover switch. Instead, SW1 performs this function very neatly, removing the filter action without affecting the gain control. Note that it is not necessary to switch both capacitors out separately; only one switch section is required, which is very desirable, as it means a 2 c/o switch can be used rather than a more expensive 4-c/o part.

There will be a small offset voltage at the top of R1 due to the opamp bias current. It is assumed that there is a DC blocking capacitor at the output of the previous stage so no current will flow through SW1 and there will be no clicks when it is operated.

Other combined stages described in this book are a combined balanced line input and balance control (see Chapter 18) and a tone control combined with a balance control (Chapter 15).

## Amplifier Stages With Gain From Zero Upwards: Single-Gain Pot

Sometimes a minimum gain of unity is unacceptable; it has to go down to zero. Such input stages are commonly used in compact mixers with only one control per channel performing the functions of both an input gain control and a channel fader. Therefore, not only must the stage have a reasonably wide gain range, but that gain must go down to zero.

This means that an ideal gain law cannot simply be linear in dB, because at one end it has to go down to -infinity dB. What we can do is have a linear-in-0dB law down to a certain point, say the 20% point (Mark 2) and then make the gain fall rapidly to zero from there; see Figure 8.9.

The ideal line used here passes through 0 dB at Mark 2, and +30 dB at Mark 10. Its equation is:

$y\text{\hspace{0.17em}}=\text{\hspace{0.17em}}3.75x\text{\hspace{0.17em}}-\text{\hspace{0.17em}}7.5$ (Equation 8.1)

The required functionality can be obtained with a single-gang pot, as shown in Figure 8.9; the wiper is grounded, so the left-hand part of the pot track controls the gain, while the right-hand part controls the attenuation introduced after the gain stage. As the control is turned counter-clockwise, the resistance in series with R2 increases, while at the same time, the loading on R4 is increased, increasing the attenuation.

The result for both C- and D-law pots is shown in Figure 8.10, along with an ideal line that hits 0 dB gain at Mark 2 of rotation. The C-law result is closer to the ideal line around the middle of pot travel, but the D version is not much worse. Both laws give a rapid gain increase between Mark 8 and Mark 9, but this may be no disadvantage if, as is likely in most cases, the upper gain extremes are less commonly used.

Note that the output is in general not at a low impedance; the maximum output impedance (at maximum gain) is 33 kΩ in parallel with 5 kΩ, which equals 4.34 kΩ. If the next stage requires a low-impedance drive (such as an EQ stage), then you will have to add a unity-gain buffer.

Ideally, as the control is turned counter-clockwise, the gain should reduce smoothly to unity, after which the attenuation starts from unity and increases until the output is zero. This is not feasible with an ordinary pot, though something could perhaps be contrived using special balance pots that have half the track made of low-resistance material (see Chapter 14). With the circuit here, there is always a combination of gain and attenuation; they overlap. This reduces the headroom because it breaks the rule about not amplifying then attenuating. I have always called this the overlap penalty; it has nothing to do with football.

Assume that we have our gain control set halfway, i.e. at Mark 5. In this case, the gain is +17.4 dB and the attenuation afterwards is -6.7 dB, giving an overall gain of +10.7 dB. But … the amplifier will clip, assuming +22 dBu (10 Vrms) is its maximum output, when the input level is only +4.6 dBu. If there was no overlap penalty, then the maximum input would be 22–10.7 = + 11.3 dBu, which is 6.7 dB greater than +4.6 dBu. This demonstrates that the amount of headroom lost is the amount of attenuation.

Figure 8.11 shows the attenuation given by Figure 8.8 for C- and D-law pots; the minimum loss of headroom is 1.6 dB, but it rapidly gets worse as the pot is turned counter-clockwise. The D-law gives more attenuation in the middle part of the pot travel and so the headroom loss is more severe. If we consider Mark 3, the headroom loss is 12 dB with the C-law and 17.5 dB for the D-law. Thus if either gain plot in Figure 8.10 is acceptable, you should go for the C-law, as it will give you 5.5 dB more headroom at this gain setting.

Apart from headroom issues, there is another disadvantage if this circuit is used in a stereo format. Log or anti-log pots have poor matching compared with linear ones due to the extra tolerances involved in making two- or three-slope resistive pot tracks. Gain matching between two stereo channels is not likely to be good.

The offness with the pot fully counter-clockwise will not be very good compared with a simple pot, because in pots, the resistance between track and wiper is greater than the end resistance where the track is connected to the terminals, and at Mark 0, all of the current from R4 flows through it to ground. With ordinary parts, -65 dB should be achievable.

## Amplifier Stages With Gain From Zero Upwards: Dual-Gain Pot

The loss of headroom and problems of stereo matching mentioned earlier caused me to look for a better way. There is no obvious way of doing anything else with a single pot, but if we allow ourselves a dual pot, there are interesting possibilities, one of which is shown in Figure 8.12. A dual linear pot is used to reduce the stereo matching problems. The first half of the pot controls the feedback to the amplifier, varying the upper and lower feedback arms together, as in Figure 8.3. This gives a better control law than just varying one arm, but the gain is still too low in the middle, coming up fast at the end; see the “Lin” trace in Figure 8.4. This is compensated for by the attenuation law implemented by the second half of the pot, which has a powerful pull-up resistor R4, which reduces the attenuation at mid-travel and so reduces the headroom loss. It looks very much like half of a panpot (see Chapter 22). Be aware that R4 is connected almost directly from the amplifier output to ground at low gains, and the loading effect on the amplifier must be considered. If you are using 5532s, then a 5 kΩ pot and a 1 kΩ pullup resistor are about as low as you want to go if a good distortion performance is to be preserved. This is demonstrated in Figure 8.13, where the upper trace is the gain and the lower trace the attenuation. The trace in the middle is the combination of the two.

The attenuation is much less over most of the control range due to the effect of R4. Without R4, the attenuation would be –6 dB at Mark 5; with it, the attenuation is only –2.5 dB. Compare 2.5 dB of headroom loss with 6.7 dB loss for the one-pot circuit of Figure 8.8. Comparing Figure 8.10 with Figure 8.12, the headroom loss is much reduced over all but the lowest gain settings.

However … comparing Figure 8.9 with Figure 8.13, we can see that the combined gain law of the latter is much less of a linear-in-dB straight line, rising quite steeply from +12 dB at Mark 8 to +30 dB at Mark 10. We have said earlier that faster action at the control extremes is not necessarily a disadvantage, but this is too much. There is not much we can do with the attenuation stage, as it already has a pullup resistor R4, so we had better focus on the gain law.

This can be modified to pull the gain up in mid-travel by adding a pulldown resistor R3, as shown in Figure 8.14. This gives us the gain law in Figure 8.15, with the overall gain at mid-travel (Mark 5) increased from +3 dB to +11 dB. This gives a rather nicer overall gain law, though still with a rather quick rise at the high gain end, going from +17 dB at Mark 8 to +30 dB at Mark 10. This is about as far as we can go with this approach, as R3 is connected almost directly from the amplifier output to ground at low gains; at the same time, R4 is putting its worst loading on the amplifier. What helps us here is that when the loading is at its worst, the gain is zero, and no distortion will get through to the output.

Once again, how close the output can get to zero is limited by the wiper-to-track resistance of the attenuator pot, and something like -65 dB is likely.

The stereo balance of two of these circuits will be much improved over that obtained with log and anti-log pots, but it will not be perfect. This is because while the fixed resistors can be chosen as 1% parts, the tolerance of linear pot tracks is rarely better than 20%. The only way to deal with this, assuming more accurate pots are not an option, is to use a configuration like the Baxandall volume control, in which the effect of pot track tolerances is completely cancelled out; see Chapter 13. Unfortunately, the Baxandall control is a shunt-feedback configuration and does not offer a high input impedance. It’s great for a volume control, having been used by me for gains up to +26 dB, but not so good as an input stage.

## Switched-Gain Amplifiers

In Chapter 9, we see that the appropriate gain (at 1 kHz) for an MM input with pretensions to quality is between +30 and +40 dB, giving maximum inputs at 1 kHz of 316 and 100 mVrms, respectively. Lower gains give an inconveniently low output signal and a greater headroom loss at HF due to the need for a lower HF correction pole frequency. Higher gains give too low a maximum input.

The nominal output for 5 mVrms input (1 kHz) from a +30 dB stage is 158 mVrms and from a +40 dB stage is 500 mVrms. Bearing in mind that the line signals between pieces of equipment are, in these digital days, usually in the range 1–2 Vrms, it is obvious that both 158 mVrms and 500 mVrms are too low. If we put a fixed gain stage after the MM input stage, it will overload first, and the maximum inputs just quoted are no longer valid. It is therefore desirable to make such a stage switchable in gain to cope with differing conditions of cartridge sensitivity and recorded level. One of the gain options must be unity (0 dB) if the maximum MM inputs are to be preserved; having less than unity gain is pointless, as the MM stage will clip first. It would of course be possible to have continuously variable gain controlled by a pot, but this brings in difficult issues of stereo level matching; these are described in Chapter 13 on volume controls. It is not in my opinion necessary to have finer control of the post-MM-input gain than 5 dB steps.

If we are dealing with just MM inputs, then not many gain options are required. If we assume a +30 dB (1 kHz) MM stage with its nominal 158 mVrms output, then we need 6.3 times or +16 dB of gain to raise that level to 1 Vrms. This suggests that gain options of 0 dB, +5 dB, +10 dB, and +15 dB are all that are needed, with the lower gains allowing for more sensitive cartridges and elevated recording levels.

However, it will be seen in Chapter 10 that MC cartridges have a much wider spread of sensitivities than the MM variety, and if the MM input stage followed by the flat switched-gain stage is going to be used to perform the RIAA equalisation after a flat +30 dB MC head amp, a further +20 dB gain option in the switched-gain stage is required to ensure that even the most insensitive MC cartridges can produce a full 1 Vrms nominal output.

The stage in Figure 8.16 is derived from my Elektor 2012 preamp [1] and gives the gain options specified. The AC negative feedback is tapped from the divider R51–R60, which is made up of pairs of resistors to achieve the exact gain required and to reduce the effect of the resistor tolerances. The DC feedback for the opamp is always through R50 to prevent the opamp hitting the rails when switching the gain; the blocking capacitor C50 is more than large enough to prevent any frequency response irregularities in the audio band. Assuming the source impedance is reasonably low, an LM4562 will give better noise and distortion results than a 5532 section.

The correct setting for the gain switch can be worked out by considering cartridge sensitivity specs and recording levels, but the latter are usually unknown, so some form of level indicator is very useful when setting up. A bar-graph meter seems a bit over the top for a facility that will not be used very often, and a single LED indication makes more sense. For this reason, the Log Law Level LED was developed, giving about as much level information as can be had from one LED. It is fully described in Chapter 23 on metering. It is desirable that any level indication can be switched off, as not everyone thinks that flashing lights add to the musical experience.

## Reference

[1] Self, Douglas “Preamplifier 2012” Elektor, Apr/May/Jun 2012


text:
# Tag Info

7

The \unexpanded primitive is essentially an anonymous toks, which means no expansion _within an \edef or similar, whereas \noexpand explicitly changes the behaviour of the next token to be equal to \relax for one expansion. This is perhaps easier to see if we choose to typeset the results of the two: \documentclass{article} \begin{document} \newcommand{\...

6

Detach the first conditional. \documentclass{article} \newcount\zNonZero \def\zLoop#1{% \zNonZero=1 \zLoopStart{#1}% \zLoopLoop{#1}% } \def\zLoopStart#1{% \ifnum#1<1 % HOW TO CHECK THIS ONLY ONCE? \zNonZero=0 \fi } \def\zLoopLoop#1{% \ifnum#1<5 #1...(\the\zNonZero)\par \zNonZero=1 \expandafter\zLoopLoop\expandafter{\the\...

5

The code became a tad long. Much longer than I initially thought it would be. Your conditions aren't too clear, I think. What I implemented (in crappy pseudocode) is: procedure cur_char // (a, b, c, or d) if next_char is lowercase_vowel print replacement (cur_char) // replaces ABCD by PQRS else if next_char is uppercase_X ...

4

\ifx compares two tokens without expansion, so if you pass [ ] to \bpdef, the \ifx test will compare [ with a space and fail. You need to define a temporary macro and compare it with \bptoks. Alternatively you can use \pdfstrcmp (or the equivalent in other engines (\pdf@strcmp if you load pdftexcmds)) to make a string comparison: \documentclass{article} \...

3

\documentclass{article} \begin{document} \begingroup \catcodeL=\active \catcodeM=\active \catcode`N=\active \makeatletter \def L{\@ifnextchar p{q\@gobble}{}} \def M{\@ifnextchar p{r\@gobble}{}} \def N{\@ifnextchar p{s\@gobble}{}} \makeatother Lp Lq Lr Mp Mq Mr Np Nq Nr \endgroup Lp Lq Lr Mp Mq Mr Np Nq Nr \end{document}

3

You have several spaces inserted by newlines... \newcommand{\vs}[2]{% \relax\ifmmode \ifemptyarg{#2}% {#1\text{-vector space}}% {#1\text{-vector space }#2}% \else \ifemptyarg{#2}% {$#1$-vector space}% {$#1$-vector space $#2$}% \fi} works. Notice that the "%" after the \ifemptyarg{#2} is not ...

3

You can hook into the definition of the wide option and make your conditional true. The value of the conditional is reset after the environment. Note also that the wide option takes an argument. If you pass none, then \parindent is used (i.e., \begin{itemize}[wide] is the same as \begin{itemize}[wide=\parindent]). However you should not try to change ...

2

Here is a way you could use list styles, contained in macro settings. \documentclass{article} \usepackage{enumitem,lipsum} \newenvironment{styledlist}[1][] {\expandafter\itemize\expandafter[#1]}{\enditemize} \def\widelist{wide,itemindent=15pt,label=*,leftmargin=-1cm,rightmargin=-1cm} \def\narrowlist{itemindent=15pt,label=++,leftmargin=1cm,rightmargin=1cm} ...

2

The posted code does set the path conditionally, the test file below shows both settings: LaTeX2e <2018-12-01> (/usr/local/texlive/2019/texmf-dist/tex/latex/base/ifthen.sty) > \input@path=macro: ->{"../folder-1/"}. l.13 \show\input@path ? > \input@path=macro: ->{"../folder-2/"}. l.26 \show\input@path ? ) No pages of output. \...

2

As I don't have the right fonts available on my system, this is kind of a shot in the dark. The idea is to have nested \ifx checks, like the following structure: \ifx\tmp X \else \ifx\tmp Y \else \fi \fi Because you are using \@gobble to remove the following token from the input stream, you have to be a bit more careful, because TeX leaves parts of ...

2

The command \solutions just switches the conditional \if@solutions, but cannot change already executed code. And \excludecomment{solution} has been performed. The class should do \excludecomment{solution} \newcommand{\solutions}{\renewenvironment{solution}{\textbf{L\"osung:}\\}{}}

2

As too long for a comment: The problem probably is that \ifthenelse is not fully expandable. What might work is to execute the test, storing the new option in a macro, and then adding the option in an \edef: \def\myopt{} \ifthenelse{\boolean{myDraft}}{\def\myopt{3Dmenu}}{} \edef\temp{\unexpanded{ \includemedia[ width=1\linewidth, height=0.56\...

2

If I correctly understood your needs, the following should do what you want: \documentclass{article} \usepackage{datatool} \usepackage[strict]{changepage} \usepackage{filecontents} \usepackage{tcolorbox} \usepackage[absolute,overlay]{textpos} \usepackage{xcolor} \usepackage{xparse} \begin{filecontents*}{test1.csv} Acol, Bcol,Ccol Ax,Bx,1 Ay,By,3 A1,B22,1 ...

2

\documentclass{article} \begin{document} \parindent0pt \newcount\zNonZero \newif\ifCheck \Checktrue \def\zLoop#1{% \zNonZero1 \ifCheck\ifnum#1<1 \zNonZero0 \fi\Checkfalse\fi \ifnum#1<5 #1...(\the\zNonZero)\newline \expandafter\zLoop\expandafter{\the\numexpr#1+1\relax} \fi \...

1

(This is part 2 of my answer which consists of two parts. Here is a link to part 1 of my answer.) By now the tokens that are to be delivered in the different cases were "hardwired" in the macro-definition. But you can combine such delimited-argument-based forking-mechanisms with mechanisms for grabbing the k-th element of a list of undelimited arguments ...

1

(This is part 1 of my answer which consists of two parts. Here is a link to part 2 of my answer.) You can implement such testing by means of delimited arguments also. With tests based only on delimited arguments, no \if-switches are applied, thus such tests cannot be fooled by unbalanced \else or \fi or \endcsname and the like. With tests based only on ...

1

@siracusa suggested the right way of formatting my code and now I've this, which is fully ready. \documentclass{article} \usepackage{fontspec} \setmainfont{Sanskrit 2003} %Any Devanagari font. \newfontfamily{\doulo}{Doulos SIL} \setlength{\parindent}{0cm} \makeatletter \def\ifischar#1{% \ifx\tmp#1% \expandafter\@firstoftwo \else \...

1

Using \futurelet you can crank out the cases of the following token being { or } or a space-token. If the following token is none of these tokens, you can have LaTeX process it as macro-argument. Macro-arguments in turn can be examined in various ways. One way of interpreting your vague specifications is: \documentclass{article} \makeatletter \newcommand\...

1

You can use something like this: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \tl_new:N \g_makkototo_printbibliography_opts_tl \cs_new_protected:Npn \makkototo_printbibliography:n #1 { % Call the original \printbibliography command \__makkototo_printbibliography_orig [#1] } \cs_generate_variant:Nn \makkototo_printbibliography:n {...

1

I'd like to present another solution that is able to parse integer and floating point numbers. Usage of the main macro is \ifnumber[<optional setup>]{<tokens>}{<true part>}{<false part>} where <tokens> is the string to be tested whether it represents a number. <optional setup> is an optional list of definitions to modify ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
# Make a differentiable smooth sawtooth waveform

So, I am trying to understand the effect of sawtooth waveform on a mechanical system model. For example, a system of a plate and a box on it. And then we try to oscillate the plate.

In order to do that, I need to calculate the inertial force caused by the sawtooth waveform. And to find the inertial force, I need to calculate second derivative of sawtooth waveform. But because, you know, sawtooth waveform is not differentiable everywhere, I think make an approximation by using a smooth sawtooth waveform is enough. 'Smooth' here, I mean substitute upper tip and bottom tip of the sawtooth waveform into a circular curve of a certain radius.

So in short, my question is: How to make sawtooth wavefrom with a dull tip with Mathematica? Here, although I said sawtooth, it would be better if applicable to any triangle waveform.

EDIT:

What if my triangle waveform is made from a completely arbitrary piecewise function such as below

f = Piecewise[{{10 Mod[x, 1], 0 <= Mod[x, 1] < 0.1},
{-(10/9) Mod[x, 1] + (10/9), 0.1 <= Mod[x, 1] < 1}}];
Plot[Evaluate[f], {x, -3, 3}]

Is it still possible?

-
there is a formula for a fourier series approximation here..demonstrations.wolfram.com/… –  george2079 Dec 5 '13 at 13:49
@george2079 Unfortunately there are Gibbs oscillations. It is very bad especially for derivatives. You need to introduce a smooth cut-off of the Fourier series with one of the window function. It is more difficult task then the Gaussian smoothing. –  ybeltukov Dec 5 '13 at 14:11
Of course.. I answered the title question w/o thinking about what he wanted to do with it. –  george2079 Dec 5 '13 at 16:16

There are nice trigonometric formulas

δ = 0.01;

trg[x_] := 1 - 2 ArcCos[(1 - δ) Sin[2 π x]]/π;
sqr[x_] := 2 ArcTan[Sin[2 π x]/δ]/π;
swt[x_] := (1 + trg[(2 x - 1)/4] sqr[x/2])/2;

Plot[{TriangleWave[x], trg[x]}, {x, -2, 2}, PlotRange -> All]
Plot[{SquareWave[x], sqr[x]}, {x, -2, 2}, PlotRange -> All, Exclusions -> None]
Plot[{SawtoothWave[x], swt[x]}, {x, -2, 2}, PlotRange -> All, Exclusions -> None]

You can use Gaussian smoothing and interpolation:

n = 1000;
δ = 0.02;

f = Interpolation[Prepend[#, {0.0, #[[-1, 2]]}], PeriodicInterpolation -> True] &@
Transpose@{#, GaussianFilter[SawtoothWave[#], δ n {5, 1},
Padding -> "Periodic"]} &@Range[1/n, 1.0, 1/n];

Plot[{SawtoothWave[x], f[x]}, {x, -1.2, 1.2}]

Here n is the number of interpolation points and δ is the standard deviation of the smoothing.

The second derivative:

Plot[f''[x], {x, -0.1, 0.1}]

-
congratulations on your 10k! :) –  rm -rf Dec 11 '13 at 18:14
@rm-rf Thanks! I learned a lot of interesting things when I was earning this reputation :) –  ybeltukov Dec 11 '13 at 18:34

One approach is to convolve the sawtooth wave directly with a Gaussian kernel. Since this can be done analytically, it is possible to return a function that is in closed form and hence can be differentiated without interpolation.

f = Integrate[SawtoothWave[t/10] Exp[-3 (t - x)^2] , {t, 0, 50}]
Plot[f, {x, 0, 50}]

You can control the amount of "rounding" at the top and bottom by the width of the Exp function. Defining the derivative:

df[x_] := D[f, x];

gives a closed form (though it is not exactly "simple"). The second derivative D[df[x], x] is also possible analytically. The method also works fine with TriangleWave instead of SawtoothWave.

-
It is exactly my fist idea! But I tried to integrate from -∞ to ∞ with no luck. –  ybeltukov Dec 5 '13 at 23:14
@ybeltukov -- I think this is why the built-in Convolve function doesn't work. But really, the problem doesn't require the full integral, only a portion is needed. –  bill s Dec 5 '13 at 23:26

The Fourier series of the sawtooth is differentiable, being made up of sines. However, as ybeltukov pointed out in a comment I did not read until he made me aware of it, Fourier series of piecewise continuously differentiable functions tend to overshoot a jump discontinuities, something which is called Gibbs phenomenon. For that reason a Fourier series may not work very well for derivatives.

Plot[(2/Pi) Sum[(-1)^k Sin[2 Pi  k t]/k, {k, 10000}], {t, 0, 3}]

Be sure to read ybeltukov's comments below! I'm lifting the content into the answer since its so useful it deserves to be more visible. He suggests this solution:

(2/Pi) N@ Sum[(-1)^k Sin[2 Pi k t]/k BlackmanNuttallWindow[k/2/200], {k, 200}]

He plotted the second derivative and got this good looking graph:

-
Gibbs oscillations not die out as the frequency increases. See my comment under OP's question. The second derivative always has heavy oscillating tails. I think it is not good from the physical point of view. –  ybeltukov Dec 6 '13 at 0:24
@ybeltukov I did not see that comment, thank you. I had never heard of Gibbs phenomenon before, however I observed it when I plotted the function for a smaller range of k, but I thought it died out with higher ones. I will update the post accordingly. –  Pickett Dec 6 '13 at 0:31
Try something like (2/Pi) N@ Sum[(-1)^k Sin[2 Pi k t]/k BlackmanNuttallWindow[k/2/200], {k, 200}]. It produces nice shape of the second derivative. –  ybeltukov Dec 6 '13 at 0:37
Gibbs phenomenon only occurs at jump discontinuities. The Sawtooth wave is a continuous function, so there will be no Gibbs phenomenon for the function, but it will be present in the derivate (which has jump discontinuities). –  Aditya Dec 6 '13 at 5:33
@Aditya why do you claim the sawtooth wave is continuous function? –  Kuba Dec 6 '13 at 7:25


text:
Prove that `power2` is strict. While one can base the proof on the "obvious" fact that `power2 n` is $2^n$, the latter is preferably proven using fixed point iteration.
```power2 0 = 1
First, we need to consider whether `⊥ - 1` is `⊥` or not. Using similar reasoning to the `⊥ + 1` case, we can determine that `⊥ - 1` is indeed `⊥`. From there, we know that `power2 ⊥` is `2 * power2 ⊥`. Since this recurses indefinitely, it is equivalent to `⊥`.


text:
# Thread: Some problems with series

1. Originally Posted by Hweengee
How do I determine the convergence/divergence of the following:

$\displaystyle \sum _{n=1}^{\infty }\left({\sqrt[n] 3}-1 \right)$

I can't use limit comparison test with $\displaystyle {\sqrt[n] 3}$ because it gives me 0. Root and ratio tests don't seem appropriate and I'm struggling to find a divergent series which is smaller than this to compare it with. Would it be possible to compare it with $\displaystyle \sum _{n=1}^{\infty }\left(\ln\left(n \right)-1 \right)$?

As for

$\displaystyle \sum _{n=3}^{\infty }\frac{1}{\left( lnln\left(n \right) \right)^{\ln \left( n \right) }}$

I'm more or less completely stuck.

Thanks for the help in advance.
I see that your second series was never actually solved. Well I would suggest Cauchy's Condensation test. Since the sequence in the series is positive and decreasing it only converges iff $\displaystyle \sum_{n=3}^{\infty}\frac{2^n}{\ln(\ln(2^n))^{\ln(2 ^n)}}=\sum_{n=3}^{\infty}\frac{2^n}{\ln(\ln(2)n)^{ \ln(2)n}}\sim\sum_{n=3}^{\infty}\frac{2^n}{\ln(n)^ n}$. Now it is pretty clear this converges.

2. would you please explain furthur that why it converge. as a glance i see that it is divergant.

3. sorry with te RATIO TEST i found it convergant

4. Originally Posted by Mathstud28
I see that your second series was never actually solved. Well I would suggest Cauchy's Condensation test. Since the sequence in the series is positive and decreasing it only converges iff $\displaystyle \sum_{n=3}^{\infty}\frac{2^n}{\ln(\ln(2^n))^{\ln(2 ^n)}}=\sum_{n=3}^{\infty}\frac{2^n}{\ln(\ln(2)n)^{ \ln(2)n}}\sim\sum_{n=3}^{\infty}\frac{2^n}{\ln(n)^ n}$. Now it is pretty clear this converges.
It is possible to compare with a simple series: we have $\displaystyle (\ln\ln n)^{\ln n}=e^{\ln n\ln\ln\ln n}=n^{\ln\ln\ln n}\geq n^2$ as soon as $\displaystyle n\geq e^{e^{e^2}}\simeq 5.8\cdot 10^{702}$ (!!), hence $\displaystyle \frac{1}{(\ln\ln n)^{\ln n}}\leq \frac{1}{n^2}$ for these pretty large $\displaystyle n$. Hence it converges.

Page 2 of 2 First 12


text:
# Thread: simplify

1. ## simplify

absolute value of 13r^2 can be?

2. Originally Posted by rj2001
absolute value of 13r^2 can be?
|13r^2|=13|r^2|=13r^2

13r^2 is always nonnegative (that is greater than or equal to zero. it is zero if r = 0, and greater otherwise), so you can drop the absolute value signs completely


text:
C. Enlarge GCD
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Mr. F has $n$ positive integers, $a_1, a_2, \ldots, a_n$.

He thinks the greatest common divisor of these integers is too small. So he wants to enlarge it by removing some of the integers.

But this problem is too simple for him, so he does not want to do it by himself. If you help him, he will give you some scores in reward.

Your task is to calculate the minimum number of integers you need to remove so that the greatest common divisor of the remaining integers is bigger than that of all integers.

Input

The first line contains an integer $n$ ($2 \leq n \leq 3 \cdot 10^5$) — the number of integers Mr. F has.

The second line contains $n$ integers, $a_1, a_2, \ldots, a_n$ ($1 \leq a_i \leq 1.5 \cdot 10^7$).

Output

Print an integer — the minimum number of integers you need to remove so that the greatest common divisor of the remaining integers is bigger than that of all integers.

You should not remove all of the integers.

If there is no solution, print «-1» (without quotes).

Examples
Input
31 2 4
Output
1
Input
46 9 15 30
Output
2
Input
31 1 1
Output
-1
Note

In the first example, the greatest common divisor is $1$ in the beginning. You can remove $1$ so that the greatest common divisor is enlarged to $2$. The answer is $1$.

In the second example, the greatest common divisor is $3$ in the beginning. You can remove $6$ and $9$ so that the greatest common divisor is enlarged to $15$. There is no solution which removes only one integer. So the answer is $2$.

In the third example, there is no solution to enlarge the greatest common divisor. So the answer is $-1$.


text:
# A particular ILP where the existence of a relaxed solution implies the existence of an integer solution

This question emerged from a discussion on my previous question Determining quickly whether this Integer Linear Program has any solution at all, which I would like to elaborate separately.

I am trying to determine whether a solution exists for \begin{aligned} A\mathbf{x} &\geq \mathbf{b} &\text{where}\quad \mathbf{x} &\in \mathbb{Z}^m,\ \mathbf{x}\geq\mathbf{0},\ \\ && \mathbf{b} &\in \mathbb{R}^n,\ \mathbf{b}\geq\mathbf{0},\ \\ && A&\in \mathbb{R}^{n\times m}\ . \end{aligned} I postulate that in this particular case, if a solution exists for the relaxed constraint $\mathbf{x} \in \mathbb{R}^m,\ \mathbf{x}\geq\mathbf{0}$, an integer solution always exists as well.

The proof would go somewhat like this: $A\mathbf{x}$ spans a pointed convex cone $C_a$ from the origin. The criterion $\mathbf{y} \geq \mathbf{b}$ implies a cone $C_b$ originating at $\mathbf{b}$, with the particular trait that if the two cones intersect, every ray in $C_a$ which intersects $C_b$ will intersect exactly one side of $C_b$, i.e. it will enter $C_b$ but never leave it. This should, in turn, imply that there must exist an $\mathbf{x} \in \mathbb{Z}^m,\ \mathbf{x}\geq\mathbf{0}$ so that $A\mathbf{x} \geq \mathbf{b}$.

Obviously that is not a proof, and anything but formal. But maybe someone could enlighten me on how such a formal proof could be constructed – or maybe, in case I'm altogether wrong, provide a counterexample? Thanks in advance!

-
Counter example: $\sqrt{3}x-\sqrt{2}y=0$ (can write it as two $\geq$ inequalities). –  polkjh Jan 30 '13 at 17:59
I think what we have here is (at least) two cases. If ${\bf b} = {\bf 0}$, then we can find counterexamples like polkjh's. If ${\bf b} > {\bf 0}$ then dexter04's argument works. That still leaves the situation where some of the entries in ${\bf b}$ are positive and some are $0$. –  Mike Spivey Jan 30 '13 at 18:06
This counter example has the trivial (and only) solution $x=y=0$. Am I overlooking something? –  mindriot Jan 31 '13 at 0:48
@mindriot: The equation $\sqrt{3}x - \sqrt{2}y = 0$ defines a line. So there are an infinite number of solutions, all of which other than $x = y = 0$ are non-integer. So I suppose it's not actually a counterexample, since it does include the integer solution $x = 0, y = 0$. –  Mike Spivey Jan 31 '13 at 0:56
@MikeSpivey: yes, correct – I meant to say it's the only integer solution, thanks for clarifying. But like you said, it's not a counterexample. –  mindriot Jan 31 '13 at 1:02

Suppose you have a feasible solution in the reals, $\mathbf{x}_0\in \mathbb{R}^m$ such that $\mathbf{Ax}_0 = \mathbf{c \ge b}$, where by $\ge$, I mean every element of $\mathbf{c}$ is $\ge$ its corresponding element in $\mathbf{b}$.

Now, note that for every positive real $k>1$, $\mathbf{A}(k\mathbf{x}_0) = k\mathbf{c} \ge \mathbf{b}$.

Suppose you round up a real solution $\mathbf{x}$to an integer one $\mathbf{x_i}$. So, $\mathbf{x_i = x + \epsilon, \quad x_i \in } \mathbb{Z}^m$.

Also, $0\le \epsilon_i < 1, i = 1,2,\ldots m$

Now, $\mathbf{Ax_i = Ax + A\epsilon}$.

Let $\mathbf{e = A\epsilon}$. Then, $e_i = \sum_{j=1}^{n}a_{ij}\epsilon_j$. So, $e_i \ge -\sum_{j=1}^{n}|a_{ij}|$ with equality occuring in case all entries of $\mathbf{A}$ are negative.

Let $$\delta = \min_i{e_i} \le 0$$ Then, $$\mathbf{e\ge}\delta \mathbf{1}$$

So, $\mathbf{Ax_i = Ax +e \ge Ax }+ \delta \mathbf{1}$

Now, note that $\delta$ is a property of $\mathbf{A}$, and is fixed. So, by choosing a large enough $k$, setting $\mathbf{x} = k\mathbf{x_0}$ and rounding $\mathbf{x}$ to its next highest integer, a feasible integer solution s.t. $\mathbf{Ax_i\ge b}$ can be always obtained.

-
+1. You need the additional restriction that c is strictly greater than ${\bf 0}$, though (which of course is forced if ${\bf b} > {\bf 0}$). Otherwise, you aren't guaranteed to get $A (k {\bf x}_0)$ large enough to compensate for $\delta {\bf 1}$ in all entries. –  Mike Spivey Jan 30 '13 at 17:54
Looks great to me at a quick glance, I'll have to go over it more carefully (rusty math on my part and all). Thanks so far! –  mindriot Jan 31 '13 at 0:55
I agree with @MikeSpivey. The question of individual $c_i=0$ is still open, but apart from that the proof works. I think the clue is that to compensate for $\delta$ in an entry where $c_i=0$, you would have to somehow choose $k$ so that the "critical" entries in $k{\bf x_0}$ are already integer. I'm not sure if that's even possible though... –  mindriot Jan 31 '13 at 11:04


text:
# Non-linear comparisons

#### SergeantMike

##### New Member
I have insect emergence data that comes from 6 different varieties of plants and the curve very much fits a Gompertz curve formula. I want to statistically compare the 6 to see if there is significant difference of the timing of the emergence between the cultivars. When I run an ANOVA on arcsine transformed data I get significance but that is using a linear model only and I am wondering if there was a test that allowed me to compare the emergences using the Gompertz model. Note the R2's for the Gompertz model ranges from 0.97 to 0.99 which is intriguing where the transformed data doesn't have that same R2's

#### katxt

##### Well-Known Member
What are you using to fit the Gompertz model? Can you post a typical full output from one fit.

#### SergeantMike

##### New Member
katxt,
Thanks for the response
I used R with the non-linear analysis package eznls. Here is the output:

Jerseymodel=nlsfit(Jersey_Round_1,model=10,start=c(a = 4000 , b = 1, c = 0.34))
> Jerseymodel
$Model [1] "y~a*exp(-b*exp(-c*x)"$Parameters
Count per_total
coefficient a 4.945101e+03 1.00448931
coefficient b 1.590095e+01 15.90094853
coefficient c 9.917900e-01 0.99179001
p-value t.test for a 0.000000e+00 0.00000000
p-value t.test for b 5.276940e-03 0.00527694
p-value t.test for c 3.390000e-06 0.00000339
r-squared 9.942000e-01 0.99420000
AIC 1.468117e+02 -40.22515597
BIC 1.484032e+02 -38.63357487

and the plot:

The actual data plot

I hope this is what you are looking for.

#### katxt

##### Well-Known Member
Thanks Mike. R is being as terse as ever. I was hoping for some standard errors and degrees of freedom. They must have been calculated to get the p values. Perhaps they just need to be asked for. Looking at the plots, I imagine that you had 6 data points with three parameters giving 3 df for the errors. See if you can find the SE's for the parameters.
How do you get the emergence time from a, b and c? kat

Last edited:

#### SergeantMike

##### New Member
Actually I had 12 datapoints. See the attached Excel file.

Geeze, you're forcing me back into my notes pretty far.

the formula is

t=ln(ln(y/a)/-b)/-c
where y/a is the proportion of the emergence you are looking for, so if you are looking for the time when 1/2 of the emergence has occurred then y/a=0.5.

I do not see any degrees of freedom or standard errors that I can dig out of the response.

#### Attachments

• 8.1 KB Views: 1

#### katxt

##### Well-Known Member
t=ln(ln(y/a)/-b)/-c
where y/a is the proportion of the emergence you are looking for, so if you are looking for the time when 1/2 of the emergence has occurred then y/a=0.5.
You can't really compare the t's unless you know how accurate your estimates of a, b and c are in each case. That is what the SE tells us. I'll think about things and get back later. kat

#### SergeantMike

##### New Member
There seems to be several options for the Gomphertz Curve. I am going to dig into those and see what I can find out about SE

#### katxt

##### Well-Known Member
I have been looking at your data and back engineering how R is doing it. It is ordinary least squares with some sort of search routine to minimize the sum of squares error. It's a bit weak on day 1 but quite good from there on.
Day Count CountHat
1 241 14
2 522 555
3 2287 2197
4 3412 3660
5 4680 4423
6 4795 4745
7 4845 4870
8 4887 4917
9 4902 4935
11 4920 4944
12 4923 4945
t(50%) turns out to be 3.159.
One way to get the standard error for t directly would be to do a jackknife analysis. Either write some R code (too hard for me) or just do the nonlinear regression 12 times, leaving out one line each time. Or there is probably an R function.
(I realize now the simply getting the SEs for a, b and c would not work well because they will be correlated.)
Once you have the SE for each set, then we can continue. kat

#### SergeantMike

##### New Member
Yes that is the number of days that I calculated also.

I know what you mean about the R code. It is something that I am trying to learn but it is often counter intutitave but I don't know if that is the stats jargon or just my poor programming skills.

Just one quick question, what is CountHat column?

#### katxt

##### Well-Known Member
CountHat is the count predicted by plugging x (days) into the equation. In stats the symbol for the predicted value is often written with a little hat (a circumflex is it?) over the symbol.

#### SergeantMike

##### New Member
Is Bias the same as SE with Jackknife results?

Jackknife statistics
Estimates Bias
a 4937.931475 7.16936606
b 12.842378 3.05857135
c 0.959727 0.03206308

------
Jackknife confidence intervals
Low Up
a 4868.2965580 5007.566392
b -5.8231224 31.507878
c 0.5593873 1.360067

#### katxt

##### Well-Known Member
These are the sort of things, but they are much wider than I thought. Also b can never be negative in your situation or else the counts would drop down to 5000 not up to 5000, so something funny there.
Can you calculate the t(50%) for each group and we'll see how close they are. kat

#### SergeantMike

##### New Member
Ok, I think I have it for all six varieties. The numbers are different because I used a more complete dataset, and there are the same number of data points for each variety, even if that value was zero. And the Results are
Row │ variety a b c t50
│ String Float16 Float16 Float16 Float16
──┼──────────────────────────────────────────────────
1 │ Aurora 668.0 14.56 0.4888 6.23
2 │ BlueJay 3014 7243 0.7944 11.65
3 │ Duke 2240 28910 0.8096 13.14
4 │ Jersey 11440 3.742 0.2094 8.055
5 │ Liberty 1057 9.13 0.3445 7.49
6 │ Northland 1033 10.836 0.328 8.38

This was generated by a little Julia script I wrote, hence the wonkyness of the table.

So what I was thinking, and tell me if I am thinking wrongly, that if I calculated the CountHat for each variety at each time point and subtracted that from the actual point and squared it that would give me the MSE basically, (y-ŷ)². From there I can calculate the SE by simply taking the square root.

#### katxt

##### Well-Known Member
if I calculated the CountHat for each variety at each time point and subtracted that from the actual point and squared it that would give me the MSE basically, (y-ŷ)². From there I can calculate the SE by simply taking the square root.
I'm afraid not. What the R non linear routine is doing is taking some initial values for a, b and c, working out the yhat or CountHat for each point (incidentally, how did you get that hat in (y-ŷ)²?), then subtracting and squaring as you have suggested, and adding to get SSE (sum of square errors). Then it mucks about with the values of a, b and c until SSE is the smallest possible value. Then it prints a, b and c and calculates t50.
You want to compare the various t50s so you first need to know how accurate each estimate is, that is you need the SE of each t50. In some special simple situations there are formulas for the SE. Not here, alas.
You do have estimates of the SEs for a, b and c done by the jackknife method, but I have to say I don't trust them much but even so. they will be correlated and can't be used to give you SE t50.
You can do your own jackknife estimation for SE t50.
Take Aurora with say 12 data points. You already have found t50 for the full data set.
Remove point 1. Do the same regression on the reduced 11 number set. Find a, b and c and so t50#1. Record t50#1
Replace point 1 and remove point 2. Do the regression on the reduced 11 number set. Find a, b and c and so t50#2. Record t50#2
Replace point 2 and remove point3. Get t50#3. And so on to t50#12. Miss a different one out each time.
Find the SD of the 12 T50s and multiply by sqrt(11^2/12). This is your SE t50 for Aurora.
Whew. https://www.statisticshowto.com/jackknife-estimator/ The formula is equivalent to last instruction.
When these are done, you can start to compare the t50s.

#### SergeantMike

##### New Member
Whist I digest that amount of information i will tell you that if you have a windows 10 machine, if you go to Windows Accessories, there's an app called Keycaps. If you one that you will see all manner of "hidden" characters. All you do is highlight it, click select, then click copy. Then go your document and paste the character in.

If you have a Mac I'm afraid I can't help you but there is most assuredly an equilvalet app

Thank you for the information. It's going to take a bit to digest it all. I will likely develop more questions.

#### katxt

##### Well-Known Member
Great. Thanks for that. For ever learning. kat

#### SergeantMike

##### New Member
Ok, Kat. It took a while but here are the results of the SD calculations. Duke is a clearly out of whack and I need to go back and look at the original data but the others seem pretty consistent. I am assuming the units are days here.

Variety Aurora Standard Error: 0.03783832826315897
Variety BlueJay Standard Error: 0.027158613730570626
Variety Duke Standard Error: 105.92287905900504
Variety Jersey Standard Error: 0.0468244596798439
Variety Liberty Standard Error: 0.022382778209230184
Variety Northland Standard Error: 0.05161874603472565

#### katxt

##### Well-Known Member
Now, assuming that all your calculations for each t50 and its SE are correct, we can test to see if there is a significant t50 difference between any two groups.
Aurora vs BlueJay
Difference = 11.65 - 6.23 = 5.42
SEDifference = sqrt(0.0378^2+.0271^2) = 0.0465
t =5.42/0.0465 = 117 (this t is the statistics t of the t test, not the emergence time)
df (assuming 12 points for each) = 2*(12-1)=22
p =TDIST(117,22,2) in Excel = 3x10^-32. Very small p, very large (certain) chance of a difference.
One problem is the cutoff p for no significant difference. Commonly p = 0.05 is used but you have many tests to do. By the time you have tested each against the others you have 15 tests so your chance of a false positive is much more than 0.05. I would use p = 0.01 as a test. p<0.01 different. p>0.01 not proved different.
Just eyeballing your results, I would say that all are statistically different even though the last three may not be practically different'
Cheers, kat

#### SergeantMike

##### New Member
This may be a job for R but I will look into that.

In the data I have been analyzing has an N=22.

The analysis you did above makes sense when looking at the attached graph. There seems to a break out into two groups, with Duke being the one furtherest away from the "main body?

Now here is the 64,000 reference question. Is the analysis you have shown me, more accurate or robust than doing an arcsine transformation then running an ANOVA using a linear model? I think it better describes what is seen but there is a lot of transforming going on.

#### katxt

##### Well-Known Member
At least the Gompbertz analysis has a theoretical model behind it though looking at the graphs, the fit to that model is nowhere near as close as your first post implied. Any thoughts on the nasty kinks? No model is going to fit those.
What are you actually looking to prove that isn't plain from the graphs?


text:
QUESTION

# HCP 210 Week 2 Assignment Ethical Decision

This document of HCP 210 Week 2 Assignment Ethical Decision shows the solutions to the following points:

Read the scenario about Mrs. Mortimer located under the section Ethics and the Pharmacy Technician on p. 5 of the text. Review the five moral principles located on p. 5 and the nine ethical theories located on pp. 6-7 of your text. Write a 350- to 700-word, paper addressing the following points:

- With which two theories do you agree relate to the Mrs. Mortimer scenario? Defend your selections.

- How does each theory benefit Mrs. Mortimer?

- How does each theory benefit the pharmacy?

- Why do you think openness to a variety of ethical theories is important when working in pharmacy practice?

Format your paper according to APA standards. Consider the five moral principles as you select your theories. Post your paper as an attachment.
• @
• 1 order completed
Tutor has posted answer for $10.99. See answer's preview$10.99


text:
# AP Calculus AB — Practice Exam Multiple Choice Part B

This is Part B of the multiple choice section of our free AP Calculus AB practice exam. There are a total of 15 test questions which must be answered within 45 minutes. A calculator is required for some questions on this part of the AP Calculus AB multiple choice.

Congratulations - you have completed .

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%

 Question 1
Calculate the volume formed by the revolution of the function below around the $y$-axis. The function is bounded by the $y$-axis, $y = 4$, and $x = 3.5$.

$f(x) = \dfrac{3}{(x + 1)^2} + e^x$

 A $737.016$ B $739.983$ C $368.508$ D $44.899$
Question 1 Explanation:
The correct answer is (A). Below is a portion of the graph of the revolved function.

The shaded portion represents the portion of the graph that results from the revolution of the curve. Then, the radius is $x$, and the height is $f(3.5) − f(x)$. We must identify the other limit of $x$, which corresponds with intersection of $f(x)$ with $y = 4$. This occurs at $x = 0$ and $x = 1.12214412$.

However, the integral must be split into two portions. The first part is simply a rectangle, as all $f(x)$ values prior to $x = 1.2214412$ are all equal to $4$, by the bounds of the region. Then, the integral after that is dependent upon the function height.

We can identify the volume of the solid using shell method in the integral below.

$V=2π \displaystyle\int_0^{1.12214412} x(33.2636 − 4)dx~~+$

$2π \displaystyle\int_{1.12214412}^{3.5}x(33.2636 − \dfrac{3}{(x+1)^2} − e^x) dx$

$≈ 737.01581$
 Question 2
Identify the acceleration of the particle given by the position function below at time $t = 7.6$.

$s(t) = \ln(t^2) + \ln(\sin(t))$

 A $−15.875$ B $−0.303$ C $−1.102$ D $0.523$
Question 2 Explanation:
The correct answer is (C). To find the acceleration function, we must derive the position function twice.

$s'(t) = v(t)$ $= \dfrac{1}{t^2} \cdot 2t + \dfrac{1}{\sin(t)} \cdot \cos(t)$ $= \dfrac{2}{t} + \cot(t)$

$s''(t) = v'(t) = a(t)$ $= −\dfrac{2}{t^2} − \csc^2(t)$

Then we can substitute $t = 7.6$

$a(7.6) = −\dfrac{2}{(7.6)^2} − \csc^2 (7.6) ≈ −1.102$
 Question 3
Solve for $y$ given $\frac{dy}{dx} = tan^2 (x), y(0) = 1$

 A $y = \tan(x) − x + 1$ B $y = \tan(x) − x − 1$ C $y = \sec^2(x) + x + 1$ D $y = \sec^2(x) − x + 1$
Question 3 Explanation:
The correct answer is (A). Begin by separating the variables:

$dy = \tan^2(x) dx$

Integrate both sides to solve for $y$:

$y = \displaystyle\int \tan^2(x) dx$

Since $\tan^2(x) = \sec^2(x) − 1$,

$y = \displaystyle\int (\sec^2(x) − 1) dx$

Splitting into two integrals and solving:

$y = \tan(x) − x + C$

Using the initial value given:

$1 = \tan(0) − 0 + C$

$C = 1$

Thus, the solution to the differential equation is:

$y = \tan(x) − x + 1$
 Question 4
Find the bounded area between the two functions below.

$f(x) = \sqrt{x}$

$g(x) = x^2$

 A $\dfrac{1}{3}$ B $−\dfrac{1}{3}$ C $\dfrac{2}{3}$ D $−\dfrac{2}{3}$
Question 4 Explanation:
The correct answer is (A). Start by setting the equation equal and finding the bounds.

$\sqrt{x} = x^2$

$x = x^4$

$x^4 − x = 0$

$x(x^3 − 1) = 0$

$x = 0, 1$

On the interval $[0, 1]$, $f(x)$ is above $g(x)$ (using a graphing calculator). This means the integral to evaluate is:

$\displaystyle\int_0^1(\sqrt{x} − x^2)dx$

$\dfrac{2}{3} x^{\frac{3}{2}} − \dfrac{1}{3}x^3$

Applying the first fundamental theorem using the bounds:

$\left[ \dfrac{2}{3} (1)^{\frac{3}{2}} − \dfrac{1}{3}(1)^3 \right]$ $− \left[\dfrac{2}{3} (0)^{\frac{3}{2}} − \dfrac{1}{3}(0)^3 \right]$

$= \dfrac{2}{3} − \dfrac{1}{3} − 0 = \dfrac{1}{3}$
 Question 5
How many critical points does the function below contain?

$f(x) =$ $\dfrac{1}{5}x^5 + \dfrac{1}{3}x^3 − \dfrac{7}{3}x^3 − \dfrac{1}{2}x^2 + 6x$

 A $5$ B $3$ C $4$ D $2$
Question 5 Explanation:
The correct answer is (C). To find the number of critical points, we must identify the function’s critical points. We do this by finding the derivative of the function and setting it equal to zero.

$f'(x) =$ $x^4 + x^2 − 7x^2 − x + 6 = 0$

Using the calculator, we find that the function has roots $x = −2$, $x = −1.3027$, $x = 1$, and $x = 2.3027$. Therefore, the function has $4$ critical points.
 Question 6
At what time(s) does the velocity of the particle given by the parametric equations below equal $0$ within the first $25$ seconds?

$y = 20 \sin(\sqrt{t})$

$x = 3t$

 A $t = 2.467$ B $t = 22.207$ C $t = 2.467, t = 22.207$ D $t = 9.870$
Question 6 Explanation:
The correct answer is (C). The velocity function is equal to $\frac{dy}{dx}$. Recall that the first derivative of two parametric equations has the formula below.

$\dfrac{dy}{dx} = \dfrac{\frac{dy}{dt}}{\frac{dx}{dt}}$

$\dfrac{dy}{dt} = 20 \cdot \cos(\sqrt{t}) \cdot \dfrac{1}{2}(t)^{−\frac{1}{2}}$ $= \dfrac{10 \cos(\sqrt{t})}{\sqrt{t}}$

$\dfrac{dx}{dt} = 3$

$\dfrac{dy}{dt}$ $= \dfrac{10 \cos(\sqrt{t})}{3\sqrt{t}} = 0$

Solving for $t$, we find that $t = \left( \dfrac{π}{2} \right)^2 ≈ 2.467$ and $t = \left( \dfrac{3π}{2} \right)^2 ≈ 22.2066$, both of which are within the first $25$ seconds.
 Question 7
The average value of $f(x) = e^x$ on the interval $[1, 5]$ is equal to which of the following?

 A $12.970$ B $36.423$ C $36.424$ D $36.853$
Question 7 Explanation:
The correct answer is (C). The integral to be evaluated is:

$\dfrac{1}{5 − 1} \displaystyle\int_1^5 e^x dx$

$= \dfrac{1}{4} e^x$

Applying the first fundamental theorem:

$\dfrac{1}{4}e^5 − \dfrac{1}{4}e^1 = 36.424$
 Question 8
Identify the acceleration of a particle moving along the curve $s(x) = \ln (x^3 + \cos(x))$ at $x = 3$.

 A $1.033$ B $−0.336$ C $−8.745$ D $0.010$
Question 8 Explanation:
The correct answer is (B). To identify the acceleration of the particle, we must take the derivative of the position function twice.

$s'(x) = v(x)$ $= \dfrac{1}{x^3 + \cos(x)} \cdot (3x^2 − sin(x))$

$= \dfrac{(3x^2 − \sin(x))}{x^3 + \cos(x)}$

$s''(x) = v'(x) = a(x) =$

$\dfrac{(x^3 + \cos(x))(6x − \cos(x)) − (3x^2 − \sin(x))(3x^2 − sin(x))}{(x^3 + \cos(x))^2}$

To save time on the examination, it is recommended that you do not simplify the above derivative. We can instead just evaluate the acceleration at $x = 3$ directly. This is where the calculator comes in handy.

$a(3) ≈ −0.33623$
 Question 9
$\lim\limits_{n\to \infty} \dfrac{n^2}{2^n}$

 A $0$ B $2$ C $\infty$ D $n$
Question 9 Explanation:
The correct answer is (A). The limit evaluates to $\frac{\infty}{\infty}$ by direct substitution, which is one of the indeterminate forms that justifies the use of L’Hôpital’s rule.

It is important to recognize that the derivative of $2^n$ is $\ln(2) \cdot 2^n$.

$\lim\limits_{n\to \infty} \dfrac{n^2}{2^n}$ $= \lim\limits_{n\to \infty} \dfrac{2n}{\ln(2) \cdot 2^n}$ $= \dfrac{\infty}{\infty}$

We can use L’Hôpital’s rule once again. Be careful with your derivation. The use of logarithmic rules will largely help in the derivation.

$\lim\limits_{n\to \infty} \dfrac{2n}{\ln(2) \cdot 2^n}$ $= \lim\limits_{n\to \infty} \dfrac{2}{(\ln(2))^2 \cdot 2^n} = 0$
 Question 10
Identify the equation of the tangent line to the function $f(x) = x \cdot \ln(10x) \cdot \sin(x)$ at $x = 3$.

 A $y − 1.440 = −9.480(x − 3)$ B $y = 1.440(x − 3)$ C $y − 3 = −9.480(x − 1.440)$ D $y − 9.480 = −1.440(x − 3)$
Question 10 Explanation:
The correct answer is (A). To find the equation of the tangent line, we must first identify the slope of the tangent line by identifying the derivative of the function at $x = 3$. Be careful with you derivation. Double product rule is necessary for derivation.

$f'(x) =$

$x \left( \ln(10x) \cos(x) + \sin(x) \cdot \frac{1}{x} \right) + (\ln(10x) \sin(x))$

$= x \cdot \ln(10x) \cos(x) + \sin(x) + \ln(10x) \sin(x)$

$f'(3) =$

$3 \cdot \ln(30) \cos(3) + \sin(3) + \ln(30) \sin(3) ≈ −9.4804$

Then, we can identify the point of tangency for point-slope form by plugging in $x = 3$ into the original function.

$f(3) = 3 \ln(30) \sin(3) ≈ 1.4399$

Therefore, the point slope equation of the tangent line is of the form below.

$y − 1.4399 = −9.4804(x − 3)$
 Question 11
A balloon being filled with air expands at $4$ cm$^3$ per minute. Assuming the balloon fills in a spherical shape, how fast is the radius of the spherical balloon increasing in cm per minute after $2.25$ minutes?

 A $1.290$ B $0.444$ C $0.601$ D $0.191$
Question 11 Explanation:
The correct answer is (D). We can relate the volume to the radius of a sphere using the formula for the volume of a sphere.

$V = \dfrac{4}{3} πr^3$

We can then derive this formula to relate the given rates.

$\dfrac{dV}{dt} = 4πr^2 \cdot \dfrac{dr}{dt}$

We were given that the balloon is being filled with $4$ cm$^3$ volume of air per minute. We are also given that the time is $2.25$ minutes. This means that $2.25(4) = 9$ cm$^3$ volume is present in the balloon at $2.25$ minutes. Thus, we can calculate the volume of the balloon at that time using the formula of the volume of a sphere:

$9 = \dfrac{4}{3} πr^3$

$r = \left(\dfrac{27}{4π} \right)^{\frac{1}{3}} ≈ 1.2904$

Then, we can solve for the rate of change of the radius by plugging in all the known values.

$4 = 4π(1.2904)^2 ⋅ \dfrac{dr}{dt}$

$\dfrac{dr}{dt} ≈ 0.1912$
 Question 12
A soldier drops a bomb out of an airplane at $537$ feet of altitude traveling parallel to the ground. The bomb falls at a rate of $32$ feet per second due to gravity, while the plane travels away from the bomb at a rate of $731$ feet per second. At what rate is the distance between the plane and the bomb changing when the bomb hits the ground?

 A $731.700$ $\text{feet}$ $\text{per}$ $\text{second}$ B $728.901$ $\text{feet}$ $\text{per}$ $\text{second}$ C $1.043$ $\text{feet}$ $\text{per}$ $\text{second}$ D $71228.842$ $\text{feet}$ $\text{per}$ $\text{second}$
Question 12 Explanation:
The correct answer is (A). Below is a diagram of the scenario described by the problem.

It is clear from the diagram that the relationship is related to triangle properties. We can relate the bombs height from the dropping altitude and the plane’s distance from the bomb with Pythagorean’s Theorem.

$a^2 + b^2 = c^2$

This implies that $a =$ altitude and $b =$ the planes distance from the bomb and $c =$ the distance between the two.

We can identify the distance the plane is from the bomb when it lands based on the rate of fall of the bomb. If the bomb has to travel $537$ feet to reach the ground, and it approaches the ground at a rate of $32$ feet per second, then it must take $\frac{537}{32} = 16.78125$ seconds for the bomb to reach the ground.

This implies that the plane has traveled $731(16.78125)$ $= 12267.094$ feet since dropping the bomb. This means that the distance between the plane and the bomb can be determined by substituting these values into the Pythagorean relationship.

$(537)^2 + (12267.094)^2 = x^2$

$x = 12278.842$

We can then relate the rates of the two objects by deriving the Pythagorean relationship.

$2a \cdot \dfrac{da}{dt} + 2b \cdot \dfrac{db}{dt}$ $= 2x \cdot \dfrac{dx}{dt}$

$2(537)(32) + 2(12267.094)(731)$ $= 2(12278.842) \cdot \dfrac{dx}{dt}$

$\dfrac{dx}{dt} ≈ 731.7$
 Question 13
Find the position of the particle at time $t = 3$ for the particle given by the velocity function below. The particle is at $0$ when $t = 1$.

$v(t) = \sin((\ln(t))^2)$

 A $1.914$ B $1.184$ C $2.184$ D $0.914$
Question 13 Explanation:
The correct answer is (D). The position function of the particle is found by integrating the velocity function.

$s(t) = \displaystyle\int v(t) dt$ $=\displaystyle\int \sin(\ln(t))^2) dt$

At this point, actually integrating by hand is inefficient. This is where the calculator comes in handy. We can identify limits of integration to be $1$ to $3$ based on the given information. The position of the particle at $t = 3$ is then of the form below.

$s(3) = \displaystyle\int_1^3 \sin(\ln(t))^2) dt + 0$ $≈ 0.91377$
 Question 14
Find the displacement of a particle traveling along the curve below from $t = 1$ to $t = 4.3$.

$s(t) = 4^x$

 A $277.014$ B $527.915$ C $384.023$ D $279.178$
Question 14 Explanation:
The correct answer is (C). The displacement of a particle along a position function has the formula below.

Displacement $= \displaystyle\int_a^b v(t)dt$

We can find the velocity function by deriving the position function. Be careful with your derivation.

$s'(t) = v(t) = \ln(4) \cdot 4^x$

We can then plug this into the integral below.

$\displaystyle\int_1^{4.3} \ln(4) \cdot 4^x dx ≈ 384.023$
 Question 15
Find the slope of the line tangent to the parametric curve at $t = 6$.

$x = 4\sin(t^2)$

$y = e^t + t^2$

 A $−67.635$ B $10.698$ C $−1.954$ D $−8.727$
Question 15 Explanation:
The correct answer is (A). Recall that the first derivative of two parametric equations has the formula below.

$\dfrac{dy}{dx} = \dfrac{\frac{dy}{dt}}{\frac{dx}{dt}}$

We can find the slope of the tangent line at $t = 6$ based on the first derivative of the two functions.

$\dfrac{dx}{dt} = 8t \cdot \cos(t^2)$

$\dfrac{dy}{dt} = e^t + 2t$

$\dfrac{dy}{dx} = \dfrac{e^t + 2t}{8t \cdot \cos(t^2)}$

Then, we can substitute $t = 6$ into the equation.

$\dfrac{dy}{dx} = \dfrac{e^6 + 2(6)}{8(6) \cdot \cos(6^2)}$ $≈ −67.635$
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
There are 15 questions to complete.
 ← List →