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
  • » didrif14
  • » Profile

Posts

Posts

Jul-30-19 06:36:44
Category: Programming

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:
https://imgshare.io/images/2019/07/25/sequence.md.png

But modelica seems to execute the code differently.

Any tips on how I can create this in Modelica?

Jun-28-19 07:12:48
Category: Programming

Perfect, thank you!

Jun-28-19 06:11:27
Category: Programming

.

Jun-28-19 06:10:19
Category: Programming

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

Jun-27-19 12:40:55
Category: Programming

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.

https://ibb.co/mqj8gnb

Any tips on how I can create such a sequence, preferably With a parameter which can set the time period?

Jun-19-19 08:40:29
Error when inputing parameters
Category: Programming

Solved:

Has to be inserted as an array {100, 100, 100} and {50,50,50}

Jun-19-19 07:52:43
Error when inputing parameters
Category: Programming

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
You are here: