- Index
- » Users
- » didrif14
- » Profile
Posts
Posts
Edited,
My suggestion failed
It was just a matter of wrong if statement, I solved it like this:
Code:
theta = theta_m.y - old_theta_m;
old_theta_m = if theta >= 360 then
theta_m.y
else
old_theta_m;
SOLVED!
I have a motor model which is running continously and I want to create a variable based on the rotational angle (theta_r) which stays between 0-360 degrees.
In Matlab i solved it like this:
Code:
theta = theta_r - old_theta_r;
if theta >= 360
old_theta_r = theta_r
else
old_theta_r = old_theta_r;
end;
The result is:
But modelica seems to execute the code differently.
Any tips on how I can create this in Modelica?
Perfect, thank you!
.
Thank you for Your reply.
What I mean is, the period of which it should repeat itself is 0.6 sec
It should turn on after 0.1 sec
Then turn off at 0.2 sec
It should then wait 0.4 sec and repeat the sequence
However, what it is doing is:
It turns on after 0.1 sec, then turns off at 0.2 sec
When i put it on the repeat setting, it turns on again after 0.1 sec
It does not know that is should wait for 0.4 sec, because I have not specified the period
There is an image in the previous post which illustrates this
Hello,
I am trying to create a boolean sequence which should repeat itself.
The "BooleanTable" block creates the sequence i want, but the sequence is not symetrical and for that reason it is not repeating as I want it to.
The image below explains it, where the upper part is how i want it and the lower part is how it is behaving.
Any tips on how I can create such a sequence, preferably With a parameter which can set the time period?
Solved:
Has to be inserted as an array {100, 100, 100} and {50,50,50}
Hello,
I am new to OpenModelica and trying to create a three-pase system.
When I fill inn the desired voltage and frequency (100v and 50Hz) in the SineVoltage source i get the error message:
[Modelica.Electrical.MultiPhase: 3557:7-3558:35]:
Type missmatch in modifier of component sineVoltage1, declared type Modelica.SIunits.Voltage[m], got modifier 100 of type integer
Am I tryping the wrong syntax?
Any help is greatly appreciated
- Index
- » Users
- » didrif14
- » Profile