how do i write code for following equation
古いコメントを表示
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
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 件のコメント
AJIT KUMAR
2020 年 1 月 2 日
AJIT KUMAR
2020 年 1 月 2 日
編集済み: Walter Roberson
2020 年 1 月 3 日
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
2020 年 1 月 6 日
AJIT KUMAR
2020 年 1 月 3 日
0 投票
5 件のコメント
Walter Roberson
2020 年 1 月 3 日
The length of s_t is the same as the length of c_t, which is the same as the length of d.
What would you use a for loop to do? t is not an input to this, t is an output from this.
I think you need to rethink your c and s . I do not think they should be arrays: I think they should be functions that take an input, t, and compute an output that is the same size.
You are currently computing t, and I do not think you should be. It does not make sense to do so when you have that
there. Your definition of
needs to be understood not as a formula for a specific t, and instead as a formula relating the dummy input value, referred to as t, to an output value.
Your d is currently a vector, and I don't think it should be: I think it very likely should be a scalar, and that there should not be any relationship between d and t.
AJIT KUMAR
2020 年 1 月 3 日
Walter Roberson
2020 年 1 月 6 日
If t depends upon ts and ts depends upon d, then you are not using the same equations that you posted the latex for, and there is no way for us to assist you. Your
call in defining
is not possible if your t in defining
depends upon ts and ts depends upon d.
AJIT KUMAR
2020 年 1 月 6 日
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.
カテゴリ
ヘルプ センター および File Exchange で Surrogate Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!