Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » badboydrix
  • » Profile

Posts

Posts

Apr-06-16 04:04:09
I am trying to acvhieve W(t - R) where R is a contant variable
Category: Programming

Here is my code i am trying to achieve active queue management algorithm
in line 6 there is a logical error, what i wat to achieve is w(t-R) and q(t-R) respectivelyhttp://cs630419.vk.me/v630419263/205df/ui_5kRbt6cQ.jpg
https://openmodelica.org/images/agorapro/attachments/5012/mini_Снимок.PNG

but i have searched and haven't been able to find it, i am rather new at modelica and would appreciate the help
N = 1, R = 1, K = 5; 3, C = 1, W(0) = 0; 1,Q(0) = 1
where R(t)=1 just a small reference although it could be understood i guess

1)class generic
2)Real N,K,C,R;
3)Real w(start=0.1),q(start=1);
4)//AQM:
5)equation
6)    der(w)=1/R - (((w*(w-R))/2*R)*K*(q-R));
7)    der(q)=if q>0 then (N*w/R)-C else 0 ;       
8)end generic;

  • Index
  • » Users
  • » badboydrix
  • » Profile
You are here: