how do i write code for following equation
Afficher commentaires plus anciens
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)
Réponses (2)
KALYAN ACHARJYA
le 2 Jan 2020
Modifié(e) : KALYAN ACHARJYA
le 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 commentaires
AJIT KUMAR
le 2 Jan 2020
AJIT KUMAR
le 2 Jan 2020
Modifié(e) : Walter Roberson
le 3 Jan 2020
KALYAN ACHARJYA
le 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
le 6 Jan 2020
AJIT KUMAR
le 3 Jan 2020
0 votes
5 commentaires
Walter Roberson
le 3 Jan 2020
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
le 3 Jan 2020
Walter Roberson
le 6 Jan 2020
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
le 6 Jan 2020
Walter Roberson
le 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.
Catégories
En savoir plus sur Surrogate Optimization dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!