当前位置:文档之家› Two-state folding over a weak free-energy barrier

Two-state folding over a weak free-energy barrier

a r

X i v

:

q

-

b

i o

/

3

1

2

4

6

v

1

[

q

-

b i

o

.

B

M

]

3

D

e

c

2

3

LU TP 03-07April 28,2003Two-State Folding over a Weak Free-Energy Barrier Giorgio Favrin,Anders Irb¨a ck,Bj¨o rn Samuelsson and Stefan Wallin ?Complex Systems Division,Department of Theoretical Physics Lund University,S¨o lvegatan 14A,SE-22362Lund,Sweden http://www.thep.lu.se/complex/Abstract:We present a Monte Carlo study of a model protein with 54amino acids that folds directly to its native three-helix-bundle state without forming any well-de?ned inter-mediate state.The free-energy barrier separating the native and unfolded states of this protein is found to be weak,even at the folding temperature.Nevertheless,we ?nd that melting curves to a good approximation can be described in terms of a sim-ple two-state system,and that the relaxation behavior is close to single exponential.

The motion along individual reaction coordinates is roughly di?usive on timescales beyond the recon?guration time for an individual helix.A simple estimate based on di?usion in a square-well potential predicts the relaxation time within a factor of two.

Keywords:protein folding,folding thermodynamics,folding kinetics,two-state sys-tem,di?usive dynamics,Monte Carlo simulation.

1Introduction

In a landmark paper in1991,Jackson and Fersht[1]demonstrated that chymotrypsin inhibitor2folds without signi?cantly populating any meta-stable intermediate state. Since then,it has become clear that this protein is far from unique;the same be-havior has been observed for many small single-domain proteins[2].It is tempting to interpret the apparent two-state behavior of these proteins in terms of a simple free-energy landscape with two minima separated by a single barrier,where the min-ima represent the native and unfolded states,respectively.If the barrier is high,this picture provides an explanation of why the folding kinetics are single exponential, and why the folding thermodynamics show two-state character.

However,it is well-known that the free-energy barrier,?F,is not high for all these proteins.In fact,assuming the folding timeτf to be given byτf=τ0exp(?F/kT) withτ0~1μs[3],it is easy to?nd examples of proteins with?F values of a few kT [2](k is Boltzmann’s constant and T the temperature).It should also be mentioned that Garcia-Mira et al.[4]recently found a protein that appears to fold without crossing any free-energy barrier.

Suppose the native and unfolded states coexist at the folding temperature and that there is no well-de?ned intermediate state,but that a clear free-energy barrier is missing.What type of folding behavior should one then expect?In particular,would such a protein,due to the lack of a clear free-energy barrier,show easily detectable deviations from two-state thermodynamics and single-exponential kinetics?Here we investigate this question based on Monte Carlo simulations of a designed three-helix-bundle protein[5,6,7].

Our study consists of three parts.First,we investigate whether or not melting curves for this model protein show two-state character.Second,we ask whether the relaxation behavior is single exponential or not,based on ensemble kinetics at the folding temperature.Third,inspired by energy-landscape theory(for a recent review, see Refs.[8,9]),we try to interpret the folding dynamics of this system in terms of simple di?usive motion in a low-dimensional free-energy landscape.

2Model and Methods

2.1The Model

Simulating atomic models for protein folding remains a challenge,although progress is currently being made in this area[10,11,12,13,14,15,16].Here,for computational e?ciency,we consider a reduced model with5–6atoms per amino acid[5],in which the side chains are replaced by large Cβhttps://www.doczj.com/doc/e517553746.html,ing this model,we study a designed three-helix-bundle protein with54amino acids.

The model has the Ramachandran torsion anglesφi,ψi as its degrees of freedom, and is sequence-based with three amino acid types:hydrophobic(H),polar(P)and glycine(G).The sequence studied consists of three identical H/P segments with 16amino acids each(PPHPPHHPPHPPHHPP),separated by two short GGG seg-ments[17,18].The H/P segment is such that it can make anα-helix with all the hydrophobic amino acids on the same side.

The interaction potential

E=E loc+E ev+E hb+E hp(1) is composed of four terms.The local potential E loc has a standard form with threefold

symmetry,

E loc=?φ

2 i(1+cos3ψi).(2)

The excluded-volume term E ev is given by a hard-sphere potential of the form

E ev=?ev ′i

where the functions u(r)and v(α,β)are given by

u(r)=5 σhb r 10(5)

(6)

v(α,β)= cos2αcos2βα,β>90?

0otherwise

The sum in Eq.4runs over all possible HO pairs,and r ij denotes the HO distance,αij the NHO angle,andβij the HOC′angle.The last term of the potential,the hydrophobicity term E hp,is given by

E hp=?hp i

To speed up the calculations,a cuto?radius r c is used,which is taken to be4.5?A for E ev and E hb,and8?A for E hp.Numerical values of all energy and geometry parameters can be found elsewhere[5].

The thermodynamic behavior of this three-helix-bundle protein has been studied before[5,6].These studies demonstrated that this model protein has the following properties:

?It does form a stable three-helix bundle,except for a twofold topological degen-eracy.These two topologically distinct states both contain three right-handed helices.They di?er in how the helices are arranged.If we let the?rst two helices form a U,then the third helix is in front of the U in one case(FU),and behind the U in the other case(BU).The reason that the model is unable to discriminate between these two states is that their contact maps are e?ectively very similar[19].

?It makes more stable helices than the corresponding one-and two-helix se-quences,which is in accord with the experimental fact that tertiary interactions generally are needed for secondary structure to become stable.

?It undergoes a?rst-order-like folding transition directly from an expanded state to the three-helix-bundle state,without any detectable intermediate state.At the folding temperature T f,there is a pronounced peak in the speci?c heat.

Here we analyze the folding dynamics of this protein in more detail,through an

As a measure of structural similarity with the native state,we monitor a parameter Q that we call nativeness(the same as in[5,6,7]).To calculate Q,we use represen-tative conformations for the FU and BU topologies,respectively,obtained by energy minimization.For a given conformation,we compute the root-mean-square devia-tionsδFU andδBU from these two representative conformations(calculated over all backbone atoms).The nativeness Q is then obtained as

Q=max exp ?δ2FU/(10?A)2 ,exp ?δ2BU/(10?A)2 ,(8) which makes Q a dimensionless number between0and1.

Energies are quoted in units of kT f,with the folding temperature T f de?ned as the spe-ci?c heat maximum.In the dimensionless energy unit used in our previous study[5], this temperature is given by kT f=0.6585±0.0006.

2.2Monte Carlo Methods

To simulate the thermodynamic behavior of this model,we use simulated temper-ing[20,21,22],in which the temperature is a dynamic variable.This method is chosen in order to speed up the calculations at low temperatures.Our simulations are started from random con?gurations.The temperatures studied range from0.95T f to1.37T f.

The temperature update is a standard Metropolis step.In conformation space we use two di?erent elementary moves:?rst,the pivot move in which a single torsion angle is turned;and second,a semi-local method[23]that works with seven or eight adjacent torsion angles,which are turned in a coordinated manner.The non-local pivot move is included in our calculations in order to accelerate the evolution of the system at high temperatures.

Our kinetic simulations are also Monte Carlo-based,and only meant to mimic the time evolution of the system in a qualitative sense.They di?er from our thermodynamic simulations in two ways:?rst,the temperature is held constant;and second,the non-local pivot update is not used,but only the semi-local method[23].This restriction is needed in order to avoid large unphysical deformations of the chain.

Statistical errors on thermodynamic results are obtained by jackknife analysis[24]of results from ten or more independent runs,each containing several folding/unfolding

di?cult to determine due to uncertainties about where the large-time behavior sets in and are therefore omitted.We estimate that the uncertainties on our calculated relaxation times are about 10%.The statistical errors on the results obtained by numerical solution of the di?usion equation are,however,signi?cantly smaller than this.

All ?ts of data discussed below are carried out by using a Levenberg-Marquardt procedure

[25].2.3Analysis

Melting curves for proteins are often described in terms of a two-state picture.In the two-state approximation,the average of a quantity X at temperature T is given by

X (T )=X u +X n K (T )

?t =?

?r +P (r,t )

?r ,(10)

where D (r )is the di?usion coe?cient.

This picture is not expected to hold on short timescales,due to the projection onto a single coordinate r ,but may still be useful provided that the di?usive behavior sets

?E/kT f T m/T f

(a)0.95 1.00 1.05 1.10?80

?60

?40?20

T/T f E hb /kT f (b)

0.95 1.00 1.05 1.10

10121416

18T/T f R g /?Figure 1:Temperature dependence of (a)the hydrogen-bond energy E hb and (b)the radius of gyration R g .The lines are ?ts to Eq.9.arti?cal statistical errors of 1%to our data points,an error size that is not uncommon for experimental data,then the ?ts become perfect with a χ2/dof close to unity.Fig.1shows the temperature dependence of the hydrogen-bond energy E hb and the radius of gyration R g ,along with our two-state ?ts.

Table 1gives a summary of our two-state ?ts.In particular,we see that the ?tted values of both the energy change ?E and the midpoint temperature T m are similar for the di?erent quantities.It is also worth noting that the T m values fall close to the folding temperature T f ,de?ned as the maximum of the speci?c heat.The di?erence between the highest and lowest values of T m is less than 1%.There is a somewhat larger spread in ?E ,but this parameter has a larger statistical error.

So,the melting curves show two-state character,and the ?tted parameters ?E and T m are similar for di?erent quantities.From this it may be tempting to conclude that the thermodynamic behavior of this protein can be fully understood in terms of a two-state system.The two-state picture is,nevertheless,an oversimpli?cation,as can be seen from the shapes of the free-energy pro?les F (E )and F (Q ).Fig.2shows these pro?les at T =T f .First of all,these pro?les show that the native and unfolded states coexist at T =T f ,so the folding transition is ?rst-order-like.However,there is no clear free-energy barrier separating the two states;F (Q )exhibits a very weak barrier,<1kT ,whereas F (E )shows no barrier at all.In fact,F (E )has the shape

?500501001505

6

7

8

E/kT f F (

0.00.20.40.60.8 1.0?1012Q F (Figure 2:Free-energy pro?les at T =T f for (a)the energy E and (b)the nativeness Q (dark bands).The light-grey bands show free energies F b for block averages (see Eq.12),using a block size of τb =106MC steps.Each band is centered around the expected value and shows statistical 1σerrors.

Phase transition terminology is,by necessity,ambiguous for a ?nite system like this,but if states with markedly di?erent E or Q coexist it does make sense to call the transition ?rst-order-like,even if a free-energy barrier is missing.At a second-order phase transition,the free-energy pro?le is wide,but the minimum remains unique.

3.2Kinetics

Our kinetic study is performed at T =T f .Using Monte Carlo dynamics (see Model and Methods),we study the relaxation of ensemble averages of various quantities.For this purpose,we performed a set of 3000folding simulations,starting from equi-librium conformations at temperature T 0≈1.06T f .At this temperature,the chain is extended and has a relatively low secondary-structure content (see Fig.1).

In the absence of a clear free-energy barrier (see Fig.2),it is not obvious whether or not the relaxation should be single exponential.To get an idea of what to expect for a system like this,we consider the relaxation of the energy E in a potential F (E )that has the form of a perfect square well at T =T f .For this idealized F (E )and a constant di?usion coe?cient D (E ),it is possible to solve Eq.10analytically for relaxation at

0.00.20.40.60.8 1.00.00.2

0.4

0.6

0.8

1.0

p 0

p 11551010

20Figure 3:Level diagram showing the deviation (in %)from a single exponential for di?usion in energy in a square well,based on the exact solution in Appendix A.The system relaxes at temperature T ,starting from the equilibrium distribution at temperature T 0.p is de?ned as p =( E ?E n )/?E sw ,where E is the average energy at temperature T ,and E n and ?E sw denote the lower edge and the width,respectively,of the square well.p can be viewed as a measure of the unfolded popu-lation at temperature T ,and is 0.5if T =T f .p 0is the the corresponding quantity at temperature T 0.As a measure of the deviation from a single exponential,we take δmax /δE (t 0),where δmax is the maximum deviation from a ?tted exponential and δE (t 0)=E (t 0)? E ,E (t 0)being the mean at the smallest time included in the ?t,t 0.Data at times shorter than 1%of the relaxation time were excluded from the ?t.condition that P (E,t =0)is the equilibrium distribution at temperature T https://www.doczj.com/doc/e517553746.html,ing this result,the deviation from single-exponential behavior can be mapped out as a function of T 0and T ,as is illustrated in Fig.3.The size of the deviation depends on both T 0and T ,but is found to be small for a wide range of T 0,T values.This clearly demonstrates that the existence of a free-energy barrier is not a prerequisite to observe single-exponential relaxation.

Let us now turn to the results of our simulations.Fig.4shows the relaxation of the average energy E and the average nativeness Q in Monte Carlo (MC)time.In both cases,the large-time data can be ?tted to a single exponential,which gives relaxation times of τ≈1.7·107and τ≈1.8·107for E and Q ,respectively,in units of elementary MC steps.The corresponding ?ts for the radius of gyration and the hydrogen-bond energy (data not shown)give relaxation times of τ≈2.1·107and

(a)

01072?1073?107

1030

100t (MC steps)δE (t )/kT f

(b)0107

2?1073?107

0.10.3

t (MC steps)?δQ (t )

Figure 4:Relaxation behavior of the three-helix-bundle protein at the folding tem-perature T f ,starting from the equilibrium ensemble at T 0≈1.06T f .(a)δE (t )=E (t )? E against simulation time t ,where E (t )is the average E after t MC steps (3000runs)and E denotes the equilibrium average (at T f ).(b)Same plot for the nativeness Q .

than the others,because the data points have larger errors in this case.

The di?erences between our four ?tted τvalues are small and most probably due to limited statistics for the large-time behavior.Averaging over the four di?erent variables,we obtain a relaxation time of τ≈1.8·107MC steps for this protein.The fact that the relaxation times for the hydrogen-bond energy and the radius of gyration are approximately the same shows that helix formation and chain collapse proceed in parallel for this protein.This ?nding is in nice agreement with recent experimental results for small helical proteins [29].For Q ,it is necessary to go to very short times in order to see any signi?cant devia-tion from a single exponential (see Fig.4).For E ,we ?nd that the single-exponential behavior sets in at roughly τ/3,which means that the deviation from this behavior is larger than in the analytical calculation above.On the other hand,for compar-isons with experimental data,we expect the behavior of Q to be more relevant than that of E .The simulations con?rm that the relaxation can be approximately single exponential even if there is no clear free-energy barrier.

To translate the relaxation time for this protein into physical units,we compare with

performed a kinetic simulation of this16-amino acid segment at the same tempera-ture,T=T f.This temperature is above the midpoint temperature for the one-helix segment,which is0.95T f[5].So,the isolated one-helix segment is unstable at T=T f, but makes frequent visits to helical states with low hydrogen-bond energy,E hb.To obtain the recon?guration time,we?tted the large-time behavior of the autocorrela-tion function for E hb,

C hb(t)= E hb(t)E hb(0) ? E hb(0) 2,(11) to an exponential.The exponential autocorrelation time,which can be viewed as a recon?guration time,turned out to beτh≈1.0·106MC steps.This is roughly a factor20shorter than the relaxation timeτfor the full three-helix bundle.Assuming the recon?guration time for an individual helix to be~0.2μs[30,31],we obtain relaxation and folding times of~4μs and~8μs,respectively,for the three-helix bundle.This is fast but not inconceivable for a small helical protein[2].In fact,the B domain of staphylococcal protein A is a three-helix-bundle protein that has been found to fold in<10μs,at37?C[32].

3.3Relaxation-Time Predictions

We now turn to the question of whether the observed relaxation time can be predicted based on the di?usion equation,Eq.10.For that purpose,we need to know not only the free energy F(r),but also the di?usion coe?cient D(r).Socci et al.[27] successfully performed this analysis for a lattice protein that exhibited a relatively clear free-energy barrier.Their estimate of D(r)involved an autocorrelation time for the unfolded state.The absence of a clear barrier separating the native and unfolded states makes it necessary to take a di?erent approach in our case.

The one-dimensional di?usion picture is not expected to hold on short timescales,but only after coarse-graining in time.A computationally convenient way to implement this coarse-graining in time is to study block averages b(t)de?ned by

1

b(t)=

?r sw D bτpred,0τpredτ

?

(a)

0501001500.000.01

0.02E/kT f P (E/kT f )

t =0τ/3τ

2τ05010015005?10?5

10?10?5E/kT f

D b (E/kT f )Figure 5:(a)Numerical solution of Eq.10with the energy as reaction coordinate.The distribution P (E,t )is shown for t =0,τ/3,τand 2τ(full lines),where τis the relaxation time.The dashed line is the equilibrium distribution.The di?usion coe?cient D b (

E )and the potential

F b (E )(light-gray band in Fig.2a)were both determined from numerical simulations,using a block size of τb =106MC steps (see Eq.12).(b)The space dependence of the di?usion coe?cient D b (E ).The band is centered around the expected value and shows the statistical 1σerror.

results in Fig.2do show this tendency,although the e?ect is not very strong.Fig.5b shows the di?usion coe?cient D b (E ),which is largest at intermediate values between the native and unfolded states.The behavior of D b (Q )(not shown)is the same in this respect.Hence,there is no sign of a kinetic bottleneck to folding for this protein.Given D b (r )and F b (r ),we solve Eq.10for P (r,t )by using the ?nite-di?erence scheme in Appendix B.The initial distribution P (r,t =0)is taken to be the same as in the kinetic simulations.We ?nd that the mean of P (r,t )shows single-exponential relaxation to a good approximation.An exponential ?t of these data gives us a new prediction,τpred ,for the relaxation time.

From Table 2it can be seen that the prediction obtained through this more elaborate calculation,τpred ,is not better than the previous one,τpred,0,at least not in Q ,despite that there exists a weak barrier in this coordinate (see Fig.2b).This means that the barrier in Q is too weak to be important for the relaxation rate.If the underlying di?usion picture,Eq.10,had been perfect,τpred would have been equal to τ,as obtained from the kinetic simulations.Our results show that this is not the case.

equation.

If more accurate relaxation time predictions are needed,there are di?erent ways to proceed.One possible way is to simply increase the block size.However,for the calculation to be useful,the block size must remain small compared to the relaxation time.A more interesting possibility is to re?ne the simple di?usion picture de?ned by Eq.10,in which,in particular,non-Markovian e?ects are ignored.Such e?ects may indeed a?ect folding times[33,9].Yet another possibility is to use a combination of a few di?erent variables,perhaps E and Q,instead of a single reaction coordinate[34, 35,9].With a multidimensional representation of the folding process,non-Markovian e?ects could become smaller.

4Summary and Discussion

We have analyzed the thermodynamics and kinetics of a designed three-helix-bundle protein,based on Monte Carlo calculations.We found that this model protein shows two-state behavior,in the sense that melting curves to a good approximation can be described by a simple two-state system and that the relaxation behavior is close to single exponential.A simple two-state picture is,nevertheless,an oversimpli?cation, as the free-energy barrier separating the native and unfolded states is weak( 1kT). The weakness of the barrier implies that a?tted two-state parameter such as?E has no clear physical meaning,despite that the two-state?t looks good.

Reduced[36,18,37,38,39]and all-atom[40,41,11,10,14,42]models for small helical proteins have been studied by many other groups.Most of these studies relied on so-called Gˉo-type[43]potentials.It should therefore be pointed out that our model is sequence-based.

Using an extended version of this model that includes all atoms,we recently found similar results for two peptides,anα-helix and aβ-hairpin[16].Here the calculated melting curves could be directly compared with experimental data,and a reasonable quantitative agreement was found.

The smallness of the free-energy barrier prompted us to perform an analytical study of di?usion in a square-well potential.Here we studied the relaxation behavior at temperature T,starting from the equilibrium distribution at temperature T0,for ar-bitrary T and T0.We found that this system shows a relaxation behavior that is

free-energy barrier.We also made relaxation-time predictions based on this square-well approximation.Here we took the di?usion coe?cient to be constant.It was determined assuming the dynamics to be di?usive on timescales beyond the recon?g-uration time for an individual helix.The predictions obtained this way were found to agree within a factor of two with observed relaxation times,as obtained from the kinetic simulations.So,this calculation,based on the two simplifying assumptions that the potential is a square well and that the di?usion coe?cient is constant,gave quite good results.A more detailed calculation,in which these two additional as-sumptions were removed,did not give better results.This shows that the underlying di?usion picture leaves room for improvement.

Our kinetic study focused on the behavior at the folding temperature T f,where the native and unfolded states,although not separated by a clear barrier,are very di?erent,which makes the folding mechanism transparent.In particular,we found that helix formation and chain collapse could not be separated,which is in accord with experimental data by Krantz et al.[29].The di?erence between the native and unfolded states is much smaller at the lowest temperature we studied,0.95T f,because the unfolded state is much more native-like here.Mayor et al.[44]recently reported experimental results on a three-helix-bundle protein,the engrailed homeodomain[45], including a characterization of its unfolded state.In particular,the unfolded state was found to have a high helix content.This study was performed at a temperature below0.95T f.It would be very interesting to see what the unfolded state of this protein looks like near T f.In our model,there is a signi?cant decrease in helix content of the unfolded state as the temperature increases from0.95T f to T f.

It is instructive to compare our results with those of Zhou and Karplus[37],who discussed two folding scenarios for helical proteins,based on a Gˉo-type Cαmodel. In their?rst scenario,folding is fast,without any obligatory intermediate,and helix formation occurs before chain collapse.In the second scenario,folding is slow with an obligatory intermediate on the folding pathway,and helix formation and chain collapse occur simultaneously.The behavior we?nd does not match any of these two scenarios.In our case,helix formation and chain collapse occur in parallel but folding is nevertheless fast and without any well-de?ned intermediate state. Acknowledgments

This work was in part supported by the Swedish Foundation for Strategic Research and the Swedish Research Council.

Appendix A:Di?usion in a square well

Here we discuss Eq.10

in the situation when the reaction coordinate r is the energy E ,and the potential F (E )is a square well of width ?E sw at T =T f .This means that the equilibrium distribution is given by P eq (E )∝exp(?δβE )if E is in the square well and P eq (E )=0otherwise,where δβ=1/kT ?1/kT f .Eq.10then becomes

?P (E,t )?E

D ?P (E,t )?

E 2sw π2k 2+1

π2k 2+(δβ0?14δβ2?E 2sw 2,(16)where

B k =4δβ0?E sw 2

δβ0?E sw × cosh 12δβ)?E sw cosh 12(δβ0?14δβ?E sw if k even (17)Finally,the equilibrium average is E =E n +E u

δβ??E sw

2δβ?E sw ,(18)

It is instructive to consider the behavior of this solution when |δβ?δβ0|?1/?E sw .The expression for the expansion coe?cients can then be simpli?ed to

A k ≈

B k ?E sw π2k 2(δβ?δβ0)?E sw 4

δβ2?E 2sw 3(19)with B k ≈4δβ0?E sw 2δβ0?E sw × cosh 214δβ?E sw if k even (20)

Note that A k scales as k 2if k ?1

2π|δβ|?E sw .Note also that the last factor in B k suppresses A k for even k if T is close to T f .From these

two facts it follows that |A 1|is much larger than the other |A k |if T is near T f .This makes the deviation from a single exponential small.

Appendix B:Numerical solution of the di?usion equation To solve Eq.10numerically for arbitrary D (r )and F (r ),we choose a ?nite-di?erence scheme of Crank-Nicolson type with good stability properties.To obtain this scheme we ?rst discretize r .Put r j =j ?r ,D j =D (r j )and F j =F (r j ),and let p (t )be the vector with components p j (t )=P (r j ,t ).Approximating the RHS of Eq.10with suitable ?nite di?erences,we obtain

d p

?r 2 D j +1/2(p j +1(t )?p j (t ))?D j ?1/2(p j (t )?p j ?1(t ))

+1

2 Ap n +Ap n +1 .(23)

This equation can be used to calculate how P (r,t )evolves with time.It can be readily solved for p n +1because the matrix A is tridiagonal.

References

[1]Jackson S.E.,and A.R.Fersht.1991.Folding of chymotrypsin inhibitor2.1. Evidence for a two-state transition.Biochemistry30:10428-10435.

[2]Jackson S.E.1998.How do small single-domain proteins fold?Fold.Des.3:R81-R91.

[3]Hagen S.J.,J.Hofrichter,A.Szabo,and W.A.Eaton.1996.Di?usion-limited contact formation in unfolded cytochrome C:Estimating the maximum rate of protein https://www.doczj.com/doc/e517553746.html,A93:11615-11617.

[4]Garcia-Mira M.M.,M.Sadqi,N.Fischer,J.M.Sanchez-Ruiz,and V.M?u noz.2002. Experimental identi?cation of downhill protein folding.Science298:2191-2195.

[5]Irb¨a ck A.,F.Sjunnesson,and S.Wallin.2000.Three-helix-bundle protein in a Ramachandran https://www.doczj.com/doc/e517553746.html,A97:13614-13618.

[6]Irb¨a ck A.,F.Sjunnesson,and S.Wallin.2001.Hydrogen bonds,hydrophobicity forces and the character of the collapse transition.J.Biol.Phys.27:169-179. [7]Favrin G.,A.Irb¨a ck,and S.Wallin.2002.Folding of a small helical protein using hydrogen bonds and hydrophobicity forces.Proteins47:99-105.

[8]Plotkin S.S.,and J.N.Onuchic.2002.Understanding protein folding with energy landscape theory.Part I:Basic concepts.Q.Rev.Biophys.35:111-167.

[9]Plotkin S.S.,and J.N.Onuchic.2002.Understanding protein folding with energy landscape theory.Part II:Quantitative aspects.Q.Rev.Biophys.35:205-286. [10]Kussell E.,J.Shimada,and E.I.Shakhnovich.2002.A structure-based method for derivation of all-atom potentials for protein https://www.doczj.com/doc/e517553746.html,A 99:5343-5348.

[11]Shen M.Y.,and K.F.Freed.2002.All-atom fast protein folding simulations:The villin headpiece.Proteins49:439-445.

[12]Zhou R.,and B.J.Berne.2002.Can a continuum solvent model reproduce the free energy landscape of aβ-hairpin folding in water?https://www.doczj.com/doc/e517553746.html,A 99:12777-12782.

[13]Shea J.-E.,J.N.Onuchic,and C.L.Brooks III.2002.Probing the folding free energy landscape of the src-SH3protein https://www.doczj.com/doc/e517553746.html,A

[14]Zagrovic B.,C.D.Snow,M.R.Shirts,and V.S.Pande.2002.Simulation of folding of a small alpha-helical protein in atomistic detail using worldwide-distributed computing.J.Mol.Biol.323:927-937.

[15]Clementi C.,A.E.Garc′?a,and J.N.Onuchic.2003.Interplay among tertiary con-tacts,secondary structure formation and side-chain packing in the protein folding mechanism:all-atom representation study of Protein L.J.Mol.Biol.326:933-954.

[16]Irb¨a ck A.,B.Samuelsson,F.Sjunnesson,and S.Wallin.2003.Thermodynamics ofα-andβ-structure formation in proteins.Preprint submitted to Biophys.J.

[17]Guo Z.,and D.Thirumalai.1996.Kinetics and thermodynamics of folding of a de novo designed four-helix bundle protein.J.Mol.Biol.263:323-343.

[18]Takada S.,Z.Luthey-Schulten,and P.G.Wolynes.1999.Folding dynamics with nonadditive forces:A simulation study of a designed helical protein and a random heteropolymer”,J.Chem.Phys.110:11616-11628.

[19]Wallin S.,J.Farwer,and U.Bastolla.2003.Testing similarity measures with continuous and discrete protein models.Proteins50:144-157.

[20]Lyubartsev A.P., A.A.Martsinovski,S.V.Shevkunov,and P.N.Vorontsov-Velyaminov.1992.New approach to Monte Carlo calculation of the free energy: Method of expanded ensembles.J.Chem.Phys.96:1776-1783.

[21]Marinari E.,and G.Parisi.1992.Simulated tempering:A new Monte Carlo scheme.Europhys.Lett.19:451-458.

[22]Irb¨a ck A.,and F.Potthast.1995.Studies of an o?-lattice model for protein folding:Sequence dependence and improved sampling at?nite temperature.J. Chem.Phys.103:10298-10305.

[23]Favrin G,A.Irb¨a ck,and F.Sjunnesson.2001.Monte Carlo update for chain molecules:Biased Gaussian steps in torsional space,J.Chem.Phys.114:8154-8158.

[24]Miller R.G.1974.The jackknife-a review.Biometrika61:1-15.

[25]Press W.H.,B.P.Flannery,S.A.Teukolsky,and W.T.Vetterling.1992.Numer-ical Recipes in C:The Art of Scienti?c Computing.Cambridge University Press, Cambridge.

[26]Bryngelson J.D.,J.N.Onuchic,N.D.Socci,and P.G.Wolynes.1995.Funnels, pathways,and the energy landscape of protein folding:A synthesis.Proteins

c语言中函数malloc的用法

c语言中函数malloc的用法 c语言中函数malloc的用法的用法如下:一、malloc()和free()的基本概念以及基本用法:1、函数原型及说明:void *malloc(long NumBytes):该函数分配了NumBytes个字节,并返回了指向这块内存的指针。 如果分配失败,则返回一个空指针(NULL)。 关于分配失败的原因,应该有多种,比如说空间不足就是一种。 void free(void *FirstByte):该函数是将之前用malloc分配的空间还给程序或者是操作系统,也就是释放了这块内存,让它重新得到自由。 2、函数的用法:其实这两个函数用起来倒不是很难,也就是malloc()之后觉得用够了就甩了它把它给free()了,举个简单例子:// Code...char *Ptr = NULL;Ptr = (char *)malloc(100 * sizeof(char));if (NULL == Ptr){exit (1);}gets(Ptr);// code...free(Ptr);Ptr = NULL;// code...就是这样!当然,具体情况要具体分析以及具体解决。 比如说,你定义了一个指针,在一个函数里申请了一块内存然后通过函数返回传递给这个指针,那么也许释放这块内存这项工作就应该留给其他函数了。 3、关于函数使用需要注意的一些地方:A、申请了内存空间后,必须检查是否分配成功。 B、当不需要再使用申请的内存时,记得释放;释放后应该把指向这块内存的指针指向NULL,防止程序后面不小心使用了它。

C、这两个函数应该是配对。 如果申请后不释放就是内存泄露;如果无故释放那就是什么也没有做。 释放只能一次,如果释放两次及两次以上会 D、虽然malloc()函数的类型是(void *),任何类型的指针都可以转换成(void *),但是最好还是在前面进行强制类型转换,因为这样可以躲过一些编译器的检查。 二、malloc()到底从哪里得来了内存空间:1、malloc()到底从哪里得到了内存空间?答案是从堆里面获得空间。 也就是说函数返回的指针是指向堆里面的一块内存。 操作系统中有一个记录空闲内存地址的链表。 当操作系统收到程序的申请时,就会遍历该链表,然后就寻找第一个空间大于所申请空间的堆结点,然后就将该结点从空闲结点链表中删除,并将该结点的空间分配给程序。 就是这样!说到这里,不得不另外插入一个小话题,相信大家也知道是什么话题了。 什么是堆?说到堆,又忍不住说到了栈!什么是栈?下面就另外开个小部分专门而又简单地说一下这个题外话:2、什么是堆:堆是大家共有的空间,分全局堆和局部堆。 全局堆就是所有没有分配的空间,局部堆就是用户分配的空间。 堆在操作系统对进程初始化的时候分配,运行过程中也可以向系

C语言高级编程及实例剖析

C语言高级编程及实例分析 第一章:内存管理 c语言对程序精心编译时,将函数中命令、语句编译成相应序列的机器指令代码,放在代码段;将已初始化的数据,如已赋值的全局变量、静态局部变量等,放在数据段;将未初始化的数据放在BBS段内;将临时数据,如函数调用时传递的参数、局部变量、返回调用时的地址等放在栈段内;而对一些动态变化的数据,如在程序执行中建立的一些数据结构,如链表,动态数组等,则放在堆结构中。 内存管理系统是操作系统的重要部分。C语言中使用malloc()函数和free()函数来分配和释放内存。再次释放已经释放的内存和释放未被分配的内存都会造成系统的崩溃。 1.1.1PC存储器结构 PC机存储器结构分为主存储器、外存储器和高速缓存几个部分。 1.1.4 内存编译模式 编译模式是指如何在内存中放置程序代码及数据,如何分配堆栈,并确认占用的内存大小及如何存取它们,当指定内存模式以后,语言编译程序将按事先选择好的内存模式编译组织程序。C语言提供了6种编译模式,分别是:微模式,小模式,紧凑模式,中模式,大模式和巨模式。 1.1.5 堆概念和结构 堆是一种动态的存储结构(存储链表,动态数组等),实际上就是数据段的自由存储区。 1.1.6 堆管理函数 1.malloc()函数 用来分配内存。函数原型为void *malloc(unsigned size) 如:int *p;

P= (int*)malloc(sizeof(int)); 如果要分配100个int型的空间时,表示为:int *p=(int*)malloc (sizeof(int)); 2.free()函数 用来释放内存。函数原型为void *free(指针变量) 如:int *p=(int *)malloc(4); *p=100; free(p); 3.realloc()函数 用来重调空间的大小,函数声明为:void *realloc(void *block,int size); block是指向要扩张或缩小的内存空间的指针。Size指定新的大小。 4.calloc()函数 用来分配一个能容纳n个元素,每个元素长度为size的内存空间。函数声明为void *calloc (size_t nelem,size_t elsize)。该函数将分配一个容量为nelem *size大小的空间,并用0初始化该内存区域,即每个地址装入0.该函数将返回一个指向分配空间的指针。如果没有空间可用,则返回NULL指针。若在大数据模式下建立远堆,则可用farmalloc函数。 1.2.2 函数剖析 1 函数init_Heap() 实现了初始化内存分配程序的功能 2函数My_Free() 完成函数释放内存的功能 3函数Allocate()

linux 内存相关操作函数

Linux内核中内存相关的操作函数 1、kmalloc()/kfree() static __always_inline void *kmalloc(size_t size, gfp_t flags) 内核空间申请指定大小的内存区域,返回内核空间虚拟地址。在函数实现中,如果申请的内存空间较大的话,会从buddy系统申请若干内存页面,如果申请的内存空间大小较小的话,会从slab系统中申请内存空间。 gfp_t flags 的选项较多。参考内核文件gfp.h. 在函数kmalloc()实现中,如果申请的空间较小,会根据申请空间的大小从slab中获取;如果申请的空间较大,如超过一个页面,会直接从buddy系统中获取。 2、vmalloc()/vfree() void *vmalloc(unsigned long size) 函数作用:从高端(如果存在,优先从高端)申请内存页面,并把申请的内存页面映射到内核的动态映射空间。vmalloc()函数的功能和alloc_pages(_GFP_HIGHMEM)+kmap() 的功能相似,只所以说是相似而不是相同,原因在于用vmalloc()申请的物理内存页面映射到内核的动态映射区(见下图),并且,用vmalloc()申请的页面的物理地址可能是不连续的。而alloc_pages(_GFP_HIGHMEM)+kmap()申请的页面的物理地址是连续的,被映射到内核的KMAP区。 vmalloc分配的地址则限于vmalloc_start与vmalloc_end之间。每一块vmalloc分配的内核虚拟内存都对应一个vm_struct结构体(可别和vm_area_struct搞混,那可是进程虚拟内存区域的结构),不同的内核虚拟地址被4k大小的空闲区间隔,以防止越界--见下图)。与进程虚拟地址的特性一样,这些虚拟地址与物理内存没有简单的位移关系,必须通过内核页表才可转换为物理地址或物理页。它们有可能尚未被映射,在发生缺页时才真正分配物理页面。 如果内存紧张,连续区域无法满足,调用vmalloc分配是必须的,因为它可以将物理不连续的空间组合后分配,所以更能满足分配要求。vmalloc可以映射高端页框,也可以映射底端页框。vmalloc的作用只是为了提供逻辑上连续的地址… 注意:在申请页面时,如果注明_GFP_HIGHMEM,即从高端申请。则实际是优先从高端内存申请,顺序为(分配顺序是HIGH, NORMAL, DMA )。 3、alloc_pages()/free_pages() 内核空间申请指定个数的内存页,内存页数必须是2^order个页。 alloc_pages(gfp_mask, order) 中,gfp_mask 是flag标志,其中可以为_ _GFP_DMA、_GFP_HIGHMEM 分别对应DMA和高端内存。

linux的system () 函数详解

linux的system () 函数详解 system(执行shell 命令) 相关函数 fork,execve,waitpid,popen 表头文件 #i nclude 定义函数 int system(const char * string)? 函数说明 system()会调用fork()产生子进程,由子进程来调用/bin/sh-c string来执行参数string字符串所代表的命令,此命>令执行完后随即返回原调用的进程。在调用system()期间SIGCHLD 信号会被暂时搁置,SIGINT和SIGQUIT 信号则会被忽略。 返回值 =-1:出现错误 =0:调用成功但是没有出现子进程 >0:成功退出的子进程的id 如果system()在调用/bin/sh时失败则返回127,其他失败原因返回-1。若参数string为空指针(NULL),则返回非零值>。如果system()调用成功则最后会返回执行shell命令后的返回值,但是此返回值也有可能为 system()调用/bin/sh失败所返回的127,因此最好能再检查errno 来确认执行成功。 附加说明 在编写具有SUID/SGID权限的程序时请勿使用system(),system()会继承环境变量,通过环境变量可能会造成系统安全的问题。 范例 #i nclude main() { system(“ls -al /etc/passwd /etc/shadow”)? } 执行结果: -rw-r--r-- 1 root root 705 Sep 3 13 :52 /etc/passwd -r--------- 1 root root 572 Sep 2 15 :34 /etc/shado 例2: char tmp[]? sprintf(tmp,"/bin/mount -t vfat %s /mnt/usb",dev)? system(tmp)? 其中dev是/dev/sda1。

c语言中free的用法如何工作.doc

c语言中free的用法如何工作c语言中free的用法:malloc()和free() 1、函数原型及说明: void *malloc(long NumBytes):该函数分配了NumBytes个字节,并返回了指向这块内存的指针。如果分配失败,则返回一个空指针(NULL)。 关于分配失败的原因,应该有多种,比如说空间不足就是一种。 void free(void *FirstByte):该函数是将之前用malloc分配的空间还给程序或者是操作系统,也就是释放了这块内存,让它重新得到自由。 2、函数的用法: 其实这两个函数用起来倒不是很难,也就是malloc()之后觉得用够了就甩了它把它给free()了,举个简单例子: 程序代码: // Code... char *Ptr = NULL; Ptr = (char *)malloc(100 * sizeof(char)); if (NULL == Ptr) { exit (1); } gets(Ptr);

// code... free(Ptr); Ptr = NULL; // code... 就是这样!当然,具体情况要具体分析以及具体解决。比如说,你定义了一个指针,在一个函数里申请了一块内存然后通过函数返回传递给这个指针,那么也许释放这块内存这项工作就应该留给其他函数了。 3、关于函数使用需要注意的一些地方: A、申请了内存空间后,必须检查是否分配成功。 B、当不需要再使用申请的内存时,记得释放;释放后应该把指向这块内存的指针指向NULL,防止程序后面不小心使用了它。 C、这两个函数应该是配对。如果申请后不释放就是内存泄露;如果无故释放那就是什么也没有做。释放只能一次,如果释放两次及两次以上会 出现错误(释放空指针例外,释放空指针其实也等于啥也没做,所以释放空指针释放多少次都没有问题)。 D、虽然malloc()函数的类型是(void *),任何类型的指针都可以转换成(void *),但是最好还是在前面进行强制类型转换,因为这样可以躲过一 些编译器的检查。 好了!最基础的东西大概这么说!现在进入第二部分: c语言中free的用法:malloc()到底从哪里得来了内存空间 1、malloc()到底从哪里得到了内存空间?答案是从堆里面获得空间。也就是说函数返回的指针是指向堆里面的一块内存。

动物运动方式的多样性练习题

第16章第1节动物运动方式的多样性同步练习 一、选择题 1.下列有关动物运动的说法正确的是() A.动物运动方式的多样性是对不同生活环境的适应,虽然它们的运动器官不同,但它们的共同特点是:具有适应不同环境的特化的运动器官。 B.鸟类在不同的季节里都有迁徙行为。 C.能在空中飞行的动物只有鸟类和昆虫。 D.海蛇、草履虫、野鸭、河蚌的运动方式均是游泳。 2.世界上最大的鸟――鸵鸟的运动方式主要是() A.飞行 B.爬行 C.游泳 D.行走 3.选出运动方式相同的一组动物() A.河蟹、野鸭 B.袋鼠、鸵鸟 C.企鹅、麻雀 D.鳄鱼、蜥蜴 4.下列动物的运动方式主要为飞行的是: A 、鸵鸟 B、企鹅 C、蝙蝠 D、蚕蛹 5.动物通过运动提高了适应环境的能力,蜥蜴的主要运动方式为: A 、飞行 B、跳跃 C、爬行 D、奔跑 6.下列哪项不是鸟类迁徙的意义: A、获取足够的食物 B、寻找适宜的生活环境 C、产生有利变异 D、有利完成生殖活动 7.变形虫的运动依靠:

A、纤毛 B、鞭毛 C、伪足 D、伸缩泡 8.生活在亚洲丛林中的鼹鼠在伸展四肢的时候,可以看到其身体两侧皮肤的飞膜,由此可推测鼹鼠的运动方式是: A、滑翔 B、奔跑 C、爬行 D、飞翔 二、非选择题 1.阅读下面短文,回答问题: 一只可爱的小兔子在长满青草和开有小花的山坡上,一边沐浴着灿烂的阳光,一边品尝着清香可口的小草。它不时地移动着身体,走到最嫩的小草旁。突然,可爱的小精灵发现天空中一只老鹰迅速向下飞来,它飞快地向坡那边的林子里跑去。小白兔拼命地奔跑着,越过小沟,老鹰迅速地飞着、追着。小白兔终于躲进了林子,老鹰灰溜溜地飞走了。敌情解除后,小白兔发现林子那边的草长得更茂盛,花开的更艳丽,又自由地在这边草地上快活地舞蹈着。 (1)说出上面短文中描述了动物哪些运动方式_______________________________。 (2)试说出小白兔具有的运动本领对它有哪些意义。__________________________ ________________________________________________。 2.动物的运动因种类而不同,根据常见的类别填写下表:(填写对应序号)

linux添加系统调用实验步骤

首先,进入到内核源码目录/usr/src/linux-2.6.34中,添加自己的系统调用号。 lyh@lyh:~$ cd /usr/src/linux-2.6.34/ 系统调用号在unistd_32.h文件中定义。内核中每个系统调用号都是 以“__NR_"开头的,在该文件中添加自己的系统调用号 lyh@lyh:/usr/src/linux-2.6.34$ sudo vim arch/x86/include/asm/unistd_32.h #define __NR_pwritev 334 #define __NR_rt_tgsigqueueinfo 335 #define __NR_perf_event_open 336 #define __NR_recvmmsg 337 #define __NR_mycall 338 #ifdef __KERNEL__ #define NR_syscalls 339 在内核源文件中该行为#define NR_syscalls 338,在系统调用执行的过程中,system_call()函数会根据该值来对用户态进程的有效性进行检查。如果这个号大于或等于NR_syscalls,系统调用处理程序终止。所以应该将原来的#define NR_syscalls 338修改为#define NR_syscalls 339 其次,在系统调用表中添加相应的表项 (1)lyh@lyh:/usr/src/linux-2.6.34$ sudo vim arch/x86/kernel/syscall_table_32.S ENTRY(sys_call_table) .long sys_restart_syscall .long sys_exit ………………(这里省略了部分) .long sys_rt_tgsigqueueinfo .long sys_perf_event_open .long sys_recvmmsg .long sys_mycall (2)lyh@lyh:/usr/src/linux-2.6.34$ sudo vim arch/h8300/kernel/syscalls.S #include #include

动物的活动方式教案

动物的活动方式教案 【篇一:科学活动:动物的活动方式】 领域活动计划 科学活动:动物的活动方式(动植物) 一、活动目标: 1、发现动物的活动方式是多种多样的。 2、尝试用肢体动作模仿动作的活动方式。 二、活动准备: 经验准备:请家长带幼儿到动物园观察动物。 教材配套:教育挂图《领域活动—科学— 动物的活动方式》,操作材料:《送动物回家》,亲子手册:《领 域活动—谁会跑?》。 三、活动过程: 1、引导幼儿观察挂图,说说挂图上有哪些动物。 引导幼儿观察挂图上动物的活动方式,说说:挂图上的动物都有哪 些活动方式?哪些动物是用脚行走的?哪些动物主要是在天空飞行的?哪些动物是在水里游的? 2、说说动物都有哪些活动方式。 引导幼儿说说动物都有哪些活动方式?。 教师结合挂图,小结:小鸟有两只脚,能在地上行走,但主要是在 天上飞。河里的小鱼只能在水里游;而鳄鱼也有脚,既可以在水里游,也能在陆地上行走。猴子、老虎、小兔、斑马都是靠脚来行走的。蛇是靠身上的鳞片和地面摩擦来行走的。动物们的活动方式多 种多样。 3、送小动物回家。 引导幼儿完成操作材料《送动物回家》,按照动物的活动方式将贴 纸贴在合适的位置。 4、模仿游戏。 引导幼儿玩模仿动物活动的游戏。 玩法:有而模仿动物活动,边做动作边说:我是xxx,我会飞(跑、走、游、跳)。 5、引导幼儿放松,活动结束。 活动反思:

透过一个故事,遇到危险的长颈鹿,将孩子带进这个活动,长颈鹿在遇到危 险的时候,生活在不同地方的动物纷纷给出意见,以此来了解动物们分别生活的地方并有什么不同。孩子们兴趣很浓厚,特别是故事也很有吸引力。除了个别孩子讲话,大家都积极参与活动,有的积极发言。 【篇二:《动物运动的方式》教学设计(2)】 第一节动物的运动方式 教学过程 【篇三:《动物运动的方式》教学设计(1)】 动物的运动方式 ●教学目标 知识目标 1.列举生物多样性三个层次,概述它们之间的关系。 2.认识我国生物多样性的现状及其独特性。 3.说明保护多样性的重要意义。 能力目标 1.通过对课本资料分析,培养学生思考分析、归纳总结能力,学会收集和整理信息的方法。 2.培养学生在已有知识和生活经验的基础上获取新知识的能力、综合运用知识能力。 情感目标 1.通过本章学习,主要在同学心目中建立起生物(包括人)与环境相适应的辩证观点。 2.激发同学们保护生物栖息环境、保护生态系统的多样性的热情、渗透爱国主义教育。 ●教学重点 1.生物多样性的三个方面内容及它们之间的关系。 2.基因多样性。 3.说明保护多样性的意义。 4.培养学生收集和整理信息的能力。 ●教学难点 1.生物多样性的三个方面内容以及它们之间的关系。 2.基因多样性。

qt4中如何调用C函数(linux下)

qt默认的编程语言为C++语言。如果你用qt编译.c文件,会出现找不到C语言的默认头文件等错误(如:stdio.h等)。qt中不支持 extern "C"{}的这种写法,我前几天有一个C程序需要移植到Qt的工程中,本希望直接extern "C"就ok了,但发现qt4居然不支持这种写法。我的程序中用到了好几个linux系统头文件,是向串口发指令之类的程序,程序中用到了互斥锁并创建了一个线程。如果再用qt语言来写一遍的话我会挂掉的,所以没有办法,在网上找了半天,终于找到解决方法。 将.c文件编译为函数库的方式在qt下调用,这种方法貌似行得通,我就开始行动了。 下面的内容讲得比较多,比较全,比较适合初学者,是我在网上down的,给出了原网站的链接,最后给出了一个程序。经过自己整理好归纳如下: 需要说明的是:使用gcc可以将程序编译成动态库或者静态库的形式,它们在程序中的调用的方式也不尽相同,给出的程序中调用的是动态连接库。编译成动态的还是静态的根据自己的需要进行。如果原C程序编译的时候需要gcc的额外选项(如gcc -lpthread -o hello hello.c)等,建议采用动态的形式。 1.什么是静态连接库,什么是动态链接库 静态链接库与动态链接库都是共享代码的方式,如果采用静态链接库,则无论你愿不愿意,lib 中的指令都全部被直接包含在最终生成的EXE 文件中了。但是若使用DLL,该DLL 不必被包含在最终EXE 文件中,EXE 文件执行时可以“动态”地引用和卸载这个与EXE 独立的DLL 文件。静态链接库和动态链接库的另外一个区别在于静态链接库中不能再包含其他的动态链接库或者静态库,而在动态链接库中还可以再包含其他的动态或静态链接库。在windows和linux上都是相同的,只不过文件的格式不同而已。 https://www.doczj.com/doc/e517553746.html,/winston/archive/2008/07/05/1236273.html 2.gcc生成静态库和动态库 第1步:编辑得到举例的程序--hello.h、hello.c和main.c; 第2步:将hello.c编译成.o文件;

free函数和malloc函数

malloc 原型:extern void *malloc(unsigned int num_bytes); 用法:#include 或#include 功能:分配长度为num_bytes字节的内存块 说明:如果分配成功则返回指向被分配内存的指针,否则返回空指针NULL。 当内存不再使用时,应使用free()函数将内存块释放。 malloc的语法是:指针名=(数据类型*)malloc(长度),(数据类型*)表示指针. 举例: // malloc.c #include #include main() { char *p; clrscr(); // clear screen p=(char *)malloc(100); if(p) printf("Memory Allocated at: %x",p); else printf("Not Enough Memory!\n"); if(p) free(p); getchar(); return 0; } malloc()函数的工作机制 malloc函数的实质体现在,它有一个将可用的内存块连接为一个长长的列表的所谓空闲链表。调用malloc函数时,它沿连接表寻找一个大到足以满足用户请求所需要的内存块。然后,将该内存块一分为二(一块的大小与用户请求的大小相等,另一块的大小就是剩下的字节)。接下来,将分配给用户的那块内存传给用户,并将剩下的那块(如果有的话)返回到连接表上。调用free函数时,它将用户释放的内存块连接到空闲链上。到最后,空闲链会被切成很多的小内存片段,如果这时用户申请一个

初二生物动物运动方式的多样性教案

初二生物动物运动方式的多样性教案 第16章第1节动物运动方式的多样性 知识与能力目标: 举例说出动物运动方式的多样性;举例说明动物运动的重要性。 过程与方法目标: 通过调查、观察等,收集有关动物运动的资料,培养学生应用资料分析问题、解决问题的能力;通过观察、讨论、交流等进一步培养学生自主学习、合作学习、探究学习的能力。情感态度与价值观目标: 通过合作讨论,培养爱护大自然的情感,建立起生物(包括人)与环境相适应的辩证观点。激发同学们保护生物栖息环境、保护生态系统的多样性的热情。 教学重点: 举例说出动物运动方式的多样性;举例说明动物运动的重要性。 教学难点: 举例说明动物运动的重要性。 课前准备: 学生准备: ①调查和观察生活在水中、空中、地面下、地面上动物的运动方式并记录在表格中以及收集动物运动方式与生活环境

的关系的有关资料。 主要活动区域动物运动方式 天空 陆地 水中 ②收集有关动物运动的图片和画册。 ③准备各种典型的易于捕捉的较小型的动物。 教师准备: 制作多媒体课件;准备观察实验的用的小动物。 教学进程 课堂流程教师活动学生活动 情境导入 多媒体展示视频 去年东南亚发生海啸时,在泰国的普吉岛,有头大象驮着许多的孩子快速奔跑逃离了危险的海滩。那么动物的运动对动物有什么意义呢? 人们常说:海阔凭鱼跃,天高任鸟飞。不同的动物有着不同的运动方式。鹰击长空、鱼翔浅坻、麋鹿奔跑、企鹅游弋等等构成了大自然动态的美丽画卷。 下面我们先来欣赏一段大自然中动物运动的片段。 自然界中各种动物的运动 通过刚才的欣赏你看到了什么?有什么感受? 激起学生的好

奇心和求知欲,激发学习的主动性,提高学习兴趣 感受自然界中动物运动方式的多样性。说出动物在运动并感受大自然的美。

globalalloc、malloc和new的区别

GlobalAlloc是为了与Win16兼容才保留的,在Win32下不要使用。全局内存对象使用GlobalAlloc函数分配,在Windows 3.X 的时代,分配的内存可以有两种,全局的和局部的,例如GlobalAlloc和LocalAlloc。但在Win32的时代这些函数已经被废弃了,现在的内存只有一种就是虚存。在Win32中所有的进程所使用的内存区域是相互隔离的,每个进程都拥有自己的地址空间。而且系统使用了页面交换功能,就是利用磁盘空间来模拟RAM,在RAM中数据不使用时将会被交换到磁盘,在需要时将会被重新装入RAM。 两者都是在堆上分配内存区。 malloc()是C运行库中的动态内存分配函数,WINDOWS程序基本不使用了,因为它比WINDOWS内存分配函数少了一些特性,如,整理内存。 GlobalAlloc()是16位WINDOWS程序使用的API,返回一个内存句柄,在实际需要使用时,用GlobalLock()来实际得到内存区。但,32位WINDOWS系统中,应使用新的内存分配函数HeapAlloc()以得到更好的支持,GlobalAlloc()还可以用,主要是为了兼容。 HeapAlloc apply memory from kernel32.dll GlobalAlloc obsolete malloc apply memory form C runtime memory ,and C r untime applys from kernel32.dll new a wrapper of malloc but it is NOT a must for new to implement based on malloc. CoMemAlloc apply memory from kernel32.dll all are heap memory. recommend HeapAlloc for big block memory allocation recommend stack memory space. recommend HeapAlloc for big block memory allocation recommend stack memory space. malloc与free是C++/C语言的标准库函数,new/delete是C++的运算符。它们都可用于申请动态内存和释放内存。 对于非内部数据类型的对象而言,光用maloc/free无法满足动态对象的要求。对象在创建的同时要自动执行构造函数,对象在消亡之前要自动执行析构函数。由于malloc/free是库函数而不是运算符,不在编译器控制权限之内,不能够把执行构造函数和析构函数的任务强加于malloc/free。 因此C++语言需要一个能完成动态内存分配和初始化工作的运算符new,以及一个能完成清理与释放内存工作的运算符delete。注意new/delete不是库函数。 我们先看一看malloc/free和new/delete如何实现对象的动态内存管理,见示例7-8。 class Obj{ public : Obj(){ cout << “Initialization” << endl; } ~Obj(){ cout << “Destroy” << endl; } void Initialize(){ cout << “Initialization” << endl; } void Destroy(){ cout << “Destroy” << endl; } }; void UseMallocFree(){ Obj *a = (obj *)malloc(sizeof(obj)); // 申请动态内存

动态存储分配

动态存储分配在此之前,我们用于存储数据的变量和数组都必须在说明部分进行定义。C编译程序通过定义语句了解他们所需存储空间的大小,并预先为其分配适当的空间。这些空间一经分配,在变量或数组的生存期内是固定不变的。故称这种分配方式为“静态存储分配”。C语言中还有一种称作“动态存储分配”的内存空间分配方式:在程序执行期间需要空间来存储数据时,通过“申请”分配指定的内存空间;当有闲置不用的空间时,可以随时将其释放,由系统另作它用。用户可通过调用C语言提供的标准库函数来实现动态分配,从而得到指定数目的内存空间或释放指定的内存空间。ANSI C标准为动态分配系统定义了四个函数,它们是:malloc、calloc、free和realloc。使用这些函数时,必须在程序开头包含文件stdib.h。本节只介绍malloc、calloc和free函数的使用。1、malloc函数和free函数(1)malloc函数ANSI C标准规定malloc函数返回值的类型为void *,函数的调用形式为:malloc (size)。要求size的类型为unsigned int。malloc函数用来分配size个字节的存储区,返回一个指向存储区首地址的基类型为void的地址。若没有足够的内存单元供分配,函数返回空(NULL)。假设int型数据占2字节,float型数据占4字节存储单元,以下程序段将使pi指向一个int类型的存储单元,使pf指向一个float类型的存储单元。int *pi;float *pf;pi=(int *)malloc(2);pf=(float *)malloc(4);由于在ANSI C中malloc函数返回的地址为void *(无值型),故在调用函数时,必须利用强制类型转换将其转换成所需的类型。此处括号中的*号不可少,否则就转换成普通变量类型而不是指针类型了。若有以下语句段:if(pi!=NULL) *pi=6;if(pf!=NULL) *pf=3.8;赋值后数据的存储单元情况如图7.2所示。 pi pf图7.2由动态分配得到的存储单元没有名字,只能靠指针变量来引用它。一旦指针改变指向,原存储单元及所存储数据都将无法再引用。通过调用malloc函数所分配的动态存储单元中没有确定的初值。若不能确定数据类型所占字节数,可以使用sizeof运算符来求得。例如:pi=(int *) malloc(sizeof(int));pf=(float *) malloc(sizeof(float));这是一种常用的形式。它由系统来计算指定类型的字节数。(2)free函数函数的调用形式为:free(p);这里指针变量p必须指向由动态分配函数malloc分配的地址。free函数将指针p所指的存储空间释放,使这部分空间可以由系统重新支配。此函数没有返回值。2、calloc函数ANSI C 标准规定calloc函数返回值的类型为void *,函数的调用形式为:calloc(n,size);要求n和size的类型都为unsigned int。calloc函数用来给n个同一类型的数据项分配连续的存储空间。每个数据项的长度为size个字节。若分配成功,函数返回存储空间的首地址;否则返回空。由调用calloc函数所分配的存储单元,系统自动置初值0。例如:char *ps;ps=(char *)calloc(10,sizeof(char));以上函数调用语句开辟了10个连续的char类型的存储单元,由ps指向存储单元的首地址。每个存储单元可以存放一个字符。显然,使用calloc函数动态开辟的存储单元相当于开辟了一个一维数组。函数的第一个参数决定了一维数组的大小;第二个参数决定了数组元素的类型。函数的返回值就是数组的首地址。使用calloc函数开辟的动态存储单元,同样用free函数释放。

动物运动方式的多样性

动物运动方式的多样性 课题 : 《动物运动方式的多样性》学案时间: 2019年10月20日 主备: 张成班级:八年级()班学生____________ 【学习目标】 1、举例说出动物运动方式的多样性。 2、举例说明动物运动的重要性。 【自学导航】 自主学习:阅读课文50-51页,完成以下练习。 1、自然环境 2、动物的运动方式多种多样,主要有 3、动物在长期的进化过程中,逐渐形成一系列通过运动能力。 4、动物通过运动能迅速迁移到更为适宜的和,从而有利于自身的和。 【合作探究】 小组展开讨论,交流展示 E.飞行或滑翔 F.旋转式运动 G.翻筋斗运动 H.奔跑探究二:举例说动物运动的重要 性 动物通过运动主动的适应______________ 1. ___________________________________________________________________ 如:___________________________________________________________________ 2. ____________________________________________________________________ 如:__________________________________________________________________ 【分层检测】 一、应知应会 1、下列动物的运动方式主要为飞行的是: A 、鸵鸟 B、企鹅 C、蝙蝠 D、蚕蛹

2、动物通过运动提高了适应环境的能力,蜥蜴的主要运动方式为: A 、飞行 B、跳跃 C、爬行 D、奔跑 3、下列哪项不是鸟类迁徙的意义: A、获取足够的食物 B、寻找适宜的生活环境 C、产生有利变异 D、有利完成生殖活动 二、达标测评 1.世界上最大的鸟――鸵鸟的运动方式主要是------------------------------------------------------------------() A.飞行 B.爬行 C.游泳 D.行走 2.选出运动方式相同的一组动物-------------------------------------------------------------------------------------() A.河蟹、野鸭 B.袋鼠、鸵鸟 C.企鹅、麻雀 D.鳄鱼、蜥蜴 3.下列动物的运动方式主要为飞行的是:------------------------------------------------() A 、鸵鸟 B、企鹅 C、蝙蝠 D、蚕蛹 4.动物通过运动提高了适应环境的能力,蜥蜴的主要运动方式为:--------------------------() A 、飞行 B、跳跃 C、爬行 D、奔跑 6.下列哪项不是鸟类迁徙的意义:------------------------------------------------------() A、获取足够的食物 B、寻找适宜的生活环境 C、产生有利变异 D、有利完成生殖活动 7.生活在亚洲丛林中的鼹鼠在伸展四肢的时候,可以看到其身体两侧皮肤的飞膜,由此可推测鼹鼠的运动方式是:------------------------------------------------------------------------------() A、滑翔 B、奔跑 C、爬行 D、飞翔 三、拓展提升 一些鸟类通过迁徙来度过严寒的冬天,而其他动物是怎样度过冬天的?

Linux系统API函数手册簿

(一)文件操作篇 1、creat(建立文件) 头文件 1 #include 2 #include 3 #include 定义函数 1int creat(const char * pathname, mode_tmode); 函数说明 参数pathname指向欲建立的文件路径字符串。creat()相当于使用下列的调用方式调用open() 1 open(const char * pathname ,(O_CREAT|O_WRONLY|O_TRUNC)); 错误代码 关于参数mode请参考open()函数。 返回值 creat()会返回新的文件描述词,若有错误发生则会返回-1,并把错误代码设给errno。EEXIST 参数pathname所指的文件已存在。 EACCESS 参数pathname 所指定的文件不符合所要求测试的权限 EROFS 欲打开写入权限的文件存在于只读文件系统内 EFAULT 参数pathname 指针超出可存取的内存空间 EINVAL 参数mode 不正确。 ENAMETOOLONG 参数pathname太长。 ENOTDIR 参数pathname为一目录 ENOMEM 核心内存不足 ELOOP 参数pathname有过多符号连接问题。 EMFILE 已达到进程可同时打开的文件数上限 ENFILE 已达到系统可同时打开的文件数上限 附加说明 creat()无法建立特别的装置文件,如果需要请使用mknod()。 2、open(打开文件) 头文件 1 #include 2 #include 3 #include 定义函数

二级c常用函数总结(1)

***************数学相关**************** 1、函数名称: abs 函数原型: int abs(int x); 函数功能: 求整数x的绝对值 函数返回: 计算结果 参数说明: 所属文件: <>,<> 使用范例: #include <> #include <> int main() { int number=-1234; printf("number: %d absolute value: %d",number,abs(number)); return 0; } 2、函数名称: fabs 函数原型: double fabs(double x); 函数功能: 求x的绝对值. 函数返回: 计算结果 参数说明: 所属文件: <> 使用范例: #include <> #include <> int main()

{ float number=; printf("number: %f absolute value: %f",number,fabs(number)); return 0; } 3、函数名称: sqrt 函数原型: double sqrt(double x); 函数功能: 计算x的开平方. 函数返回: 计算结果 参数说明: x>=0 所属文件: <> 使用范例: #include <> #include <> int main() { double x=,result; result=sqrt(x); printf("The square root of %lf is %lf",x,result); return 0; } 4、函数名称: pow 函数原型: double pow(double x,double y); 函数功能: 计算以x为底数的y次幂,即计算x^y的值. 函数返回: 计算结果

malloc与new函数详解

malloc与new函数详解 热3已有1433 次阅读2009-07-20 08:32 malloc函数 原型:extern void *malloc(unsigned int num_bytes); 用法:#include 功能:分配长度为num_bytes字节的内存块 说明:如果分配成功则返回指向被分配内存的指针,否则返回空指针NULL。 当内存不再使用时,应使用free()函数将内存块释放。 举例: // malloc.c #include #include main() { char *p; clrscr(); // clear screen p=(char *)malloc(100); if(p) printf("Memory Allocated at: %x",p); else printf("Not Enough Memory!\n"); free(p); getchar(); return 0; } 函数声明(函数原型): void *malloc(int size); 说明:malloc 向系统申请分配指定size个字节的内存空间。返回类型是void* 类型。void* 表示未确定类型的指针。C,C++规定,void* 类型可以强制转换为任何其它类型的指针。 从函数声明上可以看出。malloc 和new 至少有两个不同: new 返回指定类型的指针,并且可以自动计算所需要大小。比如: int *p; p = new int; //返回类型为int* 类型(整数型指针),分配大小为sizeof(int); 或: int* parr; parr = new int [100]; //返回类型为int* 类型(整数型指针),分配大小为sizeof(int) * 100;

苏教版生物-八年级上册-八年级生物 动物运动方式的多样性精品教案

动物运动方式的多样性 知识与能力目标: 举例说出动物运动方式的多样性;举例说明动物运动的重要性。 过程与方法目标: 通过调查、观察等,收集有关动物运动的资料,培养学生应用资料分析问题、解决问题的能力;通过观察、讨论、交流等进一步培养学生自主学习、合作学习、探究学习的能力。情感态度与价值观目标: 通过合作讨论,培养爱护大自然的情感,建立起生物(包括人)与环境相适应的辩证观点。激发同学们保护生物栖息环境、保护生态系统的多样性的热情。 教学重点: 举例说出动物运动方式的多样性;举例说明动物运动的重要性。 教学难点: 举例说明动物运动的重要性。 课前准备: 学生准备: ①调查和观察生活在水中、空中、地面下、地面上动物的运动方式并记录在表格中以及收集动物运动方式与生活环境的关系的有关资料。 主要活动区域动物运动方式 天空 陆地 水中 ②收集有关动物运动的图片和画册。 ③准备各种典型的易于捕捉的较小型的动物。 教师准备: 制作多媒体课件;准备观察实验的用的小动物。 教学进程 课堂流程教师活动学生活动

动物运动方式的多样性 相互交流,探讨体验 多媒体展示图表 描述动物的运动 观察实验小结 大自然真是多姿多彩,令人赏心悦目。草 木荣枯,候鸟去来,蚂蚁搬家,蜻蜓低飞。动 物的运动是大自然最丰富也是最有韵律的动 态语言。 课前请同学们观察和调查了各种动物的 运动并将各种动物及运动方式按照活动区域 填入表格中,另外还请同学们收集动物运动的 图片。下面请同学们四人一组进行交流,①举 例说出各种动物的运动方式,并关注它们生活 的环境。②说出图片中各种动物的运动方式。 动物的运动方式多种多样,由于生活环境 的不同运动方式也不同。经过交流,引导学 生举例说出动物的运动方式有哪些? 主要活动区域运动方式 空中 陆地 水中 动物的运动让我们感受到了大自然无穷 的魅力。下面我请几个同学描述几种动物的 运动。 自然界中的各种动物的运动都有着自己 的韵律和美感。现在我们亲自观察几种动物 的运动。注意观察动物的运动方式?如何完成 运动的? 引导学生形象描述几种动物的运动方式 及如何完成运动的。 不同生活环境中的动物运动方式也不同, 课前观察各种动物的运动方式 并记录,将记录的信息交流, 说出图片中各种动物的运动方 式。 按照活动区域,说出动物的运 动方式:空中的有飞行、滑翔; 陆地上的有爬行、奔跑、跳跃、 攀缘、行走等;水中的有游泳、 漂浮等。 用图片和文字描述几种动物的 运动 将各种典型的易于捕捉的较小 型的动物带到学校进行观察探 究。各小组观察小螃蟹和小虾 子的运动。 学生描述动物的运动 描述所观察的现象。

相关主题
文本预览
相关文档 最新文档