how do i write code for following equation

4 Ansichten (letzte 30 Tage)
AJIT KUMAR
AJIT KUMAR am 2 Jan. 2020
Kommentiert: Walter Roberson am 6 Jan. 2020
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)

Antworten (2)

KALYAN ACHARJYA
KALYAN ACHARJYA am 2 Jan. 2020
Bearbeitet: KALYAN ACHARJYA am 2 Jan. 2020
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 Kommentare
KALYAN ACHARJYA
KALYAN ACHARJYA am 2 Jan. 2020
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 am 6 Jan. 2020
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

Melden Sie sich an, um zu kommentieren.


AJIT KUMAR
AJIT KUMAR am 3 Jan. 2020
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 Kommentare
AJIT KUMAR
AJIT KUMAR am 6 Jan. 2020
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 am 6 Jan. 2020
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.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by