Skip to main content
8-Gravel
February 14, 2023
Solved

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

  • February 14, 2023
  • 2 replies
  • 2993 views

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

 

 

 

 

Best answer by Werner_E

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.

2 replies

21-Topaz II
February 14, 2023

Hi,

It would help immensely if you attach the worksheet.

Cheers

Terry

Kocela8-GravelAuthor
8-Gravel
February 14, 2023

Hi Terry

I have attached it, thank you for the help.

25-Diamond I
February 14, 2023

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

 

25-Diamond I
February 14, 2023

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

 

 

Kocela8-GravelAuthor
8-Gravel
February 15, 2023

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