cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How dose the program compare the duration with time variable "t"?

KC_10577235
5-Regular Member

How dose the program compare the duration with time variable "t"?

Hi Masters

I.Ton(t,T) is a formula function in every duration of T0 and T0+Ton, T1 and T0+Ton.

and Ton is a constant value and T0, T1, T2....in the array series of T

How dose the program compare the duration with time variable "t" to plot I.Ton(t,T) through the time? 

tks

KC_10577235_3-1676370847421.png

 

KC_10577235_1-1676368042058.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

If your for loop runs up to last(T) you possible can't access T[i+1.

Change the for loop to run just up to last(T)-1 and see if it helps.

View solution in original post

9 REPLIES 9

Hi,

It would help immensely if you attach the worksheet.

Cheers

Terry

KC_10577235
5-Regular Member
(To:terryhendicott)

Hi Terry

I have attached it, thank you for the help.

I second what Terry said about attaching the worksheet.

You don't show how the function I.Ton() is defined and why it would need the full vector T as its second argument.

 

But maybe you get what you expect if you replace t by t-T[i when you call I.Ton in your function

Werner_E_0-1676375320094.png

 

EDIT: had not noticed that you attach'd it in the meantime. Will have a look later.

EDIT2: Had a look but its not clear to me what you are trying to achieve. But I see that you changed the second argument from T to T[i now when you call I.Ton and that I.Ton seems to consider the position itself. So my suggestion above does not apply.
Could it be that you are looking for something like this (I had to change the step in your range because of calculation time)

Werner_E_0-1676377185846.png

 

Here is the modified worksheet attached and a zoom of the first 20 microseconds

Werner_E_1-1676378081067.png

And here a more generic zoom, looks to me like what you described in the initial posting

Werner_E_2-1676378121960.png

 

 

KC_10577235
5-Regular Member
(To:Werner_E)

Hi Werner

I am greatly appreciated for your help that has fixed my first problem.

I encounter the second problem i can not assign the different Matrix index in array T in one time.

e.g. T[i+Ton<t<T[i+1, how to resolve T[i+1 this problem? tks.

KC_10577235_0-1676434415101.png

KC_10577235_1-1676434485518.png

 

 

If your for loop runs up to last(T) you possible can't access T[i+1.

Change the for loop to run just up to last(T)-1 and see if it helps.

KC_10577235
5-Regular Member
(To:Werner_E)

Hi Werner

I have replaced last(T) by 5001, but it's not working.

 

KC_10577235_0-1676440365876.png

 

5001 IS THE SAME as last(T)!

You should use ONE LESS,  last(T)-1   (which in your case is 5000)

KC_10577235
5-Regular Member
(To:Werner_E)

yes. yes...i see, thank you so much.

Top Tags