# In search of more efficient computations

**URL:** <https://scilab.discourse.group/t/in-search-of-more-efficient-computations/615>\
**Category:** Modeling and simulation\
**Created:** [August 27, 2024, 6:11pm UTC](https://scilab.discourse.group/t/in-search-of-more-efficient-computations/615 "2024-08-27T18:11:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![heinznabielek](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@heinznabielek](https://scilab.discourse.group/u/heinznabielek)\
**Post date:** [August 27, 2024, 6:11pm UTC](https://scilab.discourse.group/t/in-search-of-more-efficient-computations/615/1 "2024-08-27T18:11:10Z")

</div>

Colleagues,  
I have already solved my problem and a much simplified example is shown below. I am asking are there ways for more efficient computations of ‘Model(time)’ when it comes to huge arrays and much more complex model functions.  
Heinz  
// Measurement: time, value  
M=[ 1. 0.09  
5. 0.49  
7. 0.6  
8. 0.68  
10. 0.71  
17. 0.89  
20. 0.91];  
time=M(:,1); value=M(:,2);  
// Model  
t=1:50; Model=1-exp(-t/8);  
// Difference  
Difference=value-Model(time)‘;  
plot(time,value,‘ro’); xgrid;  
plot(t,Model);  
plot(time,abs(Difference),’+');  
legend(‘Measurement’,‘Model’,‘abs(Difference)’,4);  
xlabel(‘time’);ylabel(‘value’);

---

<div class="post-metadata">

**Author:** ![heinznabielek](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@heinznabielek](https://scilab.discourse.group/u/heinznabielek)\
**Post date:** [August 27, 2024, 6:15pm UTC](https://scilab.discourse.group/t/in-search-of-more-efficient-computations/615/2 "2024-08-27T18:15:15Z")

</div>

I am having difficulties to post this question…  
Heinz

---

<div class="post-metadata">

**Author:** ![vincent.couvert](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@vincent.couvert](https://scilab.discourse.group/u/vincent.couvert)\
**Post date:** [August 30, 2024, 1:55pm UTC](https://scilab.discourse.group/t/in-search-of-more-efficient-computations/615/3 "2024-08-30T13:55:06Z")

</div>

Hi @heinznabielek

I’m not sure to understand what you need here 🙂

Vincent

---

<div class="post-metadata">

**Author:** ![heinznabielek](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@heinznabielek](https://scilab.discourse.group/u/heinznabielek)\
**Post date:** [August 31, 2024, 1:18pm UTC](https://scilab.discourse.group/t/in-search-of-more-efficient-computations/615/4 "2024-08-31T13:18:05Z")

</div>

I wondered if the expression “Model(time)” works efficiently.  
Heinz

M=[ 1. 0.09  
5. 0.49  
7. 0.6  
8. 0.68  
10. 0.71  
17. 0.89  
20. 0.91];  
time=M(:,1); value=M(:,2);  
// Model  
t=1:50; Model=1-exp(-t/8);  
// Difference  
Difference=value-Model(time)‘;
