how do i write code for following equation

조회 수: 5 (최근 30일)
AJIT KUMAR
AJIT KUMAR 2020년 1월 2일
댓글: Walter Roberson 2020년 1월 6일
l=4
d=[10:10:100]*10^-6;
D=100*10^-12;
m=10^4;
t1=d^2/6*D ;
t=t1 + (i-1)*Tp;
I'm confusing about time t,what is the value of t and length of t,c(t) and s(t)

답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 1월 2일
편집: KALYAN ACHARJYA 2020년 1월 2일
l=4;
d=(10:10:100)*10^-6;
D=100*10^-12;
m=10^4;
t1=(d.^2)./(6*D);
Tp=? %% Define Tp
t=t1+(i-1)*Tp;
e1=(4*pi*D*t).^(3/2);
e2=-d.^2./(4*D.*t);
c_t=(m./e1).*exp(e2)
For summation s(t), please see here
  댓글 수: 4
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 1월 2일
yes here t represents
t=t1+(i-1)*Tp;
Rest code with Tp
l=4;
d=(10:10:100)*10^-6;
D=100*10^-12;
m=10^4;
t1=(d.^2)./(6*D);
Tp=30;
t=t1+(i-1)*Tp;
e1=(4*pi*D*t).^(3/2);
e2=-d.^2./(4*D.*t);
c_t=(m./e1).*exp(e2) % This the result for c(t) as an array
AJIT KUMAR
AJIT KUMAR 2020년 1월 6일
sorry to say that but i'm not satisfied with your answer.ok i'm giving the code if there is anything wrong plz suggest some correction.
Thank u
m = 10^6; D = 100*10^-12; d = [10*10^-6:10*10^-6:100*10^-6];
r = 10*10^-6; Tp = 30;
l = 4;b = 0;L = 10;c=[];
%s=zeros();
s_diff_sum_i=zeros();g_d=zeros();g_diff_sum=zeros();si=[];
%i =l+1:L+l ;
% syms j;
%
for k=1:length(d)
ts = (d(k).^2)./(6.*D);
ti=l*Tp:Tp:(L+l-1)*Tp ;
t1 = ts +ti; s3=0;
for j=0:4
c_temp = (m./(4.*pi.*D.*(t1+j*Tp )).^3/2).*exp(-(d(k).^2)./(4.*D.*(t1+j*Tp )));
c=[c c_temp];
s=sum(c_temp);
s1=sum(c);
s2=s2+c_temp;
end
s3(k)=s;
s4(k)=s1;
end

댓글을 달려면 로그인하십시오.


AJIT KUMAR
AJIT KUMAR 2020년 1월 3일
i have already written the code for these equation but i'm confused about output of t,s(t).if u don't mind please give me the output of t as well as s(t).i used "for loop" for t as well as for s(t).so tell me may i use "for loop "for t or not?.Any help is much appriciated.Thanks
  댓글 수: 5
AJIT KUMAR
AJIT KUMAR 2020년 1월 6일
m = 10^4; D = 100*10^-12; d = [10*10^-6:10*10^-6:100*10^-6];
r = 10*10^-6; Tp = 30;
l = 4;L = 10;c=[];
for k=1:length(d)
t1 = (d(k).^2)./(6.*D);
ti=l*Tp:Tp:(L+l-1)*Tp ; %%here i=l+1:L+l and ti=(i-1)*Tp
t= t1 +ti;
s3=0;
for j=0:4
c_temp = (m./(4.*pi.*D.*(t+j*Tp )).^3/2).*exp(-(d(k).^2)./(4.*D.*(t+j*Tp )));
c=[c c_temp];
s=sum(c_temp);
s1=sum(c);
s2=s2+c_temp;
end
s3(k)=s;
s4(k)=s1;
end
so,plz suggest me. should i use for loop for t and at final stage may i calculate sum(c) or sum(c_temp) .i shall be gratefull if u reply
Thank u
Walter Roberson
Walter Roberson 2020년 1월 6일
I have no opinion on that matter, as I do not know what equations you are implementing. All I know is that you are not implementing the equations that were posted in your Question.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by