text:
# MusE GAs FLOw and Wind (MEGAFLOW) I: First MUSE results on background quasars

Authors
Type
Preprint
Publication Date
May 11, 2016
Submission Date
May 11, 2016
Identifiers
arXiv ID: 1605.03412
Source
arXiv
The physical properties of galactic winds are one of the keys to understand galaxy formation and evolution. These properties can be constrained thanks to background quasar lines of sight (LOS) passing near star-forming galaxies (SFGs). We present the first results of the MusE GAs FLOw and Wind (MEGAFLOW) survey obtained of 2 quasar fields which have 8 MgII absorbers of which 3 have rest-equivalent width greater than 0.8 \AA. With the new Multi Unit Spectroscopic Explorer (MUSE) spectrograph on the Very Large Telescope (VLT), we detect 6 (75$\%$) MgII host galaxy candidates withing a radius of 30 arcsec from the quasar LOS. Out of these 6 galaxy--quasar pairs, from geometrical arguments, one is likely probing galactic outflows, two are classified as "ambiguous", two are likely probing extended gaseous disks and one pair seems to be a merger. We focus on the wind$-$pair and constrain the outflow using a high resolution quasar spectra from Ultraviolet and Visual Echelle Spectrograph (UVES). Assuming the metal absorption to be due to gas flowing out of the detected galaxy through a cone along the minor axis, we find outflow velocities of the order of $\approx$ 150 km/s (i.e. smaller than the escape velocity) with a loading factor, $\eta =\dot M_{\rm out}/$SFR, of $\approx$ 0.7. We see evidence for an open conical flow, with a low-density inner core. In the future, MUSE will provide us with about 80 multiple galaxy$-$quasar pairs in two dozen fields.


text:
3D PrintingAnycubic Photon Users (+other SLA's?)

Help Support The Rocketry Forum:

vcp

Well-Known Member
TRF Supporter
So I know that there are at least a couple of other Photon users on TRF. I've bought one and have it sitting here, but haven't even plugged it in yet. So many questions, and years of FDM printing experience don't seem to apply much. I know there's a Photon group on Facebook, and I've gotten a lot of information off there, but it's such a crapshoot; sometimes conflicting advice. I'd like to connect here with folks that are using resin printers for the same sort of stuff that I'm doing. Here's a bunch of topics, what I know about them, and what I don't:

RESINS

• Aside from what came with the printer, I have no clue.
• I did see a Facebook thread recommending mixing between 1-20% of flexible resin into your regular resin to reduce brittleness, but there was no consensus on the percentage or brand.
• Pre-heating the resin in a warm-water bath?
• Gentle shaking/mixing of the resin is recommended before use. How come there is no nutating mixer on Thingiverse? Google - there is one here, maybe? Wait, that's cool, you have to sign up to the service there to get the paper on it, but that's easy. Just a couple of parts from Amazon, and print it up - alter or make a new platform to fit a resin bottle.
PRINT CLEANING/CURING

Yes, I saw the Prusa CW-1; way out of my $$range. I've seen lots of recommendations, here's what I'm moving towards: • 'Dirty' IPA wash. • 'Clean' IPA wash. • Soft brush. • Hot water rinse. • Support removal. • Soft brush. • Air blast - just a shot with an air brush compressor. • UV cure - now I see that a heated cure is sometimes recommended. Too much? Someting else? • I bought a set of canisters to use as wash/rinse stations. They're about the perfect size, but I don't yet know if they're suitable for IPA. • Thinking of doing something like this, but I'd have to resize it for the canisters I've got (the ones in that Thing are in the UK). • I did get this mixer. • Where would be a good local source for IPA? WalMart and pharmacies seem way$$.

TOOLS
• Sprue cutter for support removal. I already have several of these for wire cutting.
• Gloves. I understand that nitrile is recommended but I already buy vinyl gloves 1000 at a time for other uses. I haven't seen anything that specifically recommends against vinyl.
• Spatula. I just have what came with the Photon. Wondering if a Cricut spatula would be good; I have one here somewhere.
• Need to find a soft brush - I hear that a toothbrush can be too hard.

PRINTED ACCESSORIES
These are some of the things I've FDM printed or plan to print off of Thingiverse for the Photon. I've collected these things and other stuff here.
• Vat drain tower. I've printed this and it actually looks like it might be practical; we'll see.
• Build plate 'drip-off' bracket. There are several of these and this appears to be the simplest. Looks useful.
• Resin funnel. I haven't found one of these I like that looks like it would work well with the drain tower. I may make up my own.
• Switch protector. I hate the way the USB thumbdrive sticks out the side ready to be knocked off. This should help.
• Leveling gadget. No idea if this is useful but there are several on Thingiverse.
• Vat cover.
• Vat box.
• There are several air filtering upgrades for Anycubics. I haven't looked at them closely and don't know if anything will be needed for the Photon S - its filtering is supposed to be better than the Photon.
• Photon door handle. Yeah, it needs one.
• FEP replacement tool. Stupid simple, maybe useful.
OTHER ACCESSORIES
• I bought a pack of these LCD screen gaskets after seeing reports of resin leaks on Facebook.
• FEP film. All I have is what came with the printer.

SLICING
I guess most people don't bother with the Anycubic slicer; Chitubox seems to be recommended. I haven't looked at it at all yet, but I notice that there's some user's guide videos on Youtube. I also came across a video that recommended using the Prusaslicer as a better way to add supports, then exporting the .stl into Chitubox for slicing.
CURING
I got one of these UV lamps - need to make up some sort of box for it; maybe heated?

RCBrust

Well-Known Member
These inexpensive resin printers are pretty cool. There are a lot of impressive videos of the Anycubic and Elegoo units on YT, however, they all seem to be printing figurines instead of mechanical parts. They seem extremely precise, but I'm curious to see what kind of dimensional accuracy you can get out of them.

Gary, do you plan on trying any of the water soluble resins?

Randy

BDB

Absent Minded Professor
The biggest thing you are forgetting is something to deal with the smell. There are lots of mods on Thingiverse. I haven't used my Photon in nearly a month because I need to build a heated and ventilated enclosure for mine. There are some resins that don't smell, but my favorite thus far, Sirya Blu, stinks up my basement and it works best at warm temperatures.

vcp

Well-Known Member
TRF Supporter
Ok, finally got the Photon S set up for use. First had to update the firmware from the Anycubic website and that went smoothly. Next, I installed one of these gaskets under the vat, that is supposed to protect against vat leaks messing up the printer. Looks like it should work well, but they need to improve the installation instructions - it's difficult to get it on straight and smooth.

Tramming the build plate (I dislike the misnomer 'leveling') was straightforward.
I just ran the sample print that came with the printer, and, it came out perfect. I was using the Anycubic green that came with the printer, and the smell was... almost imperceptible. I could only smell it if I was sitting directly in front of the printer. I didn't notice it anywhere else in the small closed room. My wife couldn't smell it, and the cat didn't seem to mind. The IPA was much more obtrusive, but I don't plan to use that in the future. (Yes, I understand that other resins will be much worse.)

The prep for printing was no mess at all, just pour the resin into the vat. After the sample print, I'm not planning to print again until I have some subjects ready in a few days, so I decided to do a full cleanup and drain the vat. The only mistake I made there was that I hadn't printed a funnel for the bottle yet, and the paper filter cone overflowed (just because I poured too fast), but that just went onto the vat drain tower. Cleaning up that overflow was probably 80% of the cleanup process and shouldn't happen again. The drip-off bar for the build plate worked well and the plate was easy to clean. The vat was easy to clean after it had drained on the tower and the FEP looks pristine.

The print spent a few minutes in IPA on the magnetic mixer, and a few more in water on the mixer; then a few minutes in a makeshift UV cure box. I'll get a decent UV box put together soon, and I've got an ultrasonic cleaner on the way that I'll use with Mean Green instead of IPA.

True, I didn't have to deal with figuring out supports/drains/slicing or exposure times with this simple sample print, but overall, the process was much less complex and messy than I had expected.

manixFan

Not a rocket scientist
...<snipped>...True, I didn't have to deal with figuring out supports/drains/slicing or exposure times with this simple sample print, but overall, the process was much less complex and messy than I had expected.
Hmm, well for my son that was the hardest part. It's not a trivial exercise figuring out where to place supports and at what angle to print a piece. Unlike filament 3D printers, you can rarely print a part flat on the printer bed. And you have to be aware of the 'fluid dynamics' of the resin as the part lowers and raises in and out of the resin vat. But the detail is amazing once you get the hang of it.

I highly recommend watching several youtube videos on placing supports. My son uses Chitubox, which I think is pretty standard. The other interesting thing is that there is no time penalty for printing as many parts as possible at the same time, as long as they are roughly the same height. So it does have some time economies that filament printers don't have.

Tony

Charles_McG

Ciderwright
Does anyone put a water scavenging molecular sieve or an oxygen sink in the resin during storage?

BDB

Absent Minded Professor
Does anyone put a water scavenging molecular sieve or an oxygen sink in the resin during storage?
Not that I know of, but that’s a really good idea.

Thus far, I haven’t had an issue with resins going bad. But I’ve only had my printer for 5 months, and the resin has been stored in my basement at 60-65 deg F.

DanSavage

New Member
Hi All!

My first post in this forum. I bought my Photon printer several months ago. I got it to prototype parts that I sell on Shapeways.com.

I've used my printer for model airplane parts and for guitar parts, specifically a new design for Ovation guitar saddle and a jig/fixture for assembling Ovation rosettes.

I'm currently working on a static display stand for the Estes 1/35-scale Mercury Redstone. I'm attaching a screen shot of what I've got done so far.

I'm also passing along a link to a Google Doc page that is an aggregation site for peoples' experiences using different brands of resin with this printer.

Edit: Oops! I thought I was going to pass along the URL, but the forum is interpreting the link as being spam.

Dan

format: plain


text:
# Energy of orbitals under a crystal field

It is shown in octahedral crystal field splitting that both the $e_g$ orbitals have equal energy. But how can that be possible ?

The $d_{x^2-y^2}$ is directed along both the axes (x and y) whereas the $d_{z^2}$ is directed along only the z-axis, shouldn't the later have less energy than the former ?

• You envisioned the orbitals wrong. For example see: chemed.chem.purdue.edu/genchem/topicreview/bp/ch12/…
– MaxW
Mar 6, 2016 at 6:57
• @MaxW I have read what is given in the link, but couldn't find where I am wrong. Would be helpful if you can point out. Mar 7, 2016 at 15:08

The next complicated answer on the road from over-simplified to reality is that the $\mathrm{d_{z^2}}$ extends to both ligands, too: Do not forget the ‘ring’ in the $xy$ plane. By extending towards the ligands on the $z$ axis further than the $\mathrm{d_{x^2 - y^2}}$ orbitals do to their ligands, it is less stabilised than it looks, and the interaction with the equatorial ligands also destabilises.
The really sophisticated and probably most correct answer is that we generally have a wrong view of those two orbitals. They are mathematically equivalent and would actually form a group of three: $\mathrm{d_{x^2 - y^2}}$, $\mathrm{d_{z^2 - x^2}}$ and $\mathrm{d_{y^2 - z^2}}$ — but because we can only have two, wee need to add two together and commonly take the two that give ‘$\mathrm{d_{z^2}}$’. In some images of molecular orbitals you can see that they are much more identical than they initially look.


text:
# Thermal Conductivity Paper Database

Search academic papers below:

## Recommended Papers for: Heat flow meter apparatus

Total Papers Found: 1

#### Thermal Conductivity of Moist Autoclaved Aerated Concrete: Experimental Comparison Between Heat Flow Method (HFM) and Transient Plane Source Technique (TPS)

When testing the thermal conductivity of moist specimens, an analysis of heat and mass transfer must be conducted. Thermal conductivity measurements require a temperature gradient within the sample, however when measuring moist materials, the temperature gradient causes the moisture to be transported and dispersed within ...

Author(s):


text:
经济代写|宏观经济学代写Macroeconomics代考|EC4505

statistics-lab™ 为您的留学生涯保驾护航 在代写宏观经济学Macroeconomics方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写宏观经济学Macroeconomics代写方面经验极为丰富，各种代写宏观经济学Macroeconomics相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

经济代写|宏观经济学代写Macroeconomics代考|The decentralized equilibrium

Here we present a discrete time model initially developed by Diamond (1965), building on earlier work by Samuelson (1958), in which individuals live for two periods (young and old). The economy lasts forever as new young people enter in every period. We first characterise the decentralised competitive equilibrium of the model. We then ask whether the market solution is the same as the allocation that would be chosen by a central planner, focusing on the significance of the golden rule, which will allow us to discuss the possibility of dynamic inefficiency (i.e. excessive capital accumulation).

The market economy is composed of individuals and firms. Individuals live for two periods. They work for firms, receiving a wage. They also lend their savings to firms, receiving a rental rate.
An individual born at time $t$ consumes $c_{1 t}$ in period $t$ and $c_{2 t+1}$ in period $t+1$, and derives utility
$$\left(\frac{\sigma}{\sigma-1}\right) c_{1 \mathrm{t}}^{\frac{\sigma-1}{\sigma}}+(1+\rho)^{-1}\left(\frac{\sigma}{\sigma-1}\right) c_{2 f+1}^{\frac{\sigma-1}{\sigma}}, \rho \geq 0, \sigma \geq 0 .$$
Note that the subscript ” 1 ” refers to consumption when young, and ” 2 ” labels consumption when old. Individuals work only in the first period of life, inelastically supplying one unit of labour and earning a real wage of $w_t$. They consume part of their first-period income and save the rest to finance their second-period retirement consumption. The saving of the young in period $t$ generates the capital stock that is used to produce output in period $t+1$ in combination with the labour supplied by the young generation of period $t+1$.
The time structure of the model appears in Figure 8.1.
The number of individuals born at time $t$ and working in period $t$ is $L_t$. Population grows at rate $n$ so that $L_t=L_0(1+n)^t$.

经济代写|宏观经济学代写Macroeconomics代考|Individuals

Consider an individual born at time $t$. His maximisation problem is
$$\max \left{\left(\frac{\sigma}{\sigma-1}\right) c_{1 t}^{\frac{\sigma-1}{\sigma}}+(1+\rho)^{-1}\left(\frac{\sigma}{\sigma-1}\right) c_{2 t+1}^{\frac{\sigma-1}{\sigma}}\right}$$
subject to
$$c_{1 t}+s_t=w_t,$$
$$c_{2 t+1}=\left(1+r_{t+1}\right) s_t,$$
where $w_t$ is the wage received in period $t$ and $r_{t+1}$ is the interest rate paid on savings held from period $t$ to period $t+1$. In the second period the individual consumes all his wealth, both interest and principal. (Note that this assumes that there is no altruism across generations, in that people do not care about leaving bequests to the coming generations. This is crucial.)
The first-order condition for a maximum is
$$c_{1 t}^{-\frac{1}{\sigma}}-\left(\frac{1+r_{t+1}}{1+\rho}\right) c_{2 t+1}^{-\frac{1}{\sigma}}=0,$$
which can be rewritten as
$$\frac{c_{2 t+1}}{c_{1 t}}=\left(\frac{1+r_{t+1}}{1+\rho}\right)^\sigma \text {. }$$
This is the Euler equation for the generation born at time $t$. Note that this has the very same intuition, in discrete time, as the Euler equation (Ramsey rule) we derived in the context of the NGM.
Next, using (8.3) and (8.4) to substitute out for $c_{1 t}$ and $c_{2 t+1}$ and rearranging we get
$$s_t=\left(\frac{1}{\left(1+r_{t+1}\right)^{1-\sigma}(1+\rho)^\sigma+1}\right) w_t .$$
We can think of this as a saving function:
$$s_t=s\left(w_t, r_{t+1}\right), \quad 0<s_w \equiv \frac{\partial s_t}{\partial w_t}<1, s_r \equiv \frac{\partial s_t}{\partial r_{t+1}} \geq 0 \text { or } \leq 0 .$$
Saving is an increasing function of wage income since the assumption of separability and concavity of the utility function ensures that both goods (i.e. consumption in both periods) are normal. The effect of an increase in the interest rate is ambiguous, however, because of the standard income and substitution effects with which you are familiar from micro theory. An increase in the interest rate decreases the relative price of second-period consumption, leading individuals to shift consumption from the first to the second period, that is, to substitute second- for first-period consumption. But it also increases the feasible consumption set, making it possible to increase consumption in both periods; this is the income effect. The net effect of these substitution and income effects is ambiguous. If the elasticity of substitution between consumption in both periods is greater than one, then in this two-period model the substitution effect dominates and an increase in interest rates leads to an increase in saving.

经济代写|宏观经济学代写宏观经济学代考|分散均衡

$$\left(\frac{\sigma}{\sigma-1}\right) c_{1 \mathrm{t}}^{\frac{\sigma-1}{\sigma}}+(1+\rho)^{-1}\left(\frac{\sigma}{\sigma-1}\right) c_{2 f+1}^{\frac{\sigma-1}{\sigma}}, \rho \geq 0, \sigma \geq 0 .$$

经济代写|宏观经济学代写宏观经济学代考|个人

$$\max \left{\left(\frac{\sigma}{\sigma-1}\right) c_{1 t}^{\frac{\sigma-1}{\sigma}}+(1+\rho)^{-1}\left(\frac{\sigma}{\sigma-1}\right) c_{2 t+1}^{\frac{\sigma-1}{\sigma}}\right}$$

$$c_{1 t}+s_t=w_t,$$
$$c_{2 t+1}=\left(1+r_{t+1}\right) s_t,$$
，其中$w_t$是在$t$期间收到的工资，$r_{t+1}$是在$t$至$t+1$期间持有的储蓄支付的利率。在第二阶段，个人消费他所有的财富，包括利息和本金。(请注意，这是假设没有跨代的利他主义，即人们不关心给下一代留下遗产。

$$c_{1 t}^{-\frac{1}{\sigma}}-\left(\frac{1+r_{t+1}}{1+\rho}\right) c_{2 t+1}^{-\frac{1}{\sigma}}=0,$$
，可以改写为
$$\frac{c_{2 t+1}}{c_{1 t}}=\left(\frac{1+r_{t+1}}{1+\rho}\right)^\sigma \text {. }$$

$$s_t=\left(\frac{1}{\left(1+r_{t+1}\right)^{1-\sigma}(1+\rho)^\sigma+1}\right) w_t .$$

$$s_t=s\left(w_t, r_{t+1}\right), \quad 0<s_w \equiv \frac{\partial s_t}{\partial w_t}<1, s_r \equiv \frac{\partial s_t}{\partial r_{t+1}} \geq 0 \text { or } \leq 0 .$$

有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。

经济代写|宏观经济学代写Macroeconomics代考|ECON6002

statistics-lab™ 为您的留学生涯保驾护航 在代写宏观经济学Macroeconomics方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写宏观经济学Macroeconomics代写方面经验极为丰富，各种代写宏观经济学Macroeconomics相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

经济代写|宏观经济学代写Macroeconomics代考|Institutions

Last but not least, there is the view that institutions are a fundamental source of economic growth. This idea also has an old pedigree in economics, but in modern times it has been mostly associated, in its beginnings, with the work of Douglass North (who won the Nobel Prize for his work), and more recently with scholars such as Daron Acemoglu and James Robinson. From the very beginning, here is the million-dollar question: what do we mean by institutions?

North’s famous characterisation is that institutions are “the rules of the game” in a society, “the humanly devised constraints that shape human interaction” (North (1990), p. 3). Here are the key elements of his argument:

• Humanly devised: Unlike geography, institutions are chosen by groups of human beings.
• Constraints: Institutions are about placing constraints on human behaviour. Once a rule is imposed, there is a cost to breaking it.
• Shape interactions: Institutions affect incentives.
OK, fair enough. But here is the real question: What exactly do we mean by institutions? A first stab at this question is to follow the Acemoglu et al. (2005) distinctions between economic and political institutions, and between de facto and de jure institutions.

The first distinction is as follows. Economic institutions are those that directly affect the economic incentives: property rights, the presence and shape of market interactions, and regulations. They are obviously important for economic growth, as they constitute the set of incentives for accumulation and technological progress. Political institutions are those that configure the process by which society makes choices: electoral systems, constitutions, the nature of political regimes, the allocation of political power etc. There is clearly an intimate connection between those two types, as political power affects the economic rules that will prevail.

The second distinction is just as important, having to do with formal vs informal rules. For instance, the law may state that all citizens have the right to vote, but in practice it might be that certain groups can have enough resources (military or otherwise) to intimidate or influence others, thereby constraining their right in practice. Formal rules, the de jure institutions, are never enough to fully characterise the rules of the game; the informal, de facto rules must be taken into consideration.

These distinctions help us structure the concepts, but we also hit the same issue that plagues the cultural explanations: since institutions are made by people, we need to understand where they come from, and how they come about. Acemoglu et al. (2005) is a great starting point to survey this literature, and (Acemoglu and Robinson 2012) provides an extremely readable overview of the ideas.

经济代写|宏观经济学代写Macroeconomics代考|What have we learned

When it comes to the proximate causes of growth, in spite of the limitations of each specific empirical approach – growth accounting, regression methods, and calibration – the message from the data is reasonably clear, yet nuanced: factor accumulation can arguably explain a substantial amount of income differences, and specific growth episodes, but ultimately differences in productivity are very important. This is a bit daunting, since the fact is that we don’t really understand what productivity is, in a deeper sense. Still, it underscores the importance of the process of technological progress – and the policy issues raised in Chapter 6 – as a primary locus for growth policies.

How about the fundamental causes? There is certainly a role for geography and luck (multiple equilibria), but our reading of the literature is that culture and institutions play a key part. There remains a lot to be learned about how these things evolve, and how they affect outcomes, and these are bound to be active areas of research for the foreseeable future.

Once again, the growth textbook by Acemoglu (2009) is a superb resource, and it contains a more in-depth discussion of the empirical literature on the proximate causes of growth. It also has a very interesting discussion on the fundamental causes, but it’s useful to keep in mind that, its author being one of the leading proponents of the view that institutions matter most, it certainly comes at that debate from that specific point of view.

Specifically on culture, the best places to go next are the survey articles we mentioned in our discussion. The survey by Guiso et al. (2006) is a bit outdated, of course, but still a great starting point. The more recent surveys by Alesina and Giuliano (2015), focusing particularly on the links between culture and institutions, and by Nunn (2020), focusing on the work using historical data, are very good guides to where the literature is and is going.

On institutions, there is no better place to go next than the books by Acemoglu and Robinson (2012) and Acemoglu and Robinson (2019). They are very ambitious intellectual exercises, encompassing theory, history, and empirical evidence, and meant for a broad audience – which makes them a fun and engaging read.

These being very active research fields, there are a lot of questions that remain open. Anyone interested in the social sciences, as the readers of this book most likely are, will find a lot of food for thought in these sources.

有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。

经济代写|宏观经济学代写Macroeconomics代考|ECOS3007

statistics-lab™ 为您的留学生涯保驾护航 在代写宏观经济学Macroeconomics方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写宏观经济学Macroeconomics代写方面经验极为丰富，各种代写宏观经济学Macroeconomics相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

经济代写|宏观经济学代写Macroeconomics代考|Geography

This is somewhat related to the luck hypothesis, but certainly distinctive: perhaps the deepest source of heterogeneity between countries is the natural environment they happened to be endowed with. From a very big picture perspective, geographical happenstance of this sort is a very plausible candidate for a determinant of broad development paths, as argued for instance by Jarred Diamond in his 1999 Pulitzer-Prize-winning book Guns, Germs and Steel ${ }^8$. As an example, Diamond suggests that one key reason Europe conquered America, and not the other way around, was that Europe had an endowment of big animal species that were relatively easy to domesticate, which in turn led to improved immunisation by humans exposed to animal-borne diseases, and more technological advances. But can geography also explain differences in economic performance at the scale on which we usually think about them, say between different countries over decades or even a couple of centuries?

On some level, it is hard to think that the natural environment would not affect economic performance, on any time frame. Whether a country is in the middle of the Sahara desert, the Amazon rain forest, or some temperate climate zone must make some difference for the set of economic opportunities that it faces. This idea becomes more compelling when we look at the correlation between certain geographical variables and economic performance, as illustrated by the Figure (7.2), again taken from Acemoglu (2009). It is clear from that picture that countries that are closer to the equator are poorer on average. At the very least, any explanation for economic performance would have to be consistent with this stylised fact. The question, once again, is to assess to what extent these geographical differences underlie the ultimate performance, and this is not an easy empirical question.

Let us start by considering the possible conceptual arguments. The earliest version of the geography hypothesis has to do with the effect of the climate on the effort – the old idea that hot climates are not conducive to hard work. While this seems very naive (and not too politically correct) to our 21 st century ears, the idea that climate (and geography more broadly) affects technological productivity, especially in agriculture, still sounds very plausible. If these initial differences in turn condition subsequent technological progress (as argued by Jared Diamond, as we have seen, and as we will see, in different forms, by Jeffrey Sachs), it just might be that geography is the ultimate determinant of the divergence between societies over the very long run.

A big issue with this modern version of the geography hypothesis is that it is much more appealing to think of geography affecting agricultural productivity, but modern growth seems to have a lot more to do with industrialisation. While productivity in agriculture might have conditioned the development of industry to begin with, once industrial technologies are developed we would have to explain why they are not adopted by some countries. Geography is probably not enough to account for that, at least in this version of the story.

经济代写|宏观经济学代写Macroeconomics代考|Culture

What do we mean by culture? The standard definition used by economists, as spelled out by Guiso et al. (2006), refers to “those customary beliefs and values that ethnic, religious, and social groups transmit fairly unchanged from generation to generation” (p. 23). In other words, culture is something that lives inside people’s heads – as opposed to being external to them – but it is not something idiosyncratic to individuals; it is built and, importantly, transmitted at the level of groups.

It is hard to argue against the assertion that people’s beliefs, values, and attitudes affect their economic decisions. It is just as clear that those beliefs, values and attitudes vary across countries (and over time). From this it is easy to conclude that culture matters for economic performance, an argument that goes back at least to Max Weber’s thesis that Protestant beliefs and values, emphasising hard work and thrift, and with a positive view of wealth accumulation as a signal of God’s grace, were an important factor behind the development of capitalism and the modern industrial development. In his words, the “Protestant ethic” lies behind the “spirit of capitalism”.

Other arguments in the same vein have suggested that certain cultural traits are more conducive to economic growth than others (David Landes is a particularly prominent proponent of this view, as in Landes (1998)), and the distribution of those traits across countries is the key variable to ultimately understand growth. “Anglo-Saxon” values are growth-promoting, compared to “Latin” or “Asian” values, and so on. More recently, Joel Mokyr (2018) has argued that Enlightenment culture was the key driving force behind the emergence of the Industrial Revolution in Europe, and hence of the so-called “Great Divergence” between that continent and the rest of the world.

A number of issues arise with such explanations. First, culture is hard to measure, and as such may lead us into the realm of tautology. A country is rich because of its favourable culture, and a favourable culture is defined as that which is held by rich countries. This doesn’t get us very far in understanding the causes of good economic performance. This circularity is particularly disturbing when the same set of values (say, Confucianism) is considered inimical to growth when Asian countries perform poorly, and suddenly becomes growth-enhancing when the same countries perform well. Second, even if culture is indeed an important causal determinant of growth, we still need to figure out where it comes from if we are to consider implications for policy and predictions for future outcomes.

These empirical and conceptual challenges have now been addressed more systematically, as better data on cultural attitudes have emerged. With such data, a vibrant literature has emerged, with economists developing theories and testing their predictions on the role that specific types of values (as opposed to a generic “culture” umbrella) play in determining economic performance. Many different types of cultural attitudes have been investigated: trust, collectivism, gender roles, beliefs about fairness, etc. This literature has often exploited historical episodes – the slave trade, the formation of medieval self-governing cities, colonisation, immigration, recessions – and specific cultural practices – religious rites, civic festivities, family arrangements – to shed light on the evolution of cultural attitudes and their impact on economic outcomes. Our assessment is that this avenue of research has already borne a lot of fruit, and remains very promising for the future. (For an overview of this literature, see the surveys by Guiso et al. (2006), Alesina and Giuliano (2015), and Nunn (2020).

有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。

经济代写|宏观经济学代写Macroeconomics代考|ECON1120

statistics-lab™ 为您的留学生涯保驾护航 在代写宏观经济学Macroeconomics方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写宏观经济学Macroeconomics代写方面经验极为丰富，各种代写宏观经济学Macroeconomics相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

经济代写|宏观经济学代写Macroeconomics代考|Balanced growth path

You will recall that a BGP is a situation where all variables grow at a constant rate. From (5.12) and (5.13) (and in the absence of technological progress), we see that constant $\gamma_k$ and $\gamma_h$ require, respectively ${ }^2$,
$$\begin{gathered} (\alpha-1) \gamma_k+\beta \gamma_h=0 \ \alpha \gamma_k+(\beta-1) \gamma_h=0 . \end{gathered}$$
Substituting the second equation into the first equation yields
$$\frac{1-\alpha-\beta}{1-\beta} \gamma_k=0 .$$
But given CRS, we have assumed that $\alpha+\beta<1$, so we must have $\gamma_k=\gamma_h=0$. In other words, just as before, without technical progress ( $A$ constant), this model features constant per-capita capital $k$ and constant per-capita human capital $h$. No growth again! Of course, we can obtain long-run growth again by assuming exogenous (labour-augmenting) technological progress, $\frac{A}{A}=g$. Consider a BGP in which $\frac{k}{k}$ and $\frac{h}{h}$ are constant over time. From (5.12) and (5.13), this requires that $\frac{k}{y}$ and $\frac{h}{y}$ be constant over time. Consequently, if a BGP exists, $y, k$, and $h$, must all be increasing at the same rate. When the production function exhibits CRS, this BGP can be achieved by setting $\frac{\dot{y}}{y}=\frac{k}{k}=\frac{h}{h}=g^3$ The longrun growth rate is thus independent of $s_k, s_h, n$ or anything that policy affects, unless $g$ is endogenised somehow. (But again, long-run levels of income do depend on these behavioural parameters.)

经济代写|宏观经济学代写Macroeconomics代考|Still looking for endogenous growth

Why is the long-run growth rate still pinned down by the exogenous rate of technological growth as in the Solow Model? CRS implies that the marginal products of $K$ and $H$ decline as these factors accumulate, tending to hring growth rates down. Morenver, Cohh-Douglas production functions satisfy the Inada conditions so that, in the limit, these marginal products asymptotically go to 0 . In other words, CRS still keeps us in the domain of diminishing returns to capital accumulation, regardless of the fact that we have introduced human capital!

How can we change the model to make long-run growth rates endogenous (i.e., potentially responsive to policy)? You should see immediately from (5.16) that there is a possibility for a BGP, with $\gamma_k$ and $\gamma_h$ different from zero: if $\alpha+\beta=1$. That is to say, if we have constant returns to capital and human capital, the reproducible factors, taken together.
It is easy to see, from (5.12) and (5.13), that in a BGP we must have
$$\frac{\dot{k}}{k}=\frac{\dot{h}}{h} \longrightarrow \frac{k^}{h^}=\frac{s_k}{s_h} .$$

In other words, in a BGP $k$ and $h$ must grow at the same rate. This is possible since diminishing returns does not set in to either factor $(\alpha+\beta=1)$. What rate of growth is this? Using (5.17) in (5.12) and (5.13) we obtain (normalizing $A=1$ for simplicity)
$$\frac{\dot{k}}{k}=\frac{\dot{h}}{h}=s_h\left(\frac{s_k}{s_h}\right)^a-(\delta+n)=s_k^a s_h^{1-\alpha}-(\delta+n) .$$
The long-run (BGP) growth rate of output is
$$\frac{\dot{y}}{y}=\alpha \frac{\dot{k}}{k}+(1-\alpha) \frac{\dot{h}}{h}=s_k^a s_h^{1-\alpha}-(\delta+n) .$$
Now $s_k, s_h$ do affect long-run growth. If policy affects these, then policy affects growth. For instance, increasing the savings rates leads to higher growth in the long run. In other words, when we have human capital and constant returns to reproducible factors of production, it is possible to explain longrun growth (see Figure 5.1).

经济代写|宏观经济学代写Macroeconomics代考|Balanced growth path

$$(\alpha-1) \gamma_k+\beta \gamma_h=0 \alpha \gamma_k+(\beta-1) \gamma_h=0 .$$

$$\frac{1-\alpha-\beta}{1-\beta} \gamma_k=0$$

经济代写|宏观经济学代写Macroeconomics代考|Still looking for endogenous growth

$$\frac{\dot{k}}{k}=\frac{\dot{h}}{h}=s_h\left(\frac{s_k}{s_h}\right)^a-(\delta+n)=s_k^a s_h^{1-\alpha}-(\delta+n) .$$

$$\frac{\dot{y}}{y}=\alpha \frac{\dot{k}}{k}+(1-\alpha) \frac{\dot{h}}{h}=s_k^a s_h^{1-\alpha}-(\delta+n) .$$

有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。

经济代写|宏观经济学代写Macroeconomics代考|ECON6002

statistics-lab™ 为您的留学生涯保驾护航 在代写宏观经济学Macroeconomics方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写宏观经济学Macroeconomics代写方面经验极为丰富，各种代写宏观经济学Macroeconomics相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

经济代写|宏观经济学代写Macroeconomics代考|Productivity shocks and the current account

Suppose the economy initially has total factor productivity $A^H$, with corresponding optimal stock of capital $\left(k^\right)^H$ and consumption level $\left(c^\right)^H$. At time 0 there is an unanticipated and permanent fall in productivity from $A^H$ to $A^L$, where $A^L<A^H$ (maybe because this economy produced oil, guano, or diamonds and its price has come down). This means, from (4.28), that $z(A)$ falls from $z\left(A^H\right)$ to $z\left(A^L\right)$. Capital holdings are reduced: residents sell capital in exchange for bonds, so after the shock they have $\left(k^\right)^L<\left(k^\right)^H$, where $\left(k^\right)^H$ was the optimal stock of capital before the shock. Assets $a_0$ are unchanged on impact. From (4.29) it follows that consumption adjusts instantaneously to its new (and lower) value: $$\left(c^\right)^L=r a_0-(1-\alpha) z\left(A^L\right)<r a_0-(1-\alpha) z\left(A^H\right)=\left(c^*\right)^H \text {, for all } t \geq 0 .$$
What happens to the current account? After the instantaneous shock, assets remain unchanged, and $\dot{b}_t$ is zero. The economy immediately converges to the new BGP, where the current account is in balance.

At this point, you must be really disappointed: don’t we ever get any interesting current account dynamics from this model? Actually, we do! Consider a transitory fall in productivity at time 0 , from $A^H$ to $A^L$, with productivity eventually returning to $A^H$ after some time $T$. Well, it should be clear that consumption will fall, but not as much as in the permanent case. You want to smooth consumption, and you understand that things will get back to normal in the future, so you don’t have to bring it down so much now. At the same time, the capital stock does adjust down fully, otherwise its return would be below what the domestic household could get from bonds. If current output falls just as in the permanent case, but consumption falls by less, where is the difference? A simple inspection of (4.9) reveals that $\dot{b}$ has to fall below zero: it’s a current-account deficit! Quite simply, residents can smooth consumption, in spite of the negative shock, by borrowing resources from abroad. Once the shock reverts, the current account returns to zero, while consumption remains unchanged. In the new BGP, consumption will remain lower relative to its initial level, and the difference will pay for the interest incurred on the debt accumulated over the duration of the shock – or more generally, the reduction in net foreign asset income.
‘This example underscores the role of the current account as a mechanism through which an economy can adjust to shocks. It also highlights one feature that we will see over and over again: the optimal response and resulting dynamics can be very different depending on whether a shock is permanent or transitory.

经济代写|宏观经济学代写Macroeconomics代考|Sovereign wealth funds

This stylised model actually allows us to think of other simple policy responses. Imagine a country that has a finite stock of resources, like copper. ${ }^4$ Furthermore let’s imagine that this stock of copper is being extracted in a way that it will disappear in a finite amount of time. The optimal program is to consume the net present value of the copper over the infinite future. So, as the stock of copper declines the economy should use those resources to accumulate other assets. This is the fiscal surplus rule implemented by Chile to compensate for the depletion of their resources. In fact, Chile also has a rule to identify transitory from permanent shocks, with the implication that all transitory increases (decreases) in the price level have to be saved (spent).

Does this provide a rationale for some other sovereign wealth funds? The discussion above suggests that a country should consume:
$$r \int_{-\infty}^{\infty} R_t e^{-r t} d t,$$
where $R$ is the value of the resources extracted in period $t$. This equation says that a country should value its intertemporal resources (which are the equivalent of the $a_0$ above, an initial stock of assets), and consume the real return on it.

Is that how actual sovereign funds work? Well, the Norwegian sovereign fund rule, for instance, does not do this. Their rule is to spend at time $t$ the real return of the assets accumulated until then:
$$r \int_{-\infty}^t R_t e^{-r(s-t)} d s$$
This rule san only be rationalised if you expest no further dissoveries and reat sach uew dissovery as a surprise. Alternatively, one could assume that the future is very uncertain, so one does not want to commit debt ahead of time. (We will come back to this precautionary savings idea in our study of consumption in Chapter 11.) In any event, the key lesson is that studying our stylised models can help clarify the logic of existing policies, and where and why they depart from our basic assumptions.

经济代写|宏观经济学代写Macroeconomics代考|Productivity shocks and the current account

‘这个例子强调了经常账户作为经济体可以调整中击的机制的作用。它还强调了我们将一遍又一遍地看到的一个特 征：最佳响应和产生的动态可能会因冲击是永久性的还是暂时的而有很大不同。

经济代写|宏观经济学代写Macroeconomics代考|Sovereign wealth funds

$$r \int_{-\infty}^{\infty} R_t e^{-r t} d t$$

$$r \int_{-\infty}^t R_t e^{-r(s-t)} d s$$

有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。

经济代写|宏观经济学代写Macroeconomics代考|ECOS3007

statistics-lab™ 为您的留学生涯保驾护航 在代写宏观经济学Macroeconomics方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写宏观经济学Macroeconomics代写方面经验极为丰富，各种代写宏观经济学Macroeconomics相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

经济代写|宏观经济学代写Macroeconomics代考|The steady state consumption and current account

Now that you have the level of income you should be able to compute the level of consumption. How do we do that? By solving the differential equation that is the budget constraint (4.9), which we can rewrite as
$$\dot{a}_t-r a_t=f\left(k^\right)-r k^-c^,$$ using the solutions for optimal consumption and capital stock. Using our strategy of integrating factors, we can multiply both sides by $e^{-r t}$, and integrate the resulting equation between 0 and $t$ : $$a_t e^{-r t}-a_0=\frac{c^+r k^-f\left(k^\right)}{r}\left(e^{-r t}-1\right) .$$
Now evaluate this equation as $t \rightarrow \infty$. Considering the NPC and the TVC, it follows that:
$$c^=r a_0+f\left(k^\right)-r k^* .$$
We can also find the optimal level of debt at each time period. It is easy to see that $a_t$ is kept constant at $a_0$, from which it follows that $b_t=b_0+k_0-k^*$. The current account is zero. In other words, the NGM delivers a growth model with no growth, as we saw in the last chapter, and a model of the current account dynamics without current account surpluses or deficits.

Not so fast, though! We saw that the NGM did have predictions for growth outside of the BGP. Let’s look at the transitional dynamics here as well, and see what we can learn.

经济代写|宏观经济学代写Macroeconomics代考|The inexistence of transitional dynamics

There are no transitional dynamics in this model: output per capita converges instantaneously to that of the rest of the world!

Suppose that initial conditions are $k_0<k^$ and $b_0>0$. But, condition (4.19) says that capital must always be equal to $k^$. Hence, in the first instant, capital must jump up from $k_0$ to $k^*$. How is this accomplished? Domestic residents purchase the necessary quantity of capital (the single good) abroad and instantaneously install it. Put differently, the speed of adjustment is infinite.

How do the domestic residents pay for this new capital? By drawing down their holdings of the bond. If $\Delta k_0=k^-k_0$, then $\Delta b_0=-\Delta k_0=-\left(k^-k_0\right)$. Note that this transaction does not affect initial net national assets, since
$$\Delta a_0=\Delta k_0+\Delta b_0=\Delta k_0-\Delta k_0=0 .$$

Suppose now that the production function is given by
$$f\left(k_t\right)=A k_t^a, A>0,0 \leq \alpha \leq 1 .$$
This means that condition (4.19) is
$$\alpha A\left(k^\right)^{\alpha-1}=r$$ so that the level of capital on the BGP is $$k^=\left(\frac{\alpha A}{r}\right)^{\frac{1}{1-\alpha}},$$
which is increasing in $A$ and decreasing in $r$.
Using this solution for the capital stock we can write $y^$ as $$y^=A k^{* \alpha}=A\left(\frac{\alpha A}{r}\right)^{\frac{\alpha}{1-\alpha}}=A^{\frac{1}{1-\alpha}}\left(\frac{\alpha}{r}\right)^{\frac{a}{1-\alpha}} \equiv z(A),$$
with $z(A)$ increasing in $A$.
It follows that consumption can be written as
$$c^=r u_0-r k^+z(A)=r u_0+(1-\alpha) z(A),$$
with $z^{\prime}(A)>0$.

经济代写|宏观经济学代写Macroeconomics代考|The steady state consumption and current account

$c^{\wedge}=r^{\prime} a_{-} 0+f$ lleft(k^\ight) $-\mathrm{k}^{\wedge} \mathrm{k}^{\star}$

经济代写|宏观经济学代写Macroeconomics代考|The inexistence of transitional dynamics

$$c^{=} r u_0-r k^{+} z(A)=r u_0+(1-\alpha) z(A)$$

有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。


text:
the required reserve ratio is the

|

d. The reserve ratio exists to ensure that the bank is able to pay an unusually high number of withdrawals on demand accounts should that event occur. Step 2:Next, determine the dollar amount of the deposit liabilities against which the bank is obligated to maintain reserves. There is also an interest rate on excess reserves (IOER), which is paid on any funds a bank deposits with the Federal Reserve in excess of their reserve requirement. The reverse is true when the central bank lowers the reserve ratio. B. Banks with more than $16.3 million to$124.2 million must reserve 3% of net transaction accounts. If the required reserve ratio is 25% and a customer deposits $300 into her checkable deposit, the money supply will _____ if the banking system does NOT hold any excess reserves and the people does not change their desired level of currency holdings (In other words, the basic two assumptions we mentioned in class hold). 1. It is also known as the net demand and time liabilities. In January 2019, the Fed updated its reserve requirements for depository institutions of different sizes. Deflation is a decrease in the general price level of goods and services. Learn financial modeling and valuation in Excel the easy way, with step-by-step training. The money can be kept at the bank itself or in the nearest central bank location. Foreign exchange reserves refer to foreign assets held by the central bank of a country. the simple deposit multiplier increases from 8 to 10. Question 11 If the required-reserve ratio is increased from 10 percent to 12.5 percent: O potential deposit expansion becomes greater. A required reserve ratio is the fraction of deposits that regulators require a bank to hold in reserves and not loan out. The reserve ratio exists to ensure that the bank is able to pay an unusually high number of withdrawals on demand accounts should that event occur. B. Reservable liabilities include net transaction accounts, nonpersonal time deposits and Eurocurrency liabilities. Money Multiplier = 1 / Required Reserve Ratio. Conversely, the Fed increases the reserve ratio requirement to reduce the amount of funds banks have to lend. 1 Answer to 1) If the required reserve ratio is 10 percent, currency in circulation is$400 billion, checkable deposits are $800 billion, and excess reserves total$0.8 billion, then the monetary base is A) $480 billion. Money multiplier: The number of deposit (loan) dollars that the banking system can create from$1 … Answer Chapter 25 Money Creation Economics for Today 7th Topics. Excess reserves: Bank reserves in excess of required reserves. Instead, they utilize open market operations such as quantitative easing. Reserve Ratio Example. An investor can also shift his investments into areas that are not influenced by changes in the ratio. U.S. commercial banks are required to hold reserves against their total reservable liabilities (deposits) which cannot be lent out by the bank. The central bank is the institution that determines the required amount of reserve ratio. It is the fraction of deposits that regulators require a bank to hold in reserves and not loan out. Ultimately, that $500 million in deposits can turn into$5 billion in loans, where the 10% reserve requirement defines the so-called money multiplier as: Investopedia uses cookies to provide you with a great user experience. $300 million. Banking system reserves can support$1200 million when the reserve ratio is … Since its inception in 1694, the bank has changed from being a private bank that loaned money to the government, to being the official central bank of the United Kingdom., the U.S. Federal Reserve System, and the European Central BankEuropean Central BankThe European Central Bank (ECB) is one of the seven institutions of the EU and the central bank for the entire Eurozone. $100,000 b. It may then lend out the remaining 90%, or$450 million, which will make its way back to the banking system as new deposits. Within limits specified by law, the Board of Governors of the Federal Reserve has the sole authority over changes in reserve requirements. Consequently, raising the reserve requirement hurts bonds and stocks. The minimum amount of reserves that a bank must hold on to is referred to as the reserve requirement, and is sometimes used synonymously with the reserve ratio. A higher interest rate hurts bond owners, as interest rates have an inverse relationship with the value of bonds. The financial crisis took its toll on individuals and institutions around the globe, with millions of A… Reserve Ratio and the Money Multiplier . The reserve ratio is expressed as a percentage of the bank's total deposits. The Fed uses this mechanism to reduce the supply of money in the economy and control inflation by slowing the economy down. This means if a bank has deposits of $1 billion, it is required to have$110 million on reserve ($1 billion x .11 =$110 million). Thus, more goods and services can be purchased for the same amount of money. The total reserve requirements for euro area banks stand at around 113 billion euro (beginning of 2016). Reserve requirement is a tool used by most banking institutions for maintaining a percentage of the deposits from depositors as reserves to combat the contingencies lying ahead in the future as a result of a sudden rise in withdrawals. The reserve ratio is the fraction of total deposits that a bank keeps on hand as reserves (i.e. The required reserve ratio is the legal minimum amount of reserves a bank must hold in cash for every $1 in deposit in receives. Required Reserve Ratio = Reserve Amount / Total Deposit. Their use is becoming less relevant in countries such as the U.S., where regulators preferring quantitative easing instead. Explanation of the Reserve Ratio Formula. Banks with more than$124.2 million in net transaction accounts must maintain a reserve of 10% of net transaction accounts. Solution for 2.4. The reserve ratio – also known as bank reserve ratio, bank reserve requirement, or cash reserve ratio – is the percentage of deposits a financial institution must hold in reserve as cash. In the United States, the reserve ratio – commonly referred to as the It can lend out an amount equals to excess reserves which equals (1 − required reserves).Higher the required reserve ratio, lesser the excess reserves, lesser the banks can lend as loans, and lower the money multiplier. Few Changes in Reserve Requirements There are several reasons why reserve requirements are not frequently changed, the most important of which is that open market operations provide a much more precise tool for implementing monetary policy. potential deposit expansion remains the same. The figures are discussed and set by a board of governors. For example, let's assume that Bank XYZ has $400 million in deposits. In many cases, stockholders are able to tell when variations in reserve ratios will take place by scrutinizing macroeconomic patterns. International investors need to keep a close eye on reserve ratios, especially in markets that rely on reserve requirements to manage monetary policies. The reserve ratio – also known as bank reserve ratio, bank reserve requirement, or cash reserve ratio – is the percentage of deposits a financial institution must hold in reserve as cash. If a bank doesn't have the funds to meet its reserve, it can borrow funds from the Fed to satisfy the requirement. Excess reserves Formula: Excess reserves= total reserves - required reserves. Required reserve ratio - This is the ratio of required reserves to total deposits and is defined . Reserve and capital requirements are different from each other. Restricted cash refers to cash that is held onto by a company for specific reasons and is, therefore, not available for immediate ordinary business use. Banks with deposits of$16.9 million or less didn’t have a reserve requirement. Reserve Ratio=Deposits x Reserve Requirement\text{Reserve Ratio}=\text{Deposits x Reserve Requirement}Reserve Ratio=Deposits x Reserve Requirement. Banks with net transaction accounts of up to $16.3 million or less do not have a reserve requirement. Description: The reserve ratio is an important tool of the monetary policy of an economy and plays an essential role in regulating the money supply. Gain the confidence you need to move up the ladder in a high powered corporate finance career path. If the Federal Reserve's reserve ratio requirement is 10%, Bank XYZ must keep at least$40 million in an account at a Federal Reserve bank and may not use that cash for lending or any other purpose. An investor can hedge such risks by investing in multiple regions and countries. Like time deposits, savings accounts are not affected by reserve requirements. Banks with more than $16.9 million up to$127.5 million had to reserve 3% of all deposits. Each country’s central bank determines what the ratio will be for the banks in that country. Calculate the money supply, the currency deposit ratio, the excess reserve ratio, and the money multiplier (required reserve ratio is 0.1). The Required Reserve Ratio Is 10%: Assets Liabilities Reserves = 20 Million Deposits = 100 Million Loans = 80 Million Capital = 10 Million Securities = 10 Million A. On Oct. 1, 2008, the Federal Reserve began paying interest to banks on these reserves. The required reserve ratio is typically set by the central bank of a country and is put in place so that banks will have enough money if people wish to withdraw their deposits. Required reserve ratio is the fraction of deposits which a bank is required to hold in hand. In fractional reserve banking, the reserve ratio is key to understanding how much credit money banks can make by lending out deposits.For example, if … As a simplistic example, assume the Federal Reserve determined the reserve ratio to be 11%. When it occurs, the value of currency grows over time. Video Transcript. Image by Sabrina Jiang © Investopedia 2020, The reserve ratio, set by the central bank, is the percentage of a commercial bank's deposits that it must keep in cash as a reserve in case of mass customer withdrawals, In the U.S., the Fed uses the reserve ratio as an important monetary policy tool to increase or decrease the economy's money supply, The Fed lowers the reserve ratio to give banks more money to lend and boost the economy and increases the reserve ratio when it needs to reduce the money supply and control inflation. Discussion. Put another way, deflation is negative inflation. It required that all banks with more than $127.5 million on deposit maintain a reserve of 10% of deposits. To keep advancing your career, the additional CFI resources below will be useful: Get world-class financial training with CFI’s online certified financial analyst training programFMVA® CertificationJoin 350,600+ students who work for companies like Amazon, J.P. Morgan, and Ferrari ! Question 11 If the required-reserve ratio is increased from 10 percent to 12.5 percent: O potential deposit expansion becomes greater. For example, the reserve ratio in the U.S. is limited to 10% for deposits and 0% for time deposits spanning many years. = the total reserve ratio (the ratio of legally required plus non-required reserve holdings of banks to demand deposit liabilities of banks). d. 25 percent. The calculation can be done by using the following steps: Step 1: Firstly, determine the reserve amount maintained by the bank with the central bank, and it will be easily available in the disclosure published by the bank. pays about 0.5% on reserve ratios as compensation to banks for income lost when the reserve requirement is increased. Join 350,600+ students who work for companies like Amazon, J.P. Morgan, and Ferrari. Although Bank of America is subjected to a reserve requirement of various regions, for ease of calculation, we will consider the reserve requirement of Federal Reserve in this case, i.e., 10%. It can be contrasted with unrestricted cash, which refers to cash that can be used for any purpose. cash in the vault). 15 percent. In certain countries, some amount of money is paid to banks as interest on their reserves. Effective April 2, 1992, the 12 percent required reserve ratio against net transaction deposits above the low reserve tranche level was reduced to 10 percent. Banks have more money to lend, and more interest is generated. The money supply will increase by: a. Reserve requirements refer to the amount of cash that banks must hold in reserve against deposits made by their customers.$400,000 c. $500,000 d.$1,000,000. This rate is referred to as the interest rate on required reserves (IORR). The multiplier effect measures the impact that a change in investment will have on final economic output. Financial institutions started to sink, many were absorbed by larger entities, and the US Government was forced to offer bailouts. The deposit multiplier is the process by which an economy's basic money supply is created, and reflects the change in checkable deposits possible from a change in reserves. When the central bank wants to increase money supply … Okay, The ratio of 100 to 40 is 100 over 40. Generally, the reserve ratio is used in monetary policy planning in order to regulate the amount of cash banks can convert to loans. The Federal Reserve uses the reserve ratio as one of its key monetary policy tools. The required reserve ratio is not calculated by individuals or banks, but is instead set by those who oversee the banks for that particular economy. A reserve ratio is the amount of money that a bank must keep on hand, as a percentage of its customers’ deposits. Most depositories are able to satisfy their entire reserve requirement with vault cash, which they hold primarily to meet the liquidity needs of their The European Central Bank (ECB) is one of the seven institutions of the EU and the central bank for the entire Eurozone. A higher ratio appears when the economy is experiencing inflation, while a lower ratio is experienced during a deflationDeflationDeflation is a decrease in the general price level of goods and services. In addition, central monetary authorities use the ratio to protect banks from a sudden decline in liquidity, which can result in a financial crisis2008-2009 Global Financial CrisisThe Global Financial Crisis of 2008-2009 refers to the massive financial crisis the world faced from 2008 to 2009. CFI is the official provider of the global Financial Modeling & Valuation Analyst (FMVA)™FMVA® CertificationJoin 350,600+ students who work for companies like Amazon, J.P. Morgan, and Ferrari certification program, designed to help anyone become a world-class financial analyst.

Share


text:
# Difference between revisions of "2015 AMC 12A Problems/Problem 20"

## Problem

Isosceles triangles $T$ and $T'$ are not congruent but have the same area and the same perimeter. The sides of $T$ have lengths $5$, $5$, and $8$, while those of $T'$ have lengths $a$, $a$, and $b$. Which of the following numbers is closest to $b$?

$\textbf{(A) }3\qquad\textbf{(B) }4\qquad\textbf{(C) }5\qquad\textbf{(D) }6\qquad\textbf{(E) }8$

## Solution

### Solution 1

The area of $T$ is $\dfrac{1}{2} \cdot 8 \cdot 3 = 12$ and the perimeter is 18.

The area of $T'$ is $\dfrac{1}{2} b \sqrt{a^2 - (\dfrac{b}{2})^2}$ and the perimeter is $2a + b$.

Thus $2a + b = 18$, so $2a = 18 - b$.

Thus $12 = \dfrac{1}{2} b \sqrt{a^2 - (\dfrac{b}{2})^2}$, so $48 = b \sqrt{4a^2 - b^2} = b \sqrt{(18 - b)^2 - b^2} = b \sqrt{324 - 36b}$.

We square and divide 36 from both sides to obtain $64 = b^2 (9 - b)$, so $b^3 - 9b^2 + 64 = 0$. This factors as $(b - 8)(b^2 - b - 8) = 0$. Because clearly $b \neq 8$ but $b > 0$, we have $b = \dfrac{1 + \sqrt{33}}{2} < \dfrac{1 + 6}{2} = 3.5.$ The answer is $\textbf{(A)}$.

### Solution 2

Triangle $T$, being isosceles, has an area of $\frac{1}{2}(8)\sqrt{5^2-4^2}=12$ and a perimeter of $5+5+8=18$. Triangle $T'$ similarly has an area of $\frac{1}{2}(b)\bigg(\sqrt{a^2-\frac{b^2}{4}}\bigg)=12$ and $2a+b=18$.

Now we apply our computational fortitude.

$$\frac{1}{2}(b)\bigg(\sqrt{a^2-\frac{b^2}{4}}\bigg)=12$$ $$(b)\bigg(\sqrt{a^2-\frac{b^2}{4}}\bigg)=24$$ $$(b)\sqrt{4a^2-b^2}=48$$ $$b^2(4a^2-b^2)=48^2$$ $$b^2(2a+b)(2a-b)=48^2$$ Plug in $2a+b=18$ to obtain $$18b^2(2a-b)=48^2$$ $$b^2(2a-b)=128$$ Plug in $2a=18-b$ to obtain $$b^2(18-2b)=128$$ $$2b^3-18b^2+128=0$$ $$b^3-9b^2+64=0$$ We know that $b=8$ is a valid solution by $T$. Factoring out $b-8$, we obtain $$(b-8)(b^2-b-8)=0 \Rightarrow b^2-b-8=0$$ Utilizing the quadratic formula gives $$b=\frac{1\pm\sqrt{33}}{2}$$ We clearly must pick the positive solution. Note that $5<\sqrt{33}<6$, and so ${3<\frac{1+\sqrt{33}}{2}<\frac{7}{2}}$, which clearly gives an answer of $\fbox{A}$, as desired.

### Solution 3

Triangle T has perimeter $5 + 5 + 8 = 18$ so $18 = 2a + b$.

Using Heron's, we get $\sqrt{(9)(4)^2(1)} = \sqrt{(\frac{2a+b}{2})(\frac{d}{2})^2(\frac{2a-b}{2})}$.

We know that $2a + b = 18$ from above so we plug that in, and we also know that then $2a - b = 18 - 2b$.

$12 = 3\frac{b}{2}\sqrt{9-b}$

$64 = 9b^2 - b^3$

We plug in 3 for $b$ in the LHS, and we get 54 which is too low. We plug in 4 for $b$ in the LHS, and we get 80 which is too high. We now know that b is some number between 3 and 4.

If $b \geq 3.5$, then we would round up to 4, but if $b < 3.5$, then we would round down to 3. So let us plug in 3.5 for b.

We get 67.375 which is too high, so we know that $b < 3.5$.

The answer is $3$. $\textbf{(A)}$

## See Also

 2015 AMC 12A (Problems • Answer Key • Resources) Preceded byProblem 19 Followed byProblem 21 1 • 2 • 3 • 4 • 5 • 6 • 7 • 8 • 9 • 10 • 11 • 12 • 13 • 14 • 15 • 16 • 17 • 18 • 19 • 20 • 21 • 22 • 23 • 24 • 25 All AMC 12 Problems and Solutions
Invalid username
Login to AoPS


text:
# How can I speed up the execution of my model?

Hi,
I am trying to use PyMC3 to do a Bayesian fitting of diffusion MRI signal. For those who are not “fluent” in MRI, the principle is to probe the diffusion of water in an organ of interest. To do so, a magnetic field gradient is applied to the organ of interest defore the signal is measured. A simple mono exponential decay model links the signal measured in each voxel (a 3D pixel) to the strength of the applied gradient following a simple mono-exponential decay:

Where b is the magnetic field gradient strength, called b-value, ADC is the apparent diffusion coefficient, and S_0 is the signal with no gradient applied.
The b-values are set by the experimental design and are the same for every voxels.
The aim is to estimate ADC and to a lesser extent S_0.
We assume a Gaussian noise with standard deviation \sigma.
I wanted to use PyMC3 to implement a very simple model, that is defined, for every voxels i and b-value j, as:

\epsilon_{ij} \sim \mathcal{N}(0,\sigma_i)
\sigma_i\sim \mathrm{HalfCauchy}(0.5)
S_{0_i}\sim \mathcal{N}(0,1e5)

I know the model is quite naive and simple: every voxel is independent from the other, the prior are fixed and non informative, but I chose it as a training in PyMC3, before moving to more complex modeling.
Here is the code I wrote:

## Imports

%matplotlib inline
import numpy as np
import pymc3 as pm
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('seaborn-darkgrid')

## Data generation

M=5 # number of voxel in my experiment
bvalues=np.array([0,10,20,50,100,200,500,1000],dtype=np.float) # vector of b-values
N=bvalues.size # number of bvalue

S0=1
sigma=0.1
data=np.random.normal(loc=Sb,scale=sigma, size=(M,N)) # Add noise and create the signal for M voxels

Here is an example of the MRI signal, as a function of the b-value

## PyMC3 model

with  pm.Model() as unpooled_model:
s0=pm.Normal('s0',0,1e3, shape=(M,1))
sigma = pm.HalfCauchy('sigma', .5,shape=(M,1))

sb_like=pm.Normal('sb_like', mu=sb_est, sigma=sigma, observed=data )

The graph of the model is then:

## Inference

with unpooled_model:
unpooled_trace = pm.sample(2000, tune=1000)

pm.traceplot(unpooled_trace,

At this point I am quite satisfied with the result. However, it took almost 30s for the algorithm to converge, which disappointed me of course.

# So here is my simple question:

Do you have an idea to improve the computation time? I don’t know how to profile this kind of code, so I am quite helpless.
Do you think that implementing the monoexpontial model in theano could speed it up? Then how should it be done?

Thanks for the help!

Looking at the model this is already pretty well implemented, what you can consider doing is to change the LogNormal and the HalfCauchy prior to HalfNormal, which is usually a bit easier to sample from.

Ok.
Do you think that implementing the model with theano could speed up the code?
I don’t know exactly when theano is used in the background or when it is required to use it in my own code. I don’t know if using the theano exp function instead of the numpy function would improve the computation time, or would change anything.
I understood that np.exp() will use theano.tensor.exp() in the background, is that correct? In that case I guess that there is no benefit to use theano explicitely.

I think so too, but it is pretty straightforward to switch to theano version so I suggest you to go for it.

Disclaimer: I am not an expert here, but my two cents. Why is 30 s disappointing? Are you trying to scale to larger dataset? I read in the pymc docs that often pymc is equal to or slower than other packages bayesian packages when the data is small, as there is a lot of overhead compiling. But as you fit larger data the compiling overhead becomes a smaller percentage of compute time and thus pymc becomes faster than some of the other bayesian software packages. So if you need to scale the model it might not perform as badly as you think.

1 Like


text:
Preprint Article Version 1 Preserved in Portico This version is not peer-reviewed

# A Statistical Inference of the Principle of Maximum Entropy Production

Version 1 : Received: 28 February 2021 / Approved: 2 March 2021 / Online: 2 March 2021 (16:53:04 CET)

How to cite: Veening, M. A Statistical Inference of the Principle of Maximum Entropy Production. Preprints 2021, 2021030110 (doi: 10.20944/preprints202103.0110.v1). Veening, M. A Statistical Inference of the Principle of Maximum Entropy Production. Preprints 2021, 2021030110 (doi: 10.20944/preprints202103.0110.v1).

## Abstract

The maximization of entropy S within a closed system is accepted as an inevitability (as the second law of thermodynamics) by statistical inference alone. The Maximum Entropy Production Principle (MEPP) states that not only S maximizes, but $\dot{S}$ as well: a system will dissipate as fast as possible. There is still no consensus on the general validity of this MEPP, even though it shows remarkable explanatory power (both qualitatively and quantitatively), and has been empirically demonstrated for many domains. In this theoretical paper I provide a generalization of entropy gradients, to show that the MEPP actually follows from the same statistical inference, as that of the 2nd law of thermodynamics. For this generalization I only use the concepts of super-statespaces and microstate-density. These concepts also allow for the abstraction of 'Self Organizing Criticality' to a bifurcating local difference in this density, and allow for a generalization of the fundamentally unresolved concepts of 'chaos' and 'order'.

## Subject Areas

entropy production maximization; complexity; thermodynamics; nonlinear dynamics; statistical mechanics; autopoiesis; entropy; entropy production; life

Views 0
Metrics 0


text:
# Alter only one branch properties

I have a diagram in tikz-qtree like figure A, but I'd like something like figure B. Is it possible, to alter the properties of only one branch? (these figures were made with Dia and arrows are not important)

\begin{center}
\begin{tikzpicture}[grow'=right,level distance=1.45in,sibling distance=.2in]

\tikzset{edge from parent/.style=
{thick, draw, edge from parent fork right},
every tree node/.style=
{draw,minimum width=1.3in,text width=1.15in,align=center}
}
\Tree
[.parent
[.child0
grandchild0-0
grandchild0-1
[[.{grandchild0-2}
{greatgrandchild0}
{greatgrandchild0}
{greatgrandchild0}
{greatgrandchild0}
]]
grandchild0-3
]
[.child1
[.grandchild1-0 ]
[.grandchild1-1 ]
]
]
\end{tikzpicture}
\end{center}

-
It would be helpful to post the TikZ code that you have already in a complete compilable document. –  Alan Munn May 8 '12 at 18:44
@Greg Your second edit is a perfectly acceptable solution (especially for a one-off diagram) so instead of editing your question you should post it as a solution. It's fine to post answers to your own questions (and even accept them (although there's a 2 day waiting period for that, I think). –  Alan Munn May 8 '12 at 21:29
Yeah, I edited because I couldn't post own topic. Now, I've just I done. It was a solution to that issue. The funny thing is, atfer 2 days requirements have changed, so finally I will rahter use qtree. :D Thanks for your help. :) –  Greg May 11 '12 at 15:55

You can add extra brackets around a node to extend its branch:

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usetikzlibrary{trees} % this is to allow the fork right path

\begin{document}

\begin{tikzpicture}[level distance=1.25in,sibling distance=.15in,scale=.75]
\tikzset{edge from parent/.style=
{thick, draw,
edge from parent fork right},every tree node/.style={draw,minimum width=1in,text width=1in, align=center},grow'=right}
\Tree
[. parent
[.{nice child0}
[.{grandchild0-0 } ]
[.{grandchild0-1 } ]
[.{grandchild0-2 } ]
[.{grandchild0-3 } ]
]
[[[.child1
[.{grandchild1-0 } ]
[.{grandchild1-1 } ]
[.{grandchild1-2 } ]
]]]
[.child2 ]
[.child3 ]
]
\end{tikzpicture}
\end{document}

-
Thank you, but there is another thing I'd like to modify on it. Namely to reduce its height. Using your figure nodenames... the gap between "nice child0" and "child2" is as wide as child1's grandchild. But I'd like to reduce it. This is why I mainly wanted the modification you gave me. –  Greg May 8 '12 at 19:25
@greg tikz-qtree is designed to automatically calculate the node spacing (which is why it's so useful), but this comes at the expense of not having individual control of specific nodes, I think. –  Alan Munn May 8 '12 at 19:44

I managed to find a solution to my problem without qtree based on this one: How to modify the distance between branches when drawing trees using TiKZ?

The code:

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary{trees}%szögletességhöz kell
\begin{document}

\begin{tikzpicture}[grow'=right,level distance=90pt,sibling distance=30pt]

\tikzset{edge from parent/.style=
{thick, draw, edge from parent fork right}
}

\node [draw] (z){parent}
child {
node[draw] (a) {child0}
child {
node[draw] (c) {grandchild0-0}
}
child {
node[draw] (d) {grandchild0-1}
}
child {
node[draw] (e) {grandchild0-2}
}
child {
node[draw] (f) {grandchild0-3}
}
}
child {
node[draw] (b) {child1}
}
child {
node[draw] (b) {child2}
}
child {
node[draw] (b) {child3}
child {
node[draw] (c) {grandchild3-0}
}
child {
node[draw] (c) {grandchild3-1}
}
}
;

\path (z) -- (a);
\path (z) -- (b);
\path (a) -- (c);
\end{tikzpicture}

\end{document}

-
I realise it is your question, but I don't see how this answers it! –  cfr Apr 5 at 13:22

Here's a solution using forest which is an extremely flexible and powerful package for drawing trees. It offers the automatisation of qtree plus the ability to customise the format and placement of individual nodes, branches and edges, when required.

It does an especially good job of automatically packing the nodes to make compact trees. [But you could further compress the tree with manual adjustments if required.]

\documentclass[tikz,border=10pt]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={
grow'=0,
parent anchor=east,
child anchor=west,
anchor=west,
thick,
draw,
edge path={
\noexpand\path [draw, thick, \forestoption{edge}] (!u.parent anchor) -- +(5pt,0) |- (.child anchor)\forestoption{edge label};
},
if level=1{
tier=children,
if n=2{
for children={
tier=grandchildren 2,
delay={
edge path={
\noexpand\path [draw, thick, \forestoption{edge}] (!u.parent anchor) -| ([xshift=-5pt].child anchor) -- (.child anchor)\forestoption{edge label};
},
}
},
}{
for children={tier=grandchildren 1}
},
}{},
}
[root
[child 1
[grandchild 1
[,phantom, tier=grandchildren 2]
]
[grandchild 2]
[grandchild 3]
]
[child 2
[grandchild 4]
[grandchild 5]
[grandchild 6]
]
[child 3
[grandchild 7]
[grandchild 8]
]
]
\end{forest}
\end{document}

Note that if you just want the grandchildren packed as shown in your answer, the solution is significantly simpler:

\begin{forest}
for tree={
grow'=0,
parent anchor=east,
child anchor=west,
anchor=west,
thick,
draw,
edge path={
\noexpand\path [draw, thick, \forestoption{edge}] (!u.parent anchor) -- +(5pt,0) |- (.child anchor)\forestoption{edge label};
},
}
[root
[child 1
[grandchild 1]
[grandchild 2]
[grandchild 3]
[grandchild 4]
]
[child 2]
[child 3]
[child 4
[grandchild 7]
[grandchild 8]
]
]
\end{forest}

-


text:
# The scheme of partial averaging for one class of hybrid systems

Авторы:
Журнал:
Страница:
103
info_eng:
This paper contains the substantiation of the scheme of partial averaging for one class of hybrid systems where one equation is a differential equation with Hukuhara derivative and the other one is an ordinary differential equation.


text:
" /> -->

#### Nature of Physical World and Measurement-2marks

11th Standard

Reg.No. :
•
•
•
•
•
•

Physics

Time : 01:00:00 Hrs
Total Marks : 70
Part-A
35 x 2 = 70
1. Explain how the definition of work in physics is different from general perception

2. Write the various types of potential energy. Explain the formulae.

3. Write the differences between conservative and Non-conservative forces. Give two examples each.

4. Explain the characteristics of elastic and inelastic collision.

5. Define the following
a) Coefficient of restitution
b) Power
c) Law of conservation of energy
d) loss of kinetic energy in inelastic collision

6. Calculate the work done by a force of 30 N in lifting a load of 2kg to a height of 10m (g = 10ms-2).

7. A ball with a velocity of 5 ms-1 impinges at angle of 60° with the vertical on a smooth horizontal plane. If the coefficient of restitution is 0.5. find the velocity and direction after the impact.

8. A bob of mass m is attached to one end of the rod of negligible mass and length r, the other end of which is pivoted freely at a fixed center O as shown in the figure. What initial speed must be given to the object to reach the top of the circle? (Hint: Use law of conservation of energy). Is this -speed less or greater than speed obtained in the section 4.2.9?

9. Two different unknown masses A and B collide. A is initially at rest when B has a speed v. After collision B has a speed v/2 and moves at right angles to its original direction of motion. Find the direction in which A moves after collision

10. A bullet of mass 20 g strikes a pendulum of mass 5 kg. Th e centre of mass of pendulum rises a vertical distance of 10 em. If the bullet gets embedded into the pendulum, calculate its initial speed

11. A spring which is initially in un-stretched condition, is first stretched by a length x and again by a further length x. The work done in the first case W1 is one third of the work done in second case W2True or false?

12. Which is conserved in inelastic collision? Total energy (or) Kinetic energy?

13. Is there any network done by external forces on a car moving with a constant speed along a straight road?

14. A car starts from rest and moves on a surface with uniform acceleration. Draw the graph of kinetic energy versus displacement. What information you can get from that graph?

15. A charged particle moves towards another charged particle. Under what conditions the total momentum and the total energy of the system conserved?

16. A box is pulled with a force of 25 N to produce a displacement of 15 m. If the angle between the force and displacement is 30°, find the work done by the force.

17. An object of mass 2 kg falls from a height of 5 m to the ground. What is the work done by the gravitational force on the object? (Neglect air resistance; Take g = 10m s-2).

18. An object of mass m = 1 kg is sliding from top to bottom in the fiictionless inclined plane of inclination angle 9 = 30° and the length of inclined plane is 10 m as shown in the figure. Calculate the work done by gravitational force and normal force on the object.Assume acceleration due to gravity, g = 10m s-2

19. If an object of mass 2 kg is thrown up from the ground reaches a height of 5 m and falls back to the Earth (neglect the air resistance). Calculate
(a) The work done by gravity when the object reaches 5 m height
(b) The work done by gravity when the object comes back to Earth
(c) Total work done by gravity both in upward and downward motion and mention the physical significance of the result.

20. A variable force F = kx2 acts on a particle which is initially at rest. Calculate the work done by the force during the displacement of the particle from x = 0 m to x = 4 m. (Assume the constant k = IN m-2)

21. A force $\vec F=\vec i+2\vec j+3\vec k$ k acts on a particle and displaces it through a distance $\vec S=4\vec i+6\vec j$Calculate the work done if force and work done are in the same direction

22. An object of mass 1 kg is falling from the height h = 10m. Calculate
(a) The total energy of an object at h = 10 m.
(b) Potential energy ofthe object when it is at h = 4 m.
(c) Kinetic energy of the object when it is at h = 4 m.
(d) What will be the speed of the object when it hits the ground?
(Assume g = 10 m s-2)

23. An object of mass m is projected from the ground with initial speed v0. Find the speed at height h.

24. Water in a bucket tied with rope is whirled around in a vertical circle of radius 0.5 m. Calculate the minimum velocity at the lowest point so that the water does not spill from it in the course of motion. (g= 10 ms-2)

25. Calculate the energy consumed in electrical units when a 75 W fan is used for 8 hours daily for one month (30 days).

26. A bullet of mass 50 g is fired from below into a suspended object of mass 450 g. The object rises through a height of 1.8 m with bullet remaining inside the object. Find the speed of the bullet. Take g = 10 ms-2.

27. Show that the ratio of velocities of equal masses in an inelastic collision when one of the masses is stationary is $\frac { { v }_{ 1 } }{ { v }_{ 2 } } =\frac { 1-e }{ 1+e }$

28. A particle moves along X- axis from x = 0 to x = 8 under the influence of a force given by F = 3x2 - 4x + 5. Find the work done in the process.

29. A body of mass 10 kg at rest is subjected to a force of 16N. Find the kinetic energy at the end of 10 s.

30. A body of mass 5 kg is thrown up vertically with a kinetic energy of 1000 J. If acceleration due to gravity is 10 ms-1, find the height at which the kinetic energy becomes half of the original value.

31. Two bodies of mass 60 kg and 30 kg move in the same direction along straight line with velocity 40 cms-1 and 30 cms-1 respectively suffer one dimensional elastic collision. Find their velocities after collision.

32. A particle of mass 70 g moving at 50 cms-1 is acted upon by a variable force as shown in the figure. What will be its speed once the force stops?

33. A particle strikes a horizontal frictionless floor with a speed u at an angle $\theta$  with the vertical and rebounds with the speed v at an angle $\phi$ with an vertical. The coefficient of restitution between the particle and floor is e. What is the magnitude of v?

34. A particle of mass m is fixed to one end of a light spring of force constant k and unstretched length I. It is rotated with an angular velocity w in horizontal circle. What will be the length increase in the spring?

35. A gun fires 8 bullets per second into a target X. If the mass of each bullet is 3 g and its speed 600 s-1. Then, calculate the power delivered by the bullets.


text:
# NEET Chemistry Hydrogen Questions Solved

The hydrides ion ${\mathrm{H}}^{-}$ is a stronger base than its hydroxide ion ${\mathrm{OH}}^{-}$. Which of the following reactions will occur if sodium hydride $\left(\mathrm{NaH}\right)$ is dissolved in water –

(A) ${\mathrm{H}}^{-}\left(\mathrm{aq}\right)+{\mathrm{H}}_{2}\mathrm{O}\to {\mathrm{H}}_{3}{\mathrm{O}}^{-}\left(\mathrm{aq}\right)$

(B) ${\mathrm{H}}^{-}\left(\mathrm{aq}\right)+{\mathrm{H}}_{2}\mathrm{O}\left(\mathcal{l}\right)\to {\mathrm{OH}}^{-}\left(\mathrm{aq}\right)+{\mathrm{H}}_{2}\left(\mathrm{g}\right)$

(C)

(D)

(B).

Difficulty Level:

• 11%
• 69%
• 15%
• 8%


text:
# Problem of the Week Problem B and Solution 'Temp'ting Crickets

## Problem

Crickets can help determine the temperature, in degrees Celsius. One possible way to make this calculation is to follow the steps below.

• Step 1: Count the number of chirps in $$25$$ seconds.

• Step 2: Divide the number from Step 1 by $$3$$.

• Step 3: Add $$4$$ to the number from Step 2.

1. By filling in each $$\underline{\ \ \ \ \ }$$ in the following equation with either a variable or a number, write an equation to show how to get the temperature, $$t$$, based on a certain number of chirps, $$c$$, in $$25$$ seconds. $t = \underline{\ \ \ \ \ }\div \underline{\ \ \ \ \ }+\underline{\ \ \ \ \ }$

2. Fill in the second column of the following table.

Chirps ($$c$$) in $$25$$ seconds Temperature ($$t$$) in degrees Celsius
$$60$$
$$54$$
$$66$$
3. Fill in the first column of the following table.

Chirps ($$c$$) in $$25$$ seconds Temperature ($$t$$) in degrees Celsius
$$18$$
$$20$$
$$16$$

## Solution

1. To determine the temperature, $$t$$, we take the number of chirps in $$25$$ seconds, $$c$$, divide by $$3$$, then add $$4$$. That is, $$t = \underline{\,c\,}\div\underline{\,3\,}+\underline{\,4\,}$$.

2. You may use the given steps or the equation from part (a) to fill in the table.

For example when there are $$60$$ chirps, we divide by $$3$$ to get $$20$$, and then add $$4$$ to get $$24$$ degrees Celsius.

Or we may use the equation $$t = 60 \div 3 + 4 = 20 + 4 = 24$$.

Chirps ($$c$$) in $$25$$ seconds Temperature ($$t$$) in degrees Celsius
$$60$$ $$24$$
$$54$$ $$22$$
$$66$$ $$26$$
3. To find the number of chirps for a given temperature, we work backwards, reversing the steps as we go. That is, we subtract $$4$$ from the given temperature, and then multiply by $$3$$.

For example when the temperature is $$18$$ degrees Celsius, we subtract $$4$$ to get $$14$$, and then multiply $$14$$ by $$3$$ to get $$42$$ chirps.

The equation to calculate chirps, $$c$$, given temperature, $$t$$, is $$c=(t-4)\times 3$$.

Chirps ($$c$$) in $$25$$ seconds Temperature ($$t$$) in degrees Celsius
$$42$$ $$18$$
$$48$$ $$20$$
$$36$$ $$16$$


text:
<$BlogRSDURL$>

A splat of all my blathering.

## Using CAPICOM and OpenSSL

I was recently challenged with a project that required sending a secure message from a Windows network to a *nix network. The client insisted that we use CAPICOM on the Windows side and the partner on the *nix side was adamant about using OpenSSL. I figured since both libraries were capable of support PKI they must be compatible but I was unsure of how. I was also skepticle because CAPICOM is notorious for its proprietary implementation. After many unsuccessful attempts, talking with folks at Microsoft, and reading gads of web pages on the subject I was becoming quite unsure that it could be done. However, MS suggested that it was possible and that the PKI implementation of CAPICOM did support the standards. The trick was to figure out how.

After quite a bit of reading and playing with OpenSSL for Win32, I was able to come up with a way to use CAPICOM 2.0 and OpenSSL together to send a secure message. The key was with the S/MIME capabilities of OpenSSL.

In my situation I needed to sign and envelope a message using CAPICOM (on Windows of course) and send the message to a *nix machine using OpenSSL to decrypt and verify it.

For this example I will use VB 6.0 (sorry) to drive the CAPICOM calls. I am following the best practices of PKI solutions such as PGP as closely as I could (I think). In particular, I am embedding the plain-text content within the signature for use in the verification process later. The signature is then encrypted within the envelope so that only a single file needs to be sent. This results in a slightly larger envelope but simplifies the process by not requiring separate messages to be sent.

One thing to note is that CAPICOM is a scriptable COM interface and therefore uses BSTR as the string format of choice. This means that all content will be represented in UNICODE and will require translation on the server so that *nix tools like OpenSSL can interpret them.

The following VB code shows 4 sub-routines that read, write, sign, and encrypt a clear-text text file as well as an event sub-routine for a simple form with a single button for kicking the process off.

I am simplifying the example by removing the error handling and making some assumptions about the storage of the certificates being used. I am assuming that the certificates are stored in the local user store called “My” and that the certificate location is known. Almost certainly, neither of these would be the case in the real world.

' I do not claim any responsibility for the correctness or security of this code ' and any or all portions should be used at your own risk. Option Explicit Const ForReading = 1, ForWriting = 2, TristateFalse = 0 Const TemporaryFolder = 2 Private Sub Command1_Click()   SignFile "c:\temp\in.txt", "c:\temp\signed.txt"   EnvelopeFile "c:\temp\signed.txt", "c:\temp\smime.txt" End Sub Sub SignFile(ByVal sInFile As String, ByVal sOutFile As String)   ' Open the MY store and retrieve the first certificate from the   ' store. The signing operation will only work if this certificate is   ' valid and has access to the signer's private key.   Dim oCertStore As New Store   oCertStore.Open CAPICOM_CURRENT_USER_STORE, "My", CAPICOM_STORE_OPEN_READ_ONLY      Dim oSigner As New signer   ' The signer's certificate is at index 1   oSigner.Certificate = oCertStore.Certificates.Item(1)   Set oCertStore = Nothing      ' Set the content to be signed.   Dim oSignedData As New SignedData   oSignedData.Content = ReadFile(sInFile)      ' Save the time the data was signed as a signer attribute   ' NOTE: the name 'Attribute' is not a unique name   ' and must be preceded by 'CAPICOM.'   Dim oSigningTimeAttr As New CAPICOM.Attribute   oSigningTimeAttr.Name = CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME   oSigningTimeAttr.Value = Now   oSigner.AuthenticatedAttributes.Add oSigningTimeAttr      ' Sign the content using the signer's private key.   ' A value of 'True' in the second parameter indicates that the   ' content signed is not included in the signature string.   ' A value of 'False' indicates that it is   Dim s As String   s = oSignedData.Sign(oSigner, False, CAPICOM_ENCODE_BASE64)   ' Strip off the last blank line   s = Mid(s, 1, Len(s) - 2)   ' Add the PKCS #7 header and footer so that the signature conforms to what   ' OpenSSL expects.   s = "-----BEGIN PKCS7-----" + vbCrLf + s + vbCrLf + "-----END PKCS7-----"   WriteFile sOutFile, s      Set oSignedData = Nothing   Set oSigner = Nothing   Set oSigningTimeAttr = Nothing End Sub Sub EnvelopeFile(ByVal sInFile As String, ByVal sOutFile As String)   ' Open the MY store and retrieve the first certificate from the   ' store. The signing operation will only work if this certificate is   ' valid and has access to the signer's private key.   Dim oCertStore As New Store   oCertStore.Open CAPICOM_CURRENT_USER_STORE, "My", CAPICOM_STORE_OPEN_READ_ONLY      ' Declare and initialize an EnvelopedData object   Dim oEnvelopedData As New EnvelopedData   oEnvelopedData.Content = ReadFile(sInFile)      ' The signer's certificate is at index 1   ' NOTE that you can add as many recipient certs as you like.   oEnvelopedData.Recipients.Add oCertStore.Certificates.Item(1)   Set oCertStore = Nothing      ' Set the encryption algorithm and key length. Comment out   ' or remove the following lines to use the default algorithm   ' and key length. The triple DES algorithm and 128 bit key   ' length may not be supported.   oEnvelopedData.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM_3DES 'or ENCRYPTION_ALGORITHM_RC4   oEnvelopedData.Algorithm.KeyLength = CAPICOM_ENCRYPTION_KEY_LENGTH_128_BITS   'Declare the string that will hold the enveloped message.   Dim sEnvelopedMessage As String   'Encrypt the message into sEnvelopedMessage. The enveloped message   'string contains everything that an intended recipient will need to   'decrypt the message, including information on the encryption algorithm 'key length.   sEnvelopedMessage = oEnvelopedData.Encrypt   ' Release the EncryptedData object and the Store object.   Set oEnvelopedData = Nothing   ' Add the MIME headers to the content   Dim sMimeHeader As String   sMimeHeader = "MIME-Version: 1.0" + vbCrLf   sMimeHeader = sMimeHeader + "Content-Disposition: attachment; filename=""smime.p7m""" + vbCrLf   sMimeHeader = sMimeHeader + "Content-Type: application/x-pkcs7-mime; name=""smime.p7m""" + vbCrLf   ' these last two line feeds are important   sMimeHeader = sMimeHeader + "Content -Transfer - Encoding: base64" + vbCrLf + vbCrLf   sEnvelopedMessage = sMimeHeader + sEnvelopedMessage   WriteFile sOutFile, sEnvelopedMessage End Sub Sub WriteFile(ByVal sFileName As String, ByVal sText As String)   Dim oFS, oTF As Object   Set oFS = CreateObject("Scripting.FileSystemObject")   Set oTF = oFS.OpenTextFile(sFileName, ForWriting, True, TristateFalse)   oTF.Write (sText)   oTF.Close   Set oTF = Nothing   Set oFS = Nothing End Sub Function ReadFile(ByVal sFileName As String) As String   Dim oFS, oTF As Object   Set oFS = CreateObject("Scripting.FileSystemObject")   Set oTF = oFS.OpenTextFile(sFileName, ForReading, False, TristateFalse)   ReadFile = oTF.ReadAll   oTF.Close   Set oTF = Nothing   Set oFS = Nothing End Function

Then to decrypt and verify the message you can use the OpenSSL command-line tools with the smime command.

This first command will take the envelope and decrypt it to find the signature (containing the plain-text content).
 openssl smime -decrypt -in smime.txt -recip ..\cert.pem -inkey ..\privkey.pem -out signature.unicode.txt
Recall that the output from CAPICOM is always UNICODE so we need to translate the files back to ANSI before proceeding. I use a simple tool that I wrote to do this.
 Unicode2AnsiConvert.exe signature.unicode.txt signature.txt
This second command will take the signature and verify it. If the signature is verified the tool will write “Verification successful” to the console. Please note that verification requires correct certificate resolution to be configured for the machine but this is necessary for security.
 openssl smime -verify -in signature.txt -inform PEM -out message.unicode.txt
Finally, translate the message to ANSI.
 Unicode2AnsiConvert.exe message.unicode.txt message.txt
The resulting message.txt file will contain the original message input into CAPICOM.

Posted at 4/13/2004 01:20:00 PM |