找回密码
 注册
Simdroid-非首页
查看: 98|回复: 0

[3. Fortran] matlab转fortran77

[复制链接]
发表于 2011-7-19 16:43:13 | 显示全部楼层 |阅读模式 来自 广东深圳
本人是新手,没有编程基础,也没学过fortran,我在用到ABAQUSUMAT时需要编fortran77,我这里有一个matlab小程序,有谁能帮我转化成fortran77格式!万分感激!!!
%
Parameters
clear all; clc
E1 =4.92e4;
E2 =2.76e3;
E3 =2.32e4;
EE =-4.159e3;
sigma_a =286.98;
sigma_b =382.363;
% MPa
epsilon_a=sigma_a/E1;

epsilon_b=epsilon_a + (sigma_b-sigma_a)/E2;

delta_epsilon = 0.0001;
inflection=[0.05 0.04 0.03 0.02 0.01];
epsilon =[0:delta_epsilon:inflection(1) inflection(1):-delta_epsilon:0];
for i=2:length(inflection)

epsilon =[epsilon 0:delta_epsilon:inflection(i) inflection(i):-delta_epsilon:0];
end


p.x1 =0;
p.y1 =0;
p.x2 =0;
p.y2 =0;

dx = 0;
zz =0;
k1=100;

for i= 1:length(epsilon)

p.x2 = epsilon(i);

dx = p.x2 - p.x1;
if
dx>=0

if epsilon(i)<epsilon_a

y= E1*epsilon(i);

elseif epsilon(i)>epsilon_b

y= sigma_b + (epsilon(i)-epsilon_b)*E3;

else

y= sigma_a + (epsilon(i)-epsilon_a)*E2;

end
else

z= p.y1 + (epsilon(i)-p.x1)*E1;

if epsilon(i) > epsilon_b

if k1<= EE

y= p.y1 + (epsilon(i) - p.x1)*E2;

else

y= z;

zz1= epsilon(i);

zz = (E2*zz1-y)/(E2-E1);

end

elseif epsilon(i)<zz

y= p.y1 + E1*(epsilon(i)-p.x1);

else



if abs(k1)>=abs(EE)

y= p.y1 + (epsilon(i) - p.x1)*E2;

else

y= z;

zz1= epsilon(i);

zz = (E2*zz1-y)/(E2-E1);

end

end

k1= (z-sigma_a)/(epsilon(i)-epsilon_a);
end

p.x1=p.x2;
p.y1=y;

px(i)=epsilon(i);
py(i)=y;
end

plot(px,py)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-11-1 11:27 , Processed in 0.032533 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表