MATLAB help

pleading for help from anyone that can:-

need to model metal strain behaviour and not sure where i am going wrong:

so far i have:


% 1.1 Shear Modului of Al (G) [GPa]
G_300K=25.4;
G_77K=28.448;
G_4K=29.21;

% 1.2 Taylor Factor (M)
M=3;

% 1.3 Strength of Obstacles (a)
a=0.3;

% 1.4 Burgers Vector in Al (b)
b=2.86E-10;


% Loading Experimental Arrays - Used to plot the model against to
% show accuracy and help determine the constants that have been
% previously guessed.

stressstrain4k=[0,0;0.000308590000000000,0.903400000000000;0.000493710000000000,2.30640000000000;0.000678780000000000,3.93080000000000;0.000832990000000000,5.68680000000000;0.000987170000000000,7.56080000000000;0.00114130000000000,9.32640000000000;0.00135710000000000,10.5080000000000;0.00160370000000000,11.3660000000000;0.00185010000000000,12.0810000000000;0.00212740000000000,12.7830000000000;0.00237370000000000,13.4270000000000;0.00265080000000000,14.0490000000000;0.00289700000000000,14.6450000000000;0.00317400000000000,15.2180000000000;0.00345080000000000,15.8190000000000;0.00369690000000000,16.3780000000000;0.00518378000000000,19.3313000000000;0.00790967000000000,24.3343000000000;0.0106435700000000,29.0788000000000;0.0134004000000000,33.6941000000000;0.0161646000000000,38.1476000000000;0.0189214000000000,42.5207000000000;0.0216796000000000,46.8282000000000;0.0285838500000000,57.2558750000000;0.0395984500000000,73.2833000000000;0.0505253500000000,88.4666500000000;0.0614088500000000,103.072300000000;0.0722454500000000,117.095250000000;0.0830242500000000,130.581000000000;0.0937441500000000,143.634750000000;0.104382725000000,156.469750000000;0.114950750000000,169.058000000000;0.125442500000000,181.294250000000;0.135866500000000,193.142000000000;0.146216750000000,204.656500000000;0.156487500000000,215.754000000000;0.166693500000000,226.507250000000;0.176838250000000,237.048750000000;0.186907500000000,247.252000000000;0.196916250000000,256.956500000000;0.206870250000000,266.102750000000;0.216742250000000,275.099750000000;0.226531500000000,283.870500000000;0.236258500000000,292.314250000000;0.245912000000000,300.389250000000;];
stressstrain77k=[0,0;0,0.645600000000000;0.000279680000000000,1.66460000000000;0.000489390000000000,2.89400000000000;0.000734000000000000,4.28650000000000;0.000943610000000000,5.84280000000000;0.00115320000000000,7.35830000000000;0.00136270000000000,8.59720000000000;0.00164200000000000,9.45430000000000;0.00195610000000000,10.0950000000000;0.00223530000000000,10.6580000000000;0.00254920000000000,11.1610000000000;0.00286300000000000,11.6420000000000;0.00317680000000000,12.1120000000000;0.00349040000000000,12.5730000000000;0.00553475000000000,15.4272500000000;0.00933502500000000,20.3665833300000;0.0131610830000000,25.0076666700000;0.0169986670000000,29.3736666700000;0.0208470000000000,33.5622500000000;0.0246948330000000,37.6073333300000;0.0285450000000000,41.5124166700000;0.0323889170000000,45.2782500000000;0.0362488330000000,48.9195000000000;0.0400993330000000,52.4308333300000;0.0439521670000000,55.8157500000000;0.0477982500000000,59.1015000000000;0.0516382500000000,62.2901666700000;0.0554744170000000,65.4120833300000;0.0593096670000000,68.4195000000000;0.0631437500000000,71.3303333300000;0.0669662500000000,74.1553333300000;0.0707548330000000,76.8857500000000;0.0745455830000000,79.5149166700000;0.0783274170000000,82.0645000000000;0.0820974170000000,84.5377500000000;0.0858695830000000,86.9385000000000;0.0896303330000000,89.2460833300000;0.0933978330000000,91.5064166700000;0.0971435000000000,93.6951666700000;0.102760083000000,96.8822083300000;0.110215833000000,100.972500000000;0.117636667000000,104.844583300000;0.125019167000000,108.532500000000;0.132369583000000,112.041250000000;0.139672500000000,115.404583300000;0.146939583000000,118.626250000000;0.154170833000000,121.703750000000;0.161367083000000,124.645833300000;0.168515833000000,127.447500000000;0.175633333000000,130.091250000000;0.182702917000000,132.690416700000;0.189729583000000,135.203333300000;0.196710417000000,137.660416700000;0.203645417000000,139.998333300000;0.210546250000000,142.269166700000;0.217407917000000,144.461666700000;0.224230000000000,146.574583300000;0.231008750000000,148.603333300000;0.237750833000000,150.582500000000;0.244448333000000,152.522500000000;0.251105833000000,154.383750000000;0.257730417000000,156.125000000000;0.264312917000000,157.846666700000;0.270854583000000,159.532083300000;0.277350000000000,161.238750000000;0.283809167000000,162.917500000000;0.290229583000000,164.552916700000;0.296605417000000,166.152500000000;0.302941667000000,167.665833300000;0.309236667000000,169.165416700000;0.315497917000000,170.622083300000;0.321729583000000,172.042916700000;0.327925417000000,173.440833300000;0.334091250000000,174.710000000000;0.340225000000000,175.911666700000;0.346333333000000,176.888333300000;0.352422917000000,177.414583300000;];
stressstrain300k=[0,0;0,0.753400000000000;3.11520000000000e-05,1.52000000000000;9.34540000000000e-05,2.30610000000000;0.000264758000000000,3.70025000000000;0.000615068000000000,5.13710000000000;0.00101194000000000,6.10287500000000;0.00143197500000000,6.88780000000000;0.00227666700000000,8.12389166700000;0.00357608300000000,9.69682500000000;0.00489188300000000,11.1072500000000;0.00621885800000000,12.3834166700000;0.00755440000000000,13.4945000000000;0.00889841700000000,14.4647500000000;0.0113842000000000,16.0368750000000;0.0159269000000000,18.5099000000000;0.0204872250000000,20.5751500000000;0.0250525500000000,22.3491000000000;0.0296154250000000,23.9141500000000;0.0341665250000000,25.2981250000000;0.0386993000000000,26.5595500000000;0.0432391250000000,27.7149000000000;0.0477658500000000,28.7708500000000;0.0522790250000000,29.7568250000000;0.0567791500000000,30.6802750000000;0.0612656500000000,31.5434000000000;0.0657344000000000,32.3669000000000;0.0701904000000000,33.1489250000000;0.0746326750000000,33.9007250000000;0.0790514000000000,34.6142250000000;0.0834610000000000,35.3002500000000;0.0878460250000000,35.9722000000000;0.0922183750000000,36.6045750000000;0.0965731250000000,37.2143500000000;0.100906250000000,37.8228500000000;0.105229000000000,38.4021500000000;0.109524750000000,38.9637000000000;0.113787250000000,39.5343500000000;0.118033500000000,40.0620750000000;0.122260500000000,40.6019500000000;0.126487000000000,41.1305500000000;0.130707750000000,41.6339000000000;0.134907000000000,42.1390250000000;0.139089000000000,42.6276250000000;0.143250500000000,43.1159000000000;0.147402750000000,43.5941750000000;0.151539500000000,44.0457500000000;0.155656000000000,44.5081500000000;0.159752500000000,44.9697750000000;0.163840000000000,45.3862500000000;0.167909500000000,45.8078750000000;0.171966750000000,46.2275750000000;0.176005250000000,46.6344500000000;0.180021250000000,47.0246500000000;0.184027000000000,47.4144250000000;0.188018750000000,47.8077500000000;0.191999500000000,48.1858500000000;0.195958750000000,48.5762250000000;0.199908500000000,48.9339250000000;0.203835250000000,49.2988750000000;0.207741500000000,49.6702250000000;0.211643500000000,50.0232750000000;0.215528750000000,50.3673500000000;0.219404000000000,50.7036500000000;0.223262750000000,51.0225750000000;0.227108750000000,51.3411750000000;0.230934500000000,51.6547250000000;0.234754000000000,51.9681250000000;0.238554250000000,52.2813750000000;0.242339000000000,52.5855250000000;0.246111000000000,52.8936750000000;0.249851500000000,53.1899250000000;0.253591500000000,53.4935250000000;0.257324000000000,53.7801500000000;0.261047500000000,54.0518250000000;0.264750000000000,54.3253750000000;0.268440250000000,54.5982250000000;0.272116500000000,54.8637250000000;0.275783250000000,55.1195000000000;0.279437000000000,55.3768250000000;0.283070000000000,55.6156500000000;0.286697250000000,55.8676500000000;0.290309750000000,56.0882250000000;];



% Conditions for 4K

p_initial=1E-6; % dislocation denstiy at initial is expected to be relatively low (not strained)
p=p_initial;
k1=1E9;
k2=70;
i=1;



% Producing the dislocation denstiy, strain and stress arrays - will
% then compare to experimental results in order to find constant values and
% gain a better fit.

% For 4K
modelstrain_4k=(0:0.0001:0.4);
modeldensity_4k=(0:0.0001:0.4);

for strain=0:0.0001:0.4
delta_p_4k=((k1*(sqrt(p)))-(k2*p))*(0.0001);

p=p+delta_p_4k;
modeldensity_4k(1,i)=delta_p_4k;
i=i+1;

end

% For 77K
modelstrain_77k=(0:0.0001:0.4);
modeldensity_77k=(0:0.0001:0.4);

for strain=0:0.0001:0.4
delta_p_77k=((k1*(sqrt(p)))-(k2*p))*(0.0001);

p=p+delta_p_77k;
modeldensity_77k(1,i)=delta_p_77k;
i=i+1;

end

% For 300K
modelstrain_300k=(0:0.0001:0.4);
modeldensity_300k=(0:0.0001:0.4);

for strain=0:0.0001:0.4
delta_p_300k=((k1*(sqrt(p)))-(k2*p))*(0.0001);

p=p+delta_p_300k;
modeldensity_300k(1,i)=delta_p_300k;
i=i+1;

end


% Calculating the stress arrays from the dislocation densities for the
% model at the differing temperatures

modelstress_4k=(a*M*G_4K*b*(sqrt(modeldensity_4k)));
modelstress_77k=(a*M*G_77K*b*(sqrt(modeldensity_77k)));
modelstress_300k=(a*M*G_300K*b*(sqrt(modeldensity_300k)));


% plotting the models against one another and the experimental results

plot(modelstrain_4k,modelstress_4k);

Basically i want to create a loop that produces an array for p over a range and then i can work the rest out.

It's probably pretty basic but im just not sure.


Thanks for the help

Comments

  • shwaipshwaip bluffin' with my muffin Icrontian
    edited August 2010
    Tell us what's not working...
Sign In or Register to comment.