LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring Simulation Time

Good day everyone, pls can anyone assist,  i am  having configuring simulation time problem with my vi which led to be giving inaccurate results.  The input data file (DIF) consists of 14 days data each to be sampled at 15minutes (900secs) interval i.e in an hour i will sample 4 times and in a day (i.e 24hours) i will sample 96times, so the total data is 4x24x14 = 1344 data. My vi has to read from the input file DIF and write out data with exactly 15mins interval. So the first sample is at t=0 , the second at =15mins, the third at t=30min and so on. I configured the time as (1/96) which gives me 0.01041667day i.e in day sample but the results i am getting are not correct. Is it because the configured time (0.01041667day) is not enough for the numerical solver to be solving iteratively? The output of the integrators of each unit are not updating at each iteration and the nature of the graph is correct, but should be from 0 to 14 days not what is giving. When the last data at t=13.98958days is sample, the result should be as attached. Thanks for all your support.

0 Kudos
Message 1 of 15
(2,944 Views)

Hi Abul.

 

I noticed that you rounded off the .01041667, which is a bit higher than the value. Are you seeing that it takes slightly more than 14 days? You say you're seeing your last data sampled at just less than 14 days. Does this represent the inaccuracy?

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 2 of 15
(2,924 Views)

Thanks. When i configured 0.01041667 it automatically rounded it off to 0.0104167, the last data to be sampled is at time t=13.98958days i.e 1343 sample from0 to 1343)and the result should as in the zip file. I also attached the correct graph nature, not as the one obtained when vi is run (because it goes beyond 14days), the problem is configuring the simulation time i.e 14days while the sampling should be at an interval of 15minutes(900secs) (sampling time) for the all samples. But because of what i configured is not correct, the input and output of some sampling as the integrators updates are giving me a negative values which shouldn't be like that. Thank you

0 Kudos
Message 3 of 15
(2,913 Views)

One thing I noticed is that your VI takes up an incredible amount of memory. Even if you configure this correctly, you might get performance issues from your VI's sheer size. I could not run the VI because there is "Not Enough Memory to Complete This Operation."  I profiled the memory while I tried to run the program, and the result showed "Read From Spreadsheet File" filling up the memory. See the following screenshot. The first thing you might want to do is do your "Read From Spreadsheet File" inside the while loop and only grab one chunk of information at a time from your file. Otherwise, you're going to fill up memory very fast, and this could lead to performance issues, despite what you've configured.

 

memory usage.png

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 4 of 15
(2,892 Views)

I am deeply gratitude. I really did that as attached but does not work. All the input are not correct likewise the output, because of configuring simulation time problem issue. Thanks

0 Kudos
Message 5 of 15
(2,887 Views)

The VI is still filling up my memory so I cannot run it to test. One thing you might want to try is editing the parameters for a smaller discrete step size.

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 6 of 15
(2,880 Views)

Thanks so much. pls, i did not get what you meant by editing the parameters for small discrete step size. Is it the parameters of my system or simulation parameters? Once more thanks

0 Kudos
Message 7 of 15
(2,876 Views)

I'm referring to your simulation parameters. Have you tried to change these from the 0.1 step size you currently have?

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 8 of 15
(2,860 Views)

Thanks. I have changed but nothing changes, the results are not correct and also the input values are not correct (as attached).

0 Kudos
Message 9 of 15
(2,855 Views)

Actually, that was the first VI since your original I was able to open successfully, and I just noticed you're configuring the "Final Time" as a fraction of days, while the Simulation Time should be in seconds. Is there a reason you're doing this?

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 10 of 15
(2,847 Views)