C++_CHAP5
chap5 程序的控制结构

表达式为假,即条件不满足, 则跳过语句直接到出口。
入口 条件 假 真
语句
出口
2、双分支结构
语句形式:
if(条件表达式): 语句/语句块1
else: 语句/语句块2
语句执行流程:
表达式为真,即条件满足,则
判断条件: 执行语句1后到出口。
表达式为假,即条件不满足, 则执行语句2后到出口。
入口 条件 假 真
语句1 语句2
出口
双分支结构举例:从键盘输入两个浮点数a和b,按 照从小到大的顺序输出这两个数。
双分支 ab==eevvaall((iinnppuutt((''请 请输再入输入一个一实个数实数::')')))输入a,b
结构 if(a>b): a>ba值>b为值假为真
假
(条件
print("%.1f,%.1f"%(b,a))
pencolor("blue"); circle(100) pencolor("yellow"); circle(50) left(360/n)
循环:while
while <条件>: 循环体
入口
假 条件 真 语句(循环体)
出口
条件循环
例:求1~100之间所有整数和。
sum=0;i=1 while(i<=100):
这是一个嵌 套结构
if(x>=0):
if(x>0):y=1
else:y=0 # x>=0成立且x>0不成立,即x==0
else:
# x>=0不成立,即x<0
y=-1
Chap5 基于ARM的硬件系统设计

发送前:线路处于空闲状态,连续发送 “1” 开始发送:首先,发送一位起始位 “0” 然后,发送连续的二进制位,数据位可以为5、6、7、 8 随后,紧跟一位奇偶校验位(可选择奇/偶/无校验) 最后,发送停止位 “1”,可以有1位、1.5位或2位停 止位
32
串行通讯硬件规范及连接方法
EIA RS-232C
主要优点:内存地址空间与I/O接口地址空间分开,互不影响, 主要优点:内存地址空间与I/O接口地址空间分开,互不影响,译码电 I/O接口地址空间分开 路较简单,并设有专门的I/O指令,所以编程序易于区分, I/O指令 路较简单,并设有专门的I/O指令,所以编程序易于区分,且执行时间 快速性好。 短,快速性好。 缺点:只用I/O指令访问I/O端口,功能有限且要采用专用I/O I/O指令访问I/O端口 I/O周期和专 缺点:只用I/O指令访问I/O端口,功能有限且要采用专用I/O周期和专 I/O控制线 使微处理器复杂化。 控制线, 用I/O控制线,使微处理器复杂化。
22
I/O接口的编址方式——内存映射
系统地址空间 应用使用 应用使用 地址空间 地址空间
I/O设备硬件
0XFFFF I/O设备2 保留I/O 地址空间 I/O设备1 0X0000
1)2)I/O接口与存储器统一编址方式— —内存映射 这种编址方式不区分存储器地址空间 和I/O接口地址空间,把所有的I/O接 口的端口都当作是存储器的一个单元 对待,每个接口芯片都安排一个或几 个与存储器统一编号的地址号。也不 设专门的输入/输出指令,所有传送 和访问存储器的指令都可用来对I/O 接口操作。
25
建立通用的I/O接口函数
I/O操作 I/O操作
Create() Open() Read()
chap5 第5章 三相异步电动机原理2-1

第一节 三相异步电动机运行时的电磁过程 当三相异步电动机的定子绕组接到对 称三相电源时,定子绕组中就通过三相 交流电流。若不计谐波和齿槽影响,这 个对称三相交流电流将在气隙内形成按 正弦规律分布、并且以同步转速ns旋转 的旋转磁动势F1,由旋转磁动势F1建立 旋转的气隙主磁场Bm。 这个旋转磁场切割定子、转子绕组, 分别在定子、转子绕组内感应出定子电 动势和转子电动势。在转子电动势作用 下转子回路中有对称三相电流流过。于 是,在气隙磁场和转子电流的相互作用 下,产生了电磁转矩,转子就顺着旋转 磁场的方向转动。
异步电动机 的电流比
励磁电流
m1 N1kW 1 m2 N 2 kW 2 F2 0.9 I 2 0.9 I2 2 p 2 p
(二)电动势平衡方程式
U1 ( E1 ) ( E1 ) I1r1 E2 s ( E2 s ) I 2 (r2 R )
异步电动机带有负载后,转子转速降低,设转子以 转速 旋转,此时显然,旋转磁场的同步转速和转 子转速之间有一个同方向的相对运动,即旋转磁场 以转速差 n n 在切割转子绕组,电磁关系也将发 s 生变化。
n
I2 负载时,不再认为 E 2s 0 , 0 ,且 I 2 也形成 了磁动势 F 2 ,要弄清异步电机负载的物理情况,首 先要分析转子磁动势的性质。
m1 N1kW 1 m2 N 2 kW 2 m1 N1kW 1 0.9 I1 0.9 I 2 0.9 Im 2 p 2 p 2 p
ki
令 I 1 I 则 2 2
I1 I m ( I 2 )
负载电流
m1 N1kW 1 ki m2 N 2 kW 2
chap5中级宏观经济学答案 华中科技大学

Microeconomics, 4e (Perloff)Chapter 5 Applying Consumer Theory5.1 Deriving Demand Curves1) The above figure shows Bobby's indifference map for juice and snacks. Also shown are three budget lines resulting from different prices for snacks assuming he has $20 to spend on these goods. Which of the following points are on Bobby's price-consumption curve?A) 10 snacks and 20 juicesB) 10 snacks and 0 juicesC) 10 snacks and 5 juicesD) 10 snacks and 15 juicesAnswer: DTopic: Deriving Demand Curves2) The above figure shows Bobby's indifference map for juice and snacks. Also shown are three budget lines resulting from different prices for snacks assuming he has $20 to spend on these goods. Which of the following points are on Bobby's demand curve for snacks?A) p = 2, q = 10B) p = 2, q = 13C) p = 2, q = 5D) p = 1, q = 20Answer: CTopic: Deriving Demand Curves3) The above figure shows Bobby's indifference map for juice and snacks. Also shown are three budget lines resulting from different prices for snacks. This information could be used to determineA) the slope of Bobby's demand curve for juice.B) the amount by which Bobby's demand curve for juice shifts when his income rises.C) the amount by which Bobby's demand curve for juice shifts when the price of snacks rises.D) All of the above.Answer: CTopic: Deriving Demand Curves4) The above figure shows Bobby's indifference map for juice and snacks. Also shown are three budget lines resulting from different prices for snacks. As the price of snacks rises, Bobby's utilityA) stays the same.B) increases.C) decreases.D) might change, but there is not enough information to determine.Answer: CTopic: Deriving Demand Curves5) The above figure shows Bobby's indifference map for juice and snacks. Also shown are three budget lines resulting from different prices for snacks. Bobby's demand for snacks isA) unit elastic.B) elastic.C) inelastic.D) perfectly elastic.Answer: CTopic: Deriving Demand Curves6) The above figure shows Bobby's indifference map for juice and snacks. Also shown are three budget lines resulting from different prices for snacks. As the price of snacks rises, the price for juiceA) stays the same.B) increases.C) decreasesD) might change, but there is not enough information to determine.Answer: ATopic: Deriving Demand Curves7) An individual's demand curve for a good can be derived by measuring the quantities selected asA) the price of the good changes.B) the price of substitute goods changes.C) income changes.D) All of the above.Answer: ATopic: Deriving Demand Curves8) As the price of a good rises, the consumer will experienceA) a desire to consume a different bundle.B) a decrease in utility.C) a southwesterly movement on the indifference map.D) All of the above.Answer: DTopic: Deriving Demand Curves9) An increase in the price of a good causesA) a change in the slope of the budget line.B) an increase in the consumption of that good.C) a rightward shift of the demand curve for that good.D) a parallel rightward shift of the budget line.Answer: ATopic: Deriving Demand Curves10) Suppose a graph is drawn to show a consumer's preferences for football tickets and basketball tickets. The quantity of football tickets is measured on the horizontal axis. If the price-consumption curve is horizontal when the price of football tickets changes, thenA) football tickets are an inferior good.B) the demand for football tickets is perfectly elastic.C) the demand for football tickets is unit elastic.D) the demand curve for football tickets will be horizontal.Answer: CTopic: Deriving Demand Curves11) In the relevant price range a demand curve for a Giffen good would beA) upward sloping.B) downward sloping.C) horizontal.D) vertical.Answer: ATopic: Deriving Demand Curves12) Suppose the quantity of x is measured on the horizontal axis. If the price consumption curve is vertical when the price of x changes, then the demand for x isA) perfectly elastic.B) perfectly inelastic.C) unit elastic.D) There is not enough information to determine the price elasticity of demand for x.Answer: BTopic: Deriving Demand CurvesFor the following, please answer "True" or "False" and explain why.13) If the price-consumption curve is upward sloping when the price of the good measured on the horizontal axis changes, then the demand curve for that good will be upward sloping.Answer: False. An upward-sloping price-consumption curve indicates that as the price of the good falls, more of both goods will be purchased. So, the demand curve for the good measured on the horizontal axis slopes downward.Topic: Deriving Demand Curves14) Draw two graphs, one directly above the other. On the upper graph, label the vertical axis Good X and label the horizontal axis Good Y. On the lower graph, label the vertical axis the Price of good Y and label the horizontal axis Good Y. In the upper graph, show the income and substitution effects of a decrease in the Price of good Y when Y is a Giffen good. Draw the corresponding demand curve for Good Y in the lower graph.Answer:See the above figure. Point A is the original consumption point. The movement from point A to point B is the substitution effect. The movement from point B to point C is the income effect.Topic: Deriving Demand Curves15) The above figure shows a consumer's indifference curves for soda and all other goods. Assuming a budget of $100, derive the consumer's demand for soda for prices of $4 and $10 per case of soda. Estimate the price elasticity of demand for soda.Answer: At a price of $4, 15 cases are purchased, At a price of $10, 6 cases are purchased. In both cases, the same total amount, $60, is spent on soda. This implies unit elasticity.Topic: Deriving Demand Curves16) Use the Slutsky equation to show that a Giffen good must be an inferior good, BUT an inferior good need not be a Giffen good.Answer: The Slutsky equation may be written as dQ/dp Total dp Total = dQ/ dp subs - _(dQ/dI). For a Giffen good, dQ/dp Total is positive, which implies that - _(dQ/dI) must be positive and large enough to offset dQ/ dp subs, which is always negative. For any inferior good, however, - _(dQ/dI) is positive but not necessarily large enough to make dQ/ dp Total positive.Topic: Deriving Demand Curves5.2 How Changes in Income Shift Demand Curves1) A movement upward along an upward sloping Engel curve corresponds toA) upward sloping indifference curves.B) crossing indifference curves.C) a rotation in the budget constraint.D) a parallel shift in the budget constraint.Answer: DTopic: How Changes in Income Shift Demand Curves2) When deriving an Engel curve the prices of both goodsA) are held constant.B) increase by the same percentage as income.C) decrease by the same percentage as income.D) can either decrease, increase or stay the same.Answer: ATopic: How Changes in Income Shift Demand Curves3) The above figure shows Larry's indifference map and budget lines for ham and pork. Which of the following statements is TRUE?A) Pork is an inferior good.B) Ham is an inferior good.C) Neither pork nor ham is an inferior good.D) Both ham and pork are inferior goods.Answer: BTopic: How Changes in Income Shift Demand Curves4) The above figure shows Larry's indifference map and budget lines for ham and pork. Which of the following statements is TRUE?A) Larry's Engel curve for pork will be upward sloping.B) Larry's Engel curve for pork will be downward sloping.C) Larry's Engel curve for pork will be backward bending.D) Larry's Engel curve for pork cannot be derived from the information provided.Answer: ATopic: How Changes in Income Shift Demand Curves5) The above figure shows Larry's indifference map and budget lines for ham and pork. Which of the following statements is TRUE?A) Larry's demand curve for pork shifts rightward when his income increases.B) Larry's income elasticity of demand for pork is greater than zero.C) Pork is a normal good.D) All of the above.Answer: DTopic: How Changes in Income Shift Demand Curves6) After Joyce and Larry purchased their first house, they made additional home improvements in response to increases in income. After a while, their income rose so much that they could afford a larger home. Once they realized they would be moving, they reduced the amount of home improvements. Their Engel curve for home improvements on their current home isA) negatively sloped.B) flat.C) positively sloped.D) backward bending.Answer: DTopic: How Changes in Income Shift Demand Curves7) Suppose the quantity of x is measured on the horizontal axis. If the income consumption curve is vertical, then the income elasticity of demand for x isA) 0.B) 1.C) -1.D) There is not enough information to determine the income elasticity of demand for x.Answer: ATopic: How Changes in Income Shift Demand Curves8) An inferior good exhibitsA) a negative income elasticity.B) a downward sloping Engel curve.C) a decline in the quantity demanded as income rises.D) All of the above.Answer: DTopic: How Changes in Income Shift Demand Curves9) When John's income was low, he could not afford to dine out and would respond to a pay raise by purchasing more frozen dinners. Now that his income is high, a pay raise causes him to dine out more often and buy fewer frozen dinners. Which graph in the above figure best represents John's Engel curve for frozen dinners?A) Graph AB) Graph BC) Graph CD) Graph DAnswer: ATopic: How Changes in Income Shift Demand Curves10) When John's income was low, he could not afford to dine out and would respond to a pay raise by purchasing more frozen dinners. Now that his income is high, a pay raise causes him to dine out more often and buy fewer frozen dinners. Which graph in the above figure best represents John's Engel curve for dining out?A) Graph AB) Graph BC) Graph CD) Graph DAnswer: BTopic: How Changes in Income Shift Demand Curves11) Even though Mary's income is very low, she makes sure that she purchases enough milk for her family to drink. As her income rises, she does buy more milk. Which graph in the above figure best represents Mary's Engel curve for milk?A) Graph AB) Graph BC) Graph CD) Graph DAnswer: CTopic: How Changes in Income Shift Demand Curves12) When John was in college and his income was low, he drank "Red Ribbon" beer. As his income increased, he purchased better-quality beer and less "Red Ribbon." Which graph in the above figure best represents John's Engel curve for "Red Ribbon" beer?A) Graph AB) Graph BC) Graph CD) Graph DAnswer: DTopic: How Changes in Income Shift Demand Curves13) Which graph in the above figure best represents a good that is an inferior good at some income levels, and a normal good at other income levels?A) Graph AB) Graph BC) Graph CD) Graph DAnswer: ATopic: How Changes in Income Shift Demand Curves14) If consumer income and prices increase by the same percentageA) the consumer will buy more of both goods.B) the consumer will buy more of both goods if they are both normal goods.C) the consumer will buy less of both goods if they are both inferior goods.D) the consumer's utility maximizing bundle stays the same.Answer: DTopic: How Changes in Income Shift Demand CurvesFor the following, please answer "True" or "False" and explain why.15) An increase in income (all else equal) will ALWAYS lead to a parallel shift of the budget line. Answer: True. Since prices are unchanged the relative prices of the goods stays the same and thus the slope of the budget line.Topic: How Changes in Income Shift Demand Curves16) Explain what the slope of the income consumption curve shows about the income elasticity of demand. Answer: A positive slope of the income consumption curve is associated with a positive income elasticity of demand, and a negatively sloped income consumption curve is associated with a negative income elasticity of demand. The income consumption curve represents how consumption changes with an increase in income. An upward sloping income consumption curve represents an increase in consumption as income rises, as does a positive income elasticity.Topic: How Changes in Income Shift Demand Curves17) Why can't all goods be inferior?Answer: If all goods were inferior, an increase in income would lead to a decline in the quantity demanded for all goods. This, however, would leave the consumer below the budget line and therefore not achieving the highest utility possible.Topic: How Changes in Income Shift Demand Curves18) The above figure shows three different Engel curves. Rank them in terms of income elasticity. Answer: Engel curve A implies that a certain level of income is required before any of the good is purchased. Engel curve B implies that the quantity demanded is proportional to income (unit elastic). Engel curve C implies that the good is a necessity since it would be consumed even if income were zero. Thus _A > _B > _C.Topic: How Changes in Income Shift Demand Curves19) When income increases by 1%, the quantity demanded of a good decreases by 2%. What is the income elasticity of the good? Is the good normal or inferior? Why?Answer: The income elasticity is -2. The good is inferior because the income elasticity is negative.Topic: How Changes in Income Shift Demand Curves20) Why would you expect the demand for diamond jewelry to fall faster than plastic, costume jewelry when all incomes fall?Answer: The income elasticities differ for the two goods. Diamond jewelry most likely has a larger income elasticity than costume jewelry.Topic: How Changes in Income Shift Demand Curves21) Draw budget constraints, indifference curves, and the income consumption curve for a good that has an income elasticity that is perfectly inelastic.Answer:See the above figure.Topic: How Changes in Income Shift Demand Curves5.3 Effects of a Price Change1) Median household income is $50,000 per year. The typical household spends about $125 per year on milk, which has an income elasticity of about 0.07. From this information, we can conclude thatA) milk is a luxury.B) milk is a Giffen good.C) the income effect from a change in the price of milk is very large.D) the income effect from a change in the price of milk is very small.Answer: DTopic: Effects of a Price Change2) When the price of a good changes, the total effect of the price change on the quantities purchased can be found by comparing the quantities purchasedA) on the old budget line and the new budget line.B) on the original indifference curve when faced with the original prices and when faced with the new prices.C) on the new budget line and a hypothetical budget line that is a parallel shift back to the original indifference curve.D) on the new indifference curve.Answer: ATopic: Effects of a Price Change3) When the price of a good changes, the substitution effect can be found by comparing the equilibrium quantities purchasedA) on the old budget line and the new budget line.B) on the original indifference curve when faced with the original prices and when faced with the new prices.C) on the new budget line and a hypothetical budget line that is a shift back to the original indifference curve parallel to the new budget line.D) on the new indifference curve.Answer: BTopic: Effects of a Price Change4) When the price of a good changes, the income effect can be found by comparing the equilibrium quantities purchasedA) on the old budget line and the new budget line.B) on the original indifference curve when faced with the original prices and when faced with the new prices.C) on the new budget line and a hypothetical budget line that is a shift back to the original indifference curve parallel to the new budget line.D) on the new indifference curve.Answer: CTopic: Effects of a Price Change5) The substitution effect can be measured holding ________ constant.A) incomeB) utilityC) the price of one goodD) the price of all goodsAnswer: BTopic: Effects of a Price Change6) Suppose that frozen dinners were once a normal good for John, but now frozen dinners are an inferior good for him. John's demand curve for frozen dinnersA) has become steeper as a result.B) has become flatter as a result.C) has not changed as a result.D) has disappeared as a result.Answer: ATopic: Effects of a Price Change7) One characteristic of a Giffen good is that itA) is a luxury good.B) is an inferior good.C) has an upward-sloping Engel curve.D) All of the above.Answer: BTopic: Effects of a Price Change8) A Giffen good hasA) a positive substitution effect.B) a negative income effect.C) a larger income effect than substitution effect.D) All of the above.Answer: DTopic: Effects of a Price Change9) If a good is an inferior good, then itsA) demand curve will be upward sloping.B) income effect reinforces the substitution effect.C) income elasticity is negative.D) Engel curve cannot be drawn.Answer: CTopic: Effects of a Price Change10) Suppose Lisa spends all of her money on books and coffee. When the price of coffee decreases, theA) substitution effect on coffee is positive, and the income effect on coffee is positive.B) substitution effect on coffee is ambiguous, and the income effect on coffee is ambiguous.C) substitution effect on coffee is positive, and the income effect on coffee is ambiguous.D) substitution effect on coffee is ambiguous, and the income effect on coffee is positive.Answer: CTopic: Effects of a Price Change11) In the case of a normal goodA) demand curves always slope downward.B) the income effect and substitution effect are in the same direction.C) the Engel curve slopes upward.D) All of the above.Answer: DTopic: Effects of a Price Change12) The above figure shows Bobby's indifference map for soda and juice. B1 indicates his original budget line. B2 indicates his budget line resulting from a decrease in the price of soda. What change in quantity best represents his substitution effect?A) 3B) 10C) 15D) 7Answer: ATopic: Effects of a Price Change13) The above figure shows Bobby's indifference map for soda and juice. B1 indicates his original budget line. B2 indicates his budget line resulting from a decrease in the price of soda. What change in quantity best represents his income effect?A) 3B) 10C) 15D) 7Answer: DTopic: Effects of a Price Change14) The above figure shows Bobby's indifference map for soda and juice. B1 indicates his original budget line. B2 indicates his budget line resulting from an increase in the price of soda. From the graph, one can conclude thatA) Bobby views soda as an inferior good.B) Bobby's demand for soda is perfectly inelastic.C) Bobby views soda as a normal good.D) the income elasticity of demand for soda is 1.Answer: CTopic: Effects of a Price Change15) When measuring the substitution effect one uses the change alongA) the old indifference curve.B) the new indifference curve.C) either the old or the new indifference curve.D) the budget constraint.Answer: CTopic: Effects of a Price Change16) The Slutsky equation shows that, holding the total effect constant, the income effect will be larger for goods thatA) have a smaller substitution effect.B) make up a larger percentage of a household's budget.C) have perfectly inelastic demand curves.D) All of the above.Answer: BTopic: Effects of a Price Change17) Suppose that the interest rate paid to savers increases. As a result, Tom wishes to save less. This suggests that, for Tom,A) the substitution effect is greater than the income effect.B) the income effect is greater than the substitution effect.C) utility maximization is not occurring.D) future consumption is a luxury.Answer: BTopic: Effects of a Price Change18) Suppose that the interest rate paid to savers increases. As a result, Tom wishes to save more. This suggests that, for Tom,A) the substitution effect is greater than the income effect.B) the income effect is greater than the substitution effect.C) utility maximization is not occurring.D) future consumption is a luxury.Answer: ATopic: Effects of a Price ChangeFor the following, please answer "True" or "False" and explain why.19) If a consumer is compensated for the income effect that occurs when the price of a good increases, then his demand curves can never slope upward.Answer: True. The demand curve would only include the substitution effect. Even for Giffen goods, dq/dp is negative holding utility constant.Topic: Effects of a Price Change20) A good may be inferior at some income levels and normal at others.Answer: True. A consumer may demand more of the good at low income levels and less of the good at higher income levels. Hamburger or macaroni and cheese dinners may be examples of such goods.Topic: Effects of a Price Change21) If the Engel curve for a good is upward sloping, the demand curve for that good must be downward sloping.Answer: True. If the Engel curve is upward sloping, the good is normal. As a result, the income effect will reinforce the substitution effect and guarantee a downward-sloping demand curve.Topic: Effects of a Price Change22) Suppose Joe earns $1,000 in year 1 and $0 in year 2. Any amount he saves will earn interest at a rate of 10%. Draw Joe's budget line. (Hint: He can either consume all $1000 this year or consume nothing this year and have $1,100 next year.) Assuming convex indifference curves, show that an increase in the rate of interest can cause Joe's savings to either increase or decrease. Explain in terms of income and substitution effect.Answer:See the above figure. On the graph, his original bundle is e1 so that his savings equal 1000 - C1*. A higher interest rate rotates the budget line so that, depending on the shape of his indifference map, he may choose either e2, which means savings increase, or e3, which means savings decrease. One plus the interest rate represents the price of current consumption. A higher interest rate has two effects. The substitution effect means that Joe will save more because current consumption has become more expensive. The income effect says Joe will save less because, with the higher interest rate, lower savings could actually generate more future consumption.Topic: Effects of a Price Change23) Many manufacturers sell products labeled as having imperfections at a discount at their factory outlets but do not ship these imperfect goods to regular retail outlets. Why?Answer: There is some substitutability between the goods, but imperfects sell for a lower price. Suppose, for example, the good sells for $2, but imperfects sell for $1. Both goods cost the same to ship, say $1. As a result, the relative price of an imperfect at a factory outlet is (1/2) but rises to (2/3) at the retail outlet, where imperfects will not sell because of the higher relative price.Topic: Effects of a Price Change5.4 Cost-of-Living Adjustments1) Due to inflation, nominal prices are usuallyA) equal to real prices.B) smaller than real prices.C) larger than real prices.D) a constant proportion different from real prices.Answer: CTopic: Cost-of-Living Adjustments2) A consumer price index adjustment overcompensates for inflation because it ignoresA) the income effect when relative prices change.B) the substitution effect when relative prices change.C) that some goods are inferior.D) that the substitution effect may offset the income effect.Answer: BTopic: Cost-of-Living Adjustments3) Employing a fixed-weight index like the Consumer Price Index to adjust a person's salary in response to inflation will overcompensate this person because doing so will allow this person toA) buy the same bundle of goods as he did before the inflation.B) achieve a higher level of utility than he did before the inflation.C) achieve the same level of utility as before the inflation.D) buy more of all goods.Answer: BTopic: Cost-of-Living Adjustments4) Under which of the following conditions will there be no substitution bias in the CPI?A) Indifference curves are convex.B) Indifference curves are L-shaped.C) Indifference curves are linear.D) Indifference curves are downward sloping.Answer: BTopic: Cost-of-Living Adjustments5) Under which of the following conditions will there be no substitution bias in the CPI?A) Lower-priced goods increase in price by a greater percentage than do higher-priced goods.B) Higher-price goods increase in price by a greater percentage than do lower-priced goods.C) All goods change in price by the same amount.D) All goods change in price by the same percentage.Answer: DTopic: Cost-of-Living Adjustments6) A true cost-of-living adjustment in response to a change in prices would compensate consumers so that they would be able toA) purchase the same bundle they purchased before prices changed.B) achieve the same level of utility they did before prices changed.C) face the same choices they did before prices changed.D) achieve an increase in utility that is equal to the rate of inflation.Answer: BTopic: Cost-of-Living Adjustments7) Richard receives government transfer payments and currently consumes 5 guns and 6 goose livers. Assume the price of guns decreases by 10% and the price of goose liver increases by 20%. The government raises Richard's transfer payments so he can still afford 5 guns and 6 goose livers. Does this constitute a true cost-of-living adjustment?A) No. Richard is overcompensated.B) No. Richard is undercompensated.C) Yes. The payment just achieves the right level of compensation.D) Not enough information.Answer: ATopic: Cost-of-Living Adjustments8) Before an uneven rise in prices Allan consumed 5 bread and 6 juice. After the price increase and with an increased welfare payment from the government Allan consumes 4 bread and 7 juice. Does the government payment represent a true cost-of-living adjustment?A) Yes, if the two consumption bundles lie on the same indifference curve.B) Yes, if the second bundle yields more utility than the first.C) No, the first bundle is clearly preferred.D) Not enough information.Answer: ATopic: Cost-of-Living AdjustmentsFor the following, please answer "True" or "False" and explain why.9) Inflation over time necessarily makes consumers worse off.Answer: False. Wages also increase over time. Workers may earn the price of some goods in less time than in the past.Topic: Cost-of-Living Adjustments10) Using the CPI to compensate workers for inflation is appropriate because, in the face of a change in relative prices, people should be allowed to purchase the same bundle as they did before the price changes. Answer: False. This assumes that people would still prefer the original bundle. Because they are facing a new set of relative prices, compensating people so that they could purchase the original bundle will allow them to be able to achieve a higher level of utility than they did before the price changes.Topic: Cost-of-Living Adjustments11) Suppose the typical consumer only purchases food and clothing, and her utility can be expressed as U =F * C. Currently, food costs $5 per unit and clothing costs $2 per unit. Her income is $70. If the price of food increases to $6, compare the resulting Laspyre's price index with a true cost of living index.Answer: Maximizing utility subject to the initial constraint (5F + 2C = 70) yields C/F = 5/2 or F = 7 and C = 17.5. The Laspyre's price index calculates the ratio of the income necessary to achieve the original bundle relative to the original income. In this case [(6 * 7) + (2 * 17.5)]/70 = 1.10. The true cost of living index calculates the ratio of the income necessary to achieve the original level of utility relative to the original income. Utility is held constant when C * F = 17.5 * 7 = 122.5. The consumer is on the new budget line when C/F = 3. Combining yields F = 6.39 and C = 19.17. At the new prices, this requires an income of 76.68 and a resulting cost of living index of 76.68/70 = 1.095.Topic: Cost-of-Living Adjustments。
chap 5 数据与预处理

Goal is to find a projection that captures the largest amount of variation in data
x2 e
x1
Dimensionality Reduction: PCA
Find the eigenvectors of the covariance(协方差) matrix The eigenvectors define the new space
Handling missing values
– – – – Eliminate Data Objects Estimate Missing Values Ignore the Missing Value During Analysis Replace with all possible values (weighted by their probabilities)
Sampling …
The key principle for effective sampling is the following: – using a sample will work almost as well as using the entire data sets, if the sample is representative – A sample is representative if it has approximately the same property (of interest) as the original set of data
Equal frequency
K-means
Euclidean Distance
chap5公差和互换性

二、基本偏差系列
1、基本偏差 靠近零线的偏差。 2、代号及特点 1) 代号:共28个。 2) 它决定了公差带相对于零线的位置,也决定 了配合的性质。 3) 特点: a. 轴 :a-h ,es 绝对值渐小;j-zc :ei 绝对 值渐大。 b. 孔 : A-H ,EI 绝对值渐小;J-ZC :ES 绝 对值渐大。
当不加粗糙度参数值或有关说明时仅适用于简化代号标注基本符号加一小圆表示表面是用不去除材料的方法获得在上述三个符号的长边上均可加一横线用于标注有关说明和参数在上述三个带横线符号上均可加一小圆表示所有表面具有相同的表面粗糙度要求任何方法获得的表面粗糙度ra的上限值为32m
Chap 5 标准化与公差配合
5-1 互换性概述
四、几何量的误差与公差
1. 误差:尺寸,形状,位置,表面粗糙 度。 2. 公差:研究几何量的误差及控制范围, 换言之,公差是允许的最大误差。 3. 区别:误差在加工中产生,而公差是 在设计中给定。
五、标准化
1. 标准的起源 为使工件有互换性,又须滿足设计与制造的要 求就应制定一个标准。 2. 标准化概念 1)所谓标准是指为了在一定的范围内获得最佳 秩序,对活动或其结果规定共同的和重复使用的 规则、导则或特征性的文件。
5-4 形位公差
零件在加工过程中,由于机床、刀具、 夹具误差,装夹方式不正确,以及材料内 应力和热变形等因素的影响,会产生形状 和位置误差,称为形位公差。
一、形状公差
1. 直线度:实际轮廓线或轴线对理想直线所允许 的变动全量。 2. 平面度:实际表面对理想表面所允许的变动全 量。 3. 圆度:指回转体径向截面上实际圆轮廓对理想 圆所允许的变动全量。 4. 圆柱度:实际圆柱面对理想圆柱面所允许的变 动全量。 5. 线轮廓度:实际轮廓线对理想轮廓线所允许的 变动全量。 6. 面轮廓度:实际曲面对理想曲面所允许的变动 全量。
chap5 系统稳定性
a0 a1
a2 a3
a4 a5
其中,第一行为sn、sn-2、sn-4的各项系数依次排成; 第二行为sn-1、sn-3、sn-5的各项系数依次排成
控制原理
14
武汉科技大学机械自动化学院
第五章 控制系统的稳定性
5.2 routh(劳斯)稳定判据
5.2.1 routh行列式
③ 计算行列式的其余各行
s4 s3 s2 s1
30 0
0
改变符号一次
改变符号一次
0
s0
0
第一列各元素改变符号次数为2,不满足充分条件,系统不稳定。 本题的根为-1, 2, 3, -5, 有两个正实部根。 符号的改变次数 = 正实部特征根的个数
控制原理
19
武汉科技大学机械自动化学院
第五章 控制系统的稳定性
例2 设有系统的方框图如图5.2.1所示。已知=0.2, =86.6,试确 定K的值使系统稳定。 解:系统的开环及闭环传递函数分 别为:
18
控制原理
武汉科技大学机械自动化学院
第五章 控制系统的稳定性
例1
系统的特征方程为:
D( s) s4 s3 19 s2 11s 30 0
(1)查必要条件: 各系数符号不同,不满足必要条件,系统不稳定 (2)查Routh表第一列的系数
1 19 1 11 1( 19) (1)(11) 30 30 1 ( 30)(11) (1)(30) 12 0 30 30 0
sn s n 1 s
n2
a0 a1 b1 c1 d1 e1 f1 g1
a2 a3 b2 c2 d2 e2
a4 a5 b3 c3
c1
chap5(成本理论)-课件
出,是生产要素使用量与生产要素价格的积。 ①短期成本函数 ②长期成本函数
10
六、成本函数及其与成本方程的区别
①成本函数:表示一定数量的产品与相应的成本 之间的函数关系。
记为:C = f(Q) ②成本方程:表示厂商的生产成本与生产要素的
15
(二)由短期总产量曲线推导出短期总成本曲线
C
STC
VC
FC Q
16
三、短期总成本和扩展线的图形(P 159)
K
C1
R
A3
A2
C A1
H F’
H’
K0
G
E
F
O
B1 D B2 B3 D1 L
17
二、短期成本
(一)短期成本分类:七个成本 (二)七个成本曲线的综合图 (三)短期成本变动的决定因素:边际报酬递减规律 (四)由总成本曲线到平均成本曲线和边际成本曲线
➢ 显性成本:厂商会计帐上作为成本项目计入帐簿 上的费用。是用来购买(或租用)生产要素的实 际支出。又称为会计成本。
➢ 隐性成本:厂商自己所拥有的并且被用于企业生 产过程的那些生产要素的总价格。或者说,厂商 自己提供的资源所必须支付的费用。该费用应该 支付但并没有实际支出,不反映在帐目上。
※ 从机会成本的角度来理解显性成本和隐性成本
TC
A。 。
B
TVC FC
Q
21
2、AFC、AVC、AC和MC曲线的形状
MC C
MC分别与AC和
AC
AVC曲线相交于
AC和AVC最低点。
AVC AFC
Q
(三)短期成本变动的决定因素 ——边际报酬递减规律
chap_5
64位总线 扩展信号
接口控制
中断信号
支持Cache 的信号
边界扫描 信号
图5.2 PCI总线信号
• •
PCI桥可以利用许多厂家开发的PCI芯片组(PCI set)实现。 通过选择适当的PCI桥构成所需的系统, 是构成PCI系统的一条捷径。
• 例如, 在一台Pentium机中, 可以查到它具有如 下资源: • ·系统设备Intel 82371SB PCI to ISA bridge; • · 系 统 设 备 Intel 82439HX Pentium(r) Processor to PCI bridge; • ·硬盘控制器Intel 82371SB PCI Bus Master IDE Controller。
• 2)ISA (Industry Standard Architecture工业标准体系结构), 是现存最老的通用微机总线类型, 是与286-AT总线一起 引入的。 • 3) MCA (Micro Channel Architecture,微通道体系结构), 是IBM在1987年为PS/2系统机及其兼容机设计的一个理想 的总线, 它代表了总线设计的革命性进步。 • 随着Intel公司推出80386CPU,数据总线由16位增至32位。 内部结构也发生飞跃性进步。CPU处理能力大大提高了。 通过总线与存储器、显示器、I/O设备传送数据速度就显 得很慢了。为了解决低性能总线与高性能CPU之间的矛盾, IBM公司率先在他们设计的一台386微机上,设计了一种 完全不同于ISA总线的微通道体系结构,即MCA总线体系 结构,但其与ISA总线不相兼容。
• 2. USB信号定义 • 在USB 2.0规范中, USB定义了4个信号: VBUS(电源)、 GND(地)、 D+(信号正端)、 D-(信号负端)。
chap5薄壁空间结构
Chap 5 薄壁空间结构n本章主要内容:n1、概述n2、圆顶n3、筒壳n4、折板n5、双曲扁壳n6、双曲抛物面扭壳n7、薄壁空间结构的其他形式n自然界中存在着丰富多彩的壳体结构,如植物的果壳、种子、茎杆等等,以及动物界的蛋壳、蚌壳、蜗牛、脑壳等等。
它们的形态变化万千,曲线优美,且厚度之薄,用料之少,而结构之坚,着实让人惊叹!万灵之首的人类仿生于自然界,又造出了各种各样的壳体结构为自所用,如锅、碗、杯、瓶、坛、罐,以及灯泡、安全帽、轮船、飞机等。
n以上所列种种壳体结构一般是由上下两个几何曲面构成的空间薄壁结构。
两个曲面之间的距离即为壳体的厚度(δ),当δ比壳体其它尺寸(如曲率半径R,跨度l 等)小得多时,称为薄壳结构。
现代建筑工程中所采用的壳体一般为薄壳结构。
n薄壳结构为双向受力的空间结构,在竖向均布荷载作用下,壳体主要承受曲面内的轴向力(双向法向力)和顺剪力作用,曲面轴力和顺剪力都作用在曲面内,又称为薄膜内力。
而只有在非对称荷载(风,雪等)作用下,壳体采承受较小的弯矩和扭矩。
n由于壳体内主要承受以压力为主的薄膜内力,且薄膜内力沿壳体厚度方向均匀分布,所以材料强度能得到充分利用;而且壳体为曲面,处于空间受力状态,各向刚度都较大,因而用薄壳结构能实现以最少之材料构成最坚之结构的理想。
例如6m×6m 的钢筋混凝土双向板,最小厚度需130mm,而35m×35m的双向扁壳屋盖,壳板厚度仅需80mm。
n薄壳的薄膜内力n由于壳体强度高,刚度大,用料省,自重轻;覆盖大面积,无需中柱;而且其造型多变,曲线优美,表现力强,因而深受建筑师们的青睐,故多用于大跨度的建筑物,如展览厅,食堂,剧院,天文馆,厂房,飞机库等。
n不过,薄壳结构也又其自身的不足之处,由于体形多为曲线,复杂多变,采用现浇结构时,模板制作难度大,会费模费工,施工难度较大;一般壳体既作承重结构又作屋面,由于壳壁太薄,隔热保温效果不好;并且某些壳体(如球壳、扁壳)易产生回声现象,对音响效果要求高的大会堂、体育馆、影剧院等建筑不适宜。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
第5章 函数与预处理
3.引用参数 引用参数 • 引用是给一个已知变量起的别名,对引用的操作也 引用是给一个已知变量起的别名, 就是对被它引用的变量的操作 • 引用用来作函数的形参和函数的返回值 • 对引用的改变,起到传址调用的作用,但它比传值调 对引用的改变,起到传址调用的作用, 用更方便、更直接 用更方便、 • C++使用引用作函数的形参来实现在被调函数中改变 C++使用引用作函数的形参来实现在被调函数中改变 调用函数的实参值
第5章 函数与预处理
1.函数是C++的基本特征。 1.函数是C++的基本特征。它封装了一些程序代码和 函数是C++的基本特征 数据,实现了更高级的抽象。 数据,实现了更高级的抽象。 2.函数抽象的实现 2.函数抽象的实现
优点 数据共享; 数据共享; 节省开发时间; 节省开发时间; 增加程序的可靠性; 增加程序的可靠性; 便于管理
第5章 函数与预处理 【例5.2】
#include "iostream.h" void swap(int x,int y) { int temp; temp=x; x=y; y=temp ; } void main() { int a=30,b=40; cout<<"a="<<a<<" b="<<b<<endl; swap(a,b); cout<<"a="<<a<<" b="<<b<<endl; } 结果: 结果: a=30 b=40 a=30 b=40
第5章 函数与预处理
设置函数参数默认值 • 在C++语言中,允许在函数的说明或定义时给一个或多个参数 语言中, 语言中 指定默认值 • 要求在一个指定了默认值的参数的右边,不能出现没有指定 要求在一个指定了默认值的参数的右边, 默认值的参数 例如: 例如: int add_int(int x, int y = 10) // ok int add_int(int x = 10, int y) // wrong • 编译器将按从左到右的顺序将实参与形参结合,当实参的数 编译器将按从左到右的顺序将实参与形参结合, 目不足时, 目不足时,编译器将按同样的顺序用说明中或定义中的默认 值来补足所缺少的实参 例如: 例如: 对于函数声明 int add_int(int x, int y = 10) add_int(15) 与 add_int(15, 10) 是等价的。 是等价的。
第5章 函数与预处理 5.2 函数的调用和参数
C++的函数调用比 更加丰富。C++不仅有传值调用(包 的函数调用比C更加丰富。 不仅有传值调用( 的函数调用比 更加丰富 不仅有传值调用 含传变量地址值的传址调用),而且还有C语言中没有的引 ),而且还有 含传变量地址值的传址调用),而且还有 语言中没有的引 用调用。另外, 中还允许设置形参的缺省值等。 用调用。另外,C++中还允许设置形参的缺省值等。 中还允许设置形参2.2 函数的参数
C++可以用 种方式将函数的形参分别声明为值参数、 可以用3种方式将函数的形参分别声明为值参数 可以用 种方式将函数的形参分别声明为值参数、 地址参数和引用参数。 地址参数和引用参数。 1. 值参数 使用传值调用方式时,调用函数的实参用常量、 使用传值调用方式时,调用函数的实参用常量、变量值 或表达式值,被调用函数的形参用变量。 或表达式值,被调用函数的形参用变量。在实参向形参传 递参数时采用的策略是直接将实参的值复制给形参,这种 给形参, 传递方式称为值传递,相应的函数调用方式称为值调用
第5章 函数与预处理
教学目标
掌握函数的定义格式和函数的原型声明方法 掌握函数的调用方法以及形式参数和实际参 数之间的关系 掌握函数的嵌套和递归调用使用方法 掌握内联函数和函数重载的使用方法 了解函数的作用域与生命期 了解编译预处理的基本原理和使用方法
第5章 函数与预处理
教学内容
5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 函数的定义 函数的调用和参数 函数的嵌套和递归调用 内联函数和重载函数 内联函数和重载函数 作用域与生命期 编译预处理 实例分析 本章小结
第5章 函数与预处理 【例5.4】
#include "iostream.h" void swap(int &x,int &y) { int temp; temp=x; x=y; y=temp ; } void main() { int a=30,b=40; cout<<"a="<<a<<" b="<<b<<endl; swap(a,b); cout<<"a="<<a<<" b="<<b<<endl; } 结果: 结果 a=30 b=40 a=40 b=30
第5章 函数与预处理
关于函数调用的几点说明 • 定义函数时的参数称为形式参数或形参,与之对应,调用 定义函数时的参数称为形式参数或形参,与之对应, 函数时的参数称为实际参数或称实参 • 函数可以不带任何实参,但是如果有,就必须要与函数定 函数可以不带任何实参,但是如果有, 义时形参的个数及类型完全一致。 义时形参的个数及类型完全一致。 • 以函数在程序中的出现位置和形式来看,函数的调用方式 以函数在程序中的出现位置和形式来看, 可分为3种 可分为 种。 1. 函数调用作为独立语句。如:showcolor(); 函数调用作为独立语句。 2.函数调用作为作为表达式的一部分,如:n=max(a,b); 函数调用作为作为表达式的一部分, 函数调用作为作为表达式的一部分 3.函数调用以实参形式出现在被调用的函数中,如: 函数调用以实参形式出现在被调用的函数中, 函数调用以实参形式出现在被调用的函数中 n=min(max(a,b),c);
第5章 函数与预处理
关于函数声明的几点说明
• 一个完整的程序中,函数的定义和函数的调用可以在同一个程序文件中, 一个完整的程序中,函数的定义和函数的调用可以在同一个程序文件中, 也可以处在不同的程序文件中, 也可以处在不同的程序文件中, 但必须确保函数声明语句与函数调用表 达式出现在同一个文件中,而且函数声明语句出现在前,函数调用语句 达式出现在同一个文件中,而且函数声明语句出现在前, 出现在后。 出现在后。 • 当一个函数要被一个文件中的多个函数调用时,必须将该函数声明写在 当一个函数要被一个文件中的多个函数调用时, 所有函数之前。 所有函数之前。 • 虽然函数声明和函数头相似,但是它们之间也有细微的差别,尤其是函 虽然函数声明和函数头相似,但是它们之间也有细微的差别, 数声明是一条语句,末尾需要分号。 数声明是一条语句,末尾需要分号。 • 在函数声明的形参表中不能只写参数名而不写类型名,但是可一只写类 在函数声明的形参表中不能只写参数名而不写类型名, 型名而不写形参名。 型名而不写形参名。 • 由于函数调用时是按参数顺序进行传递的,所以函数声明中参数的次序 由于函数调用时是按参数顺序进行传递的, 不要写错。 不要写错。 • 如果被调用函数其定义位于主调函数之前,则可以省略别调用函数的原 如果被调用函数其定义位于主调函数之前, 型声明。 型声明。
5.2.1 函数的调用
调用格式: 调用格式:
<函数名 实参表 函数名>(<实参表 实参表>) 函数名
1. <实参表 :用来在调用函数时给形参初始 实参表>: 实参表 化的。 化的。 2. 返回语句 :——返回程序执行的控制权 返回程序执行的控制权 return <表达式 ; 表达式>; 表达式 return; 返回空,可以不写。 返回空,可以不写。
第5章 函数与预处理 【例5.1】
#include "iostream.h" void ShowGrade(char name[],float score); main() { char studentName[10]; float mathScore; cout<<"please input the name and his/her math score!"<<endl; cin>>studentName>>mathScore; ShowGrade(studentName,mathScore); return 0;} void ShowGrade(char name[],float score) { if (score>100 || score<0) cout<<"You inputted a wrong score!\n"; else if (score>=90) cout<<"Grade of "<<name<<"for math is A ."<<endl; else if (score>=80) cout<<"Grade of "<<name<<"for math is B ."<<endl; else if (score>=70) cout<<"Grade of "<<name<<"for math is C ."<<endl; else if (score>=60) cout<<"Grade of "<<name<<"for math is D ."<<endl; else cout<<"Grade of "<<name<<"for math is E ."<<endl;}