标题:新手上路大家帮忙看看这程序
只看楼主
zytao1213
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-1-21
 问题点数:0 回复次数:0 
新手上路大家帮忙看看这程序

clear all
close all

m=[0.3,0.5,0.7];
subf=m.^(1/2);
alpha=-22.2
delta=10^4;
tao=1.67*10^(-4);
rho=10;
A=(-2)*alpha*tao;

N=100;

funstr='1/sqrt((rho+w-delta/(rho+1))*(1-y^2)+rho/2*(y^4-1)-w*(1/y^2-1)-delta/rho*ln((rho*y^2+1)/(rho+1)))';

for ii=1:length(m)
w=rho*m(ii)/2-delta*m(ii)/(rho+1)/(1-m(ii))-delta*m(ii)/rho/(m(ii)-1)^2*log((1+rho*m(ii))/(1+rho));

y1=linspace(subf(ii),1,N);

fun=subs(funstr,{'w','rho','delta'},{w,rho,delta})

for jj=1:N

s1(jj)=quadl(inline(vectorize(char(fun))),subf(ii),y1(jj));
s1(jj)=1/sqrt(A)*s1(jj);
end
ss(ii,:)=[fliplr(-s1) s1];
yy(ii,:)=[fliplr(y1.^2) y1.^2];

end

disp('------------计算结束---------------')
%%画图
figure
hold on

axis([-10 10 0 1.1]);
line(ss(1,:),yy(1,:)*30/4,'color','k');
line(ss(2,:),yy(2,:)*30/4,'color','k','linestyle',':');
line(ss(3,:),yy(3,:)*30/4,'color','k','linestyle','-.');
line(ss(1,:),yy(1,:)*10/4,'color','k','color','k');
line(ss(2,:),yy(2,:)*10/4,'color','k','linestyle',':');
line(ss(3,:),yy(3,:)*10/4,'color','k','linestyle','-.');


legend('m=0.3','m=0.5','m=0.7');


搜索更多相关主题的帖子: tao 新手上路 close 
2007-01-21 16:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-117323-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.353430 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved