Modelica_StateGraph2.Examples.WrongStateGraphs

Examples demonstrating wrong Modelica_StateGraph2s and the error messages that appear in such cases

Package Content

NameDescription
Modelica_StateGraph2.Examples.WrongStateGraphs.SimpleInfiniteLoop SimpleInfiniteLoop A wrong Modelica_StateGraph2 that has an infinite loop (translates with an error)
Modelica_StateGraph2.Examples.WrongStateGraphs.SeveralInfiniteLoops SeveralInfiniteLoops Several loops that have wrongly only one delayed transition in one of the loops, but not in all
Modelica_StateGraph2.Examples.WrongStateGraphs.InfiniteLoop InfiniteLoop A wrong Modelica_StateGraph2 with infinite looping of a composite step (translates with an error)
Modelica_StateGraph2.Examples.WrongStateGraphs.ParallelWithInfiniteLoop ParallelWithInfiniteLoop A wrong Modelica_StateGraph2 to demonstrate parallel execution paths with infinite looping ((translates with an error))
Modelica_StateGraph2.Examples.WrongStateGraphs.NoInitialStep NoInitialStep An initial step is missing
Modelica_StateGraph2.Examples.WrongStateGraphs.AutonomousWithSuspendAndNoInitialStep AutonomousWithSuspendAndNoInitialStep Autonomous parallel with suspend/resume (either the parallel should have initialStep= true or an initial step is missing in the resume branch)
Modelica_StateGraph2.Examples.WrongStateGraphs.TwoInitialSteps TwoInitialSteps A wrong Modelica_StateGraph2 that has two initial steps (gives an error during initialization)
Modelica_StateGraph2.Examples.WrongStateGraphs.ParallelWithTwoInitialSteps ParallelWithTwoInitialSteps Wrong Modelica_StateGraph2 with two initial steps
Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel1 UnsafeParallel1 Wrong Modelica_StateGraph2 that branches out of the parallel step (gives error during initialization)
Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel2 UnsafeParallel2 Wrong Modelica_StateGraph2 where not all parallel paths are synchronized (gives translation error)
Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel3 UnsafeParallel3 Wrong Modelica_StateGraph2 where not all parallel paths are synchronized (gives translation error)
Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel4 UnsafeParallel4 Wrong Modelica_StateGraph2 where not all parallel paths are synchronized and a wrong initial step is added to compensate for this (gives an error during initialization)
Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel5 UnsafeParallel5 Wrong Modelica_StateGraph2 where an initial step is placed in a parallel (gives translation error)
Modelica_StateGraph2.Examples.WrongStateGraphs.NoUnaryConnection1 NoUnaryConnection1 Two steps are wrongly connected to the same outPort of a transition
Modelica_StateGraph2.Examples.WrongStateGraphs.NoUnaryConnection2 NoUnaryConnection2 Two steps are wrongly connected to one element of an entry port


Modelica_StateGraph2.Examples.WrongStateGraphs.SimpleInfiniteLoop Modelica_StateGraph2.Examples.WrongStateGraphs.SimpleInfiniteLoop

A wrong Modelica_StateGraph2 that has an infinite loop (translates with an error)

Modelica_StateGraph2.Examples.WrongStateGraphs.SimpleInfiniteLoop

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SimpleInfiniteLoop 
  "A wrong Modelica_StateGraph2 that has an infinite loop (translates with an error)"
  extends Modelica.Icons.Example;

  Modelica_StateGraph2.Step step1(
    initialStep=true,
    nOut=1,
    nIn=1);
  Modelica_StateGraph2.Transition T1;

  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Transition T2;
  Modelica_StateGraph2.Step step3(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Transition T3;

equation 
  connect(step1.outPort[1], T1.inPort);
  connect(T1.outPort, step2.inPort[1]);
  connect(step2.outPort[1], T2.inPort);
  connect(T2.outPort, step3.inPort[1]);
  connect(step3.outPort[1], T3.inPort);
  connect(T3.outPort, step1.inPort[1]);
end SimpleInfiniteLoop;

Modelica_StateGraph2.Examples.WrongStateGraphs.SeveralInfiniteLoops Modelica_StateGraph2.Examples.WrongStateGraphs.SeveralInfiniteLoops

Several loops that have wrongly only one delayed transition in one of the loops, but not in all

Modelica_StateGraph2.Examples.WrongStateGraphs.SeveralInfiniteLoops

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SeveralInfiniteLoops 
  "Several loops that have wrongly only one delayed transition in one of the loops, but not in all"
  extends Modelica.Icons.Example;

  Modelica_StateGraph2.Step initialStep(
  nIn=3,
  nOut=1,
  initialStep=true);
  Modelica_StateGraph2.Transition T1(
                condition=time > 2);
  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=false);
  Modelica_StateGraph2.Step step3(
             nIn=1, nOut=3);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T4(
                                   waitTime=1.5, delayedTransition=false);
  Modelica_StateGraph2.Transition T5(
                                   waitTime=1.7, delayedTransition=false);
  Modelica_StateGraph2.Step step1(
                                nIn=1, nOut=1);
  Modelica_StateGraph2.Step step4(
                                nIn=1, nOut=1);
  Modelica_StateGraph2.Step step5(
                                nIn=1, nOut=1);
  Modelica_StateGraph2.Transition T6(    waitTime=1, delayedTransition=false);
  Modelica_StateGraph2.Transition T7(    waitTime=1, delayedTransition=false);
  Modelica_StateGraph2.Transition T8(    waitTime=1, delayedTransition=false);
equation 

connect(initialStep.outPort[1],T1. inPort);
  connect(T1.outPort,step2. inPort[1]);
  connect(step2.outPort[1],T2. inPort);
  connect(T2.outPort,step3. inPort[1]);
  connect(step3.outPort[1],T3. inPort);

  connect(step3.outPort[2], T4.inPort);
  connect(step3.outPort[3], T5.inPort);
  connect(step1.inPort[1], T3.outPort);
  connect(step4.inPort[1], T4.outPort);
  connect(step5.inPort[1], T5.outPort);
  connect(T6.inPort, step1.outPort[1]);
  connect(T7.inPort, step4.outPort[1]);
  connect(T8.inPort, step5.outPort[1]);
  connect(T6.outPort, initialStep.inPort[1]);
  connect(T7.outPort, initialStep.inPort[2]);
  connect(T8.outPort, initialStep.inPort[3]);
end SeveralInfiniteLoops;

Modelica_StateGraph2.Examples.WrongStateGraphs.InfiniteLoop Modelica_StateGraph2.Examples.WrongStateGraphs.InfiniteLoop

A wrong Modelica_StateGraph2 with infinite looping of a composite step (translates with an error)

Modelica_StateGraph2.Examples.WrongStateGraphs.InfiniteLoop

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model InfiniteLoop 
  "A wrong Modelica_StateGraph2 with infinite looping of a composite step (translates with an error)"
   extends Modelica.Icons.Example;

  Modelica_StateGraph2.Step step1(
    nOut=1,
    initialStep=true,
    nIn=1);
  Parallel parallel(
    use_inPort=true,
    use_outPort=true,
    nIn=1,
    nEntry=1,
    nOut=1,
    nExit=1);
  Modelica_StateGraph2.Transition T1(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step3(
             nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step4(
             nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T3(    waitTime=1,
    use_conditionPort=false,
    delayedTransition=false);
equation 
  connect(step1.outPort[1], T1.inPort);
  connect(T1.outPort, parallel.inPort[1]);
  connect(step3.outPort[1], T2.inPort);
  connect(parallel.entry[1], step3.inPort[1]);
  connect(T2.outPort, step4.inPort[1]);
  connect(parallel.outPort[1], T3.inPort);
  connect(T3.outPort, step1.inPort[1]);
  connect(step4.outPort[1], parallel.exit[1]);
end InfiniteLoop;

Modelica_StateGraph2.Examples.WrongStateGraphs.ParallelWithInfiniteLoop Modelica_StateGraph2.Examples.WrongStateGraphs.ParallelWithInfiniteLoop

A wrong Modelica_StateGraph2 to demonstrate parallel execution paths with infinite looping ((translates with an error))

Modelica_StateGraph2.Examples.WrongStateGraphs.ParallelWithInfiniteLoop

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model ParallelWithInfiniteLoop 
  "A wrong Modelica_StateGraph2 to demonstrate parallel execution paths with infinite looping ((translates with an error))"
   extends Modelica.Icons.Example;

  Modelica_StateGraph2.Step step1(
    nOut=1,
    initialStep=true,
    nIn=1);
  Parallel parallel(
    use_inPort=true,
    use_outPort=true,
    nIn=1,
    nEntry=2,
    nOut=1,
    nExit=2);
  Modelica_StateGraph2.Transition T1(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step3(
             nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step4(
             nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T3(    waitTime=1,
    use_conditionPort=false,
    delayedTransition=false);
equation 
  connect(step1.outPort[1], T1.inPort);
  connect(T1.outPort, parallel.inPort[1]);
  connect(step3.outPort[1], T2.inPort);
  connect(parallel.entry[1], step2.inPort[1]);
  connect(parallel.entry[2], step3.inPort[1]);
  connect(T2.outPort, step4.inPort[1]);
  connect(parallel.outPort[1], T3.inPort);
  connect(T3.outPort, step1.inPort[1]);
  connect(step2.outPort[1], parallel.exit[1]);
  connect(step4.outPort[1], parallel.exit[2]);
end ParallelWithInfiniteLoop;

Modelica_StateGraph2.Examples.WrongStateGraphs.NoInitialStep Modelica_StateGraph2.Examples.WrongStateGraphs.NoInitialStep

An initial step is missing

Modelica_StateGraph2.Examples.WrongStateGraphs.NoInitialStep

Information



Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model NoInitialStep "An initial step is missing"
  extends Modelica.Icons.Example;
  Modelica_StateGraph2.Step initialStep(
  nIn=1,
  nOut=1,
  initialStep=false);
  Modelica_StateGraph2.Transition T1(
                condition=time > 2);
  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Transition T2(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Step step3(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
equation 

connect(initialStep.outPort[1], T1.inPort);
  connect(T1.outPort, step2.inPort[1]);
  connect(step2.outPort[1], T2.inPort);
  connect(T2.outPort, step3.inPort[1]);
  connect(step3.outPort[1], T3.inPort);
connect(T3.outPort, initialStep.inPort[1]);
end NoInitialStep;

Modelica_StateGraph2.Examples.WrongStateGraphs.AutonomousWithSuspendAndNoInitialStep Modelica_StateGraph2.Examples.WrongStateGraphs.AutonomousWithSuspendAndNoInitialStep

Autonomous parallel with suspend/resume (either the parallel should have initialStep= true or an initial step is missing in the resume branch)

Modelica_StateGraph2.Examples.WrongStateGraphs.AutonomousWithSuspendAndNoInitialStep

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model AutonomousWithSuspendAndNoInitialStep 
  "Autonomous parallel with suspend/resume (either the parallel should have initialStep= true or an initial step is missing in the resume branch)"
   extends Modelica.Icons.Example;

  Parallel parallel(
    nIn=0,
    nEntry=1,
    nOut=0,
    use_suspend=true,
    nSuspend=1,
    nResume=1,
    nExit=2,
    use_outPort=false,
    use_inPort=false);
  Modelica_StateGraph2.Step step3(
                                nOut=1, nIn=2);
  Modelica_StateGraph2.Transition T2(
                                   delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Step step4(
                                nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T4(
                                   condition=time > 2.5 and time <= 4);
  Modelica_StateGraph2.Step step5(
    nIn=1,
    nOut=1,
    initialStep=false);
  Modelica_StateGraph2.Transition T5(
                                   delayedTransition=true, waitTime=2);
  Modelica_StateGraph2.Transition T6(
                                   delayedTransition=true, waitTime=1);
equation 
  connect(step3.outPort[1], T2.inPort);
  connect(parallel.entry[1], step3.inPort[1]);
  connect(T2.outPort, step4.inPort[1]);
  connect(step5.outPort[1], T5.inPort);
  connect(T4.outPort, step5.inPort[1]);
  connect(parallel.suspend[1], T4.inPort);
  connect(step4.outPort[1], T6.inPort);
  connect(T5.outPort, parallel.resume[1]);
  connect(T6.outPort, step3.inPort[2]);
end AutonomousWithSuspendAndNoInitialStep;

Modelica_StateGraph2.Examples.WrongStateGraphs.TwoInitialSteps Modelica_StateGraph2.Examples.WrongStateGraphs.TwoInitialSteps

A wrong Modelica_StateGraph2 that has two initial steps (gives an error during initialization)

Modelica_StateGraph2.Examples.WrongStateGraphs.TwoInitialSteps

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model TwoInitialSteps 
  "A wrong Modelica_StateGraph2 that has two initial steps (gives an error during initialization)"
  extends Modelica.Icons.Example;

  Modelica_StateGraph2.Step step1(
    initialStep=true,
    nOut=1,
    nIn=1);
  Modelica_StateGraph2.Transition T1;
  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Transition T2;
  Modelica_StateGraph2.Step step3(
             nIn=1, nOut=1,
    initialStep=true);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
equation 
  connect(step1.outPort[1], T1.inPort);
  connect(T1.outPort, step2.inPort[1]);
  connect(step2.outPort[1], T2.inPort);
  connect(T2.outPort, step3.inPort[1]);
  connect(step3.outPort[1], T3.inPort);
  connect(T3.outPort, step1.inPort[1]);
end TwoInitialSteps;

Modelica_StateGraph2.Examples.WrongStateGraphs.ParallelWithTwoInitialSteps Modelica_StateGraph2.Examples.WrongStateGraphs.ParallelWithTwoInitialSteps

Wrong Modelica_StateGraph2 with two initial steps

Modelica_StateGraph2.Examples.WrongStateGraphs.ParallelWithTwoInitialSteps

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model ParallelWithTwoInitialSteps 
  "Wrong Modelica_StateGraph2 with two initial steps"
   extends Modelica.Icons.Example;

  Parallel parallel(
    nIn=0,
    nEntry=2,
    nOut=0,
    use_inPort=false,
    use_outPort=false,
  initialStep=true);
  Modelica_StateGraph2.Step step2(
             nIn=2, nOut=1);
  Modelica_StateGraph2.Step step3(
             nOut=1, nIn=2,
    initialStep=true);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step4(
             nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T1(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
equation 
  connect(step3.outPort[1], T2.inPort);
  connect(parallel.entry[1], step2.inPort[1]);
  connect(parallel.entry[2], step3.inPort[1]);
  connect(T2.outPort, step4.inPort[1]);
  connect(step4.outPort[1], T1.inPort);
  connect(T1.outPort, step3.inPort[2]);
  connect(T3.outPort, step2.inPort[2]);
  connect(step2.outPort[1], T3.inPort);
end ParallelWithTwoInitialSteps;

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel1 Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel1

Wrong Modelica_StateGraph2 that branches out of the parallel step (gives error during initialization)

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel1

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model UnsafeParallel1 
  "Wrong Modelica_StateGraph2 that branches out of the parallel step (gives error during initialization)"
   extends Modelica.Icons.Example;

  Parallel parallel(
    nIn=1,
    nEntry=2,
    nOut=0,
    use_outPort=false,
    use_inPort=true);
  Modelica_StateGraph2.Step step2(
             nIn=2, nOut=1);
  Modelica_StateGraph2.Step step3(
             nOut=1, nIn=2,
    initialStep=false);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step4(
             nOut=2, nIn=1);
  Modelica_StateGraph2.Transition T1(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Step step1(
             nOut=1, nIn=1,
    initialStep=true);
  Modelica_StateGraph2.Transition T4(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T5(    waitTime=1, delayedTransition=
        false);
equation 
  connect(step3.outPort[1], T2.inPort);
  connect(parallel.entry[1], step2.inPort[1]);
  connect(parallel.entry[2], step3.inPort[1]);
  connect(T2.outPort, step4.inPort[1]);
  connect(step4.outPort[1], T1.inPort);
  connect(T1.outPort, step3.inPort[2]);
  connect(T3.outPort, step2.inPort[2]);
  connect(step2.outPort[1], T3.inPort);
  connect(T4.outPort, parallel.inPort[1]);
  connect(step1.outPort[1], T4.inPort);
  connect(step4.outPort[2], T5.inPort);
  connect(T5.outPort, step1.inPort[1]);
end UnsafeParallel1;

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel2 Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel2

Wrong Modelica_StateGraph2 where not all parallel paths are synchronized (gives translation error)

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel2

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model UnsafeParallel2 
  "Wrong Modelica_StateGraph2 where not all parallel paths are synchronized (gives translation error)"
   extends Modelica.Icons.Example;

  Parallel parallel(
    nIn=1,
    nEntry=2,
    nOut=1,
    use_inPort=true,
    use_outPort=true,
    nExit=2);
  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step3(
             nOut=1, nIn=1,
    initialStep=true);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step4(
             nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Step step1(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step5(
             nIn=1, nOut=1,
    initialStep=true);
  Modelica_StateGraph2.Transition T4(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T5(    waitTime=1, delayedTransition=
        false);
equation 
  connect(step3.outPort[1], T2.inPort);
  connect(T2.outPort, step4.inPort[1]);
  connect(step2.outPort[1], T3.inPort);
  connect(T3.outPort, step1.inPort[1]);
  connect(T4.outPort, parallel.inPort[1]);
  connect(step5.outPort[1], T4.inPort);
  connect(parallel.outPort[1], T5.inPort);
  connect(T5.outPort, step5.inPort[1]);
  connect(parallel.entry[1], step2.inPort[1]);
  connect(parallel.entry[2], step3.inPort[1]);
  connect(step1.outPort[1], parallel.exit[1]);
  connect(step4.outPort[1], parallel.exit[2]);

end UnsafeParallel2;

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel3 Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel3

Wrong Modelica_StateGraph2 where not all parallel paths are synchronized (gives translation error)

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel3

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model UnsafeParallel3 
  "Wrong Modelica_StateGraph2 where not all parallel paths are synchronized (gives translation error)"
   extends Modelica.Icons.Example;

  Parallel parallel(
    nIn=1,
    nEntry=2,
    nOut=1,
    use_inPort=true,
    use_outPort=true,
    nExit=1);
  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step3(
             nOut=1, nIn=2,
    initialStep=false);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step4(
             nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T1(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Step step1(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step5(
             nIn=1, nOut=1,
    initialStep=true);
  Modelica_StateGraph2.Transition T4(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T5(    waitTime=1, delayedTransition=
        false);
equation 
  connect(step3.outPort[1], T2.inPort);
  connect(T2.outPort, step4.inPort[1]);
  connect(step4.outPort[1], T1.inPort);
  connect(step2.outPort[1], T3.inPort);
  connect(T3.outPort, step1.inPort[1]);
  connect(T4.outPort, parallel.inPort[1]);
  connect(step5.outPort[1], T4.inPort);
  connect(parallel.outPort[1], T5.inPort);
  connect(T5.outPort, step5.inPort[1]);
  connect(parallel.entry[1], step2.inPort[1]);
  connect(parallel.entry[2], step3.inPort[1]);
  connect(T1.outPort, step3.inPort[2]);
  connect(step1.outPort[1], parallel.exit[1]);
end UnsafeParallel3;

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel4 Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel4

Wrong Modelica_StateGraph2 where not all parallel paths are synchronized and a wrong initial step is added to compensate for this (gives an error during initialization)

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel4

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model UnsafeParallel4 
  "Wrong Modelica_StateGraph2 where not all parallel paths are synchronized and a wrong initial step is added to compensate for this (gives an error during initialization)"
   extends Modelica.Icons.Example;

  Parallel parallel(
    nIn=1,
    nEntry=2,
    nOut=1,
    use_inPort=true,
    use_outPort=true,
    nExit=2);
  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step3(
             nOut=1, nIn=1,
    initialStep=false);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step4(
             nOut=0, nIn=1);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Step step1(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step5(
             nIn=1, nOut=1,
    initialStep=true);
  Modelica_StateGraph2.Transition T4(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T5(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step6(
             nOut=1, initialStep=true);
equation 
  connect(step3.outPort[1], T2.inPort);
  connect(T2.outPort, step4.inPort[1]);
  connect(step2.outPort[1], T3.inPort);
  connect(T3.outPort, step1.inPort[1]);
  connect(T4.outPort, parallel.inPort[1]);
  connect(step5.outPort[1], T4.inPort);
  connect(parallel.outPort[1], T5.inPort);
  connect(T5.outPort, step5.inPort[1]);
  connect(parallel.entry[1], step2.inPort[1]);
  connect(parallel.entry[2], step3.inPort[1]);
  connect(step1.outPort[1], parallel.exit[1]);
  connect(step6.outPort[1], parallel.exit[2]);
end UnsafeParallel4;

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel5 Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel5

Wrong Modelica_StateGraph2 where an initial step is placed in a parallel (gives translation error)

Modelica_StateGraph2.Examples.WrongStateGraphs.UnsafeParallel5

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model UnsafeParallel5 
  "Wrong Modelica_StateGraph2 where an initial step is placed in a parallel (gives translation error)"
   extends Modelica.Icons.Example;

  Parallel parallel(
    nIn=1,
    nEntry=2,
    nOut=1,
    use_inPort=true,
    use_outPort=true,
    nExit=2);
  Modelica_StateGraph2.Step step2(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step3(
             nOut=1, nIn=1,
    initialStep=true);
  Modelica_StateGraph2.Transition T2(    waitTime=1, delayedTransition=
        false);
  Modelica_StateGraph2.Step step4(
             nOut=1, nIn=1);
  Modelica_StateGraph2.Transition T3(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Step step1(
             nIn=1, nOut=1);
  Modelica_StateGraph2.Step step5(
             nIn=1, nOut=1,
  initialStep=false);
  Modelica_StateGraph2.Transition T4(
                delayedTransition=true, waitTime=1);
  Modelica_StateGraph2.Transition T5(    waitTime=1, delayedTransition=
        false);
equation 
  connect(step3.outPort[1], T2.inPort);
  connect(T2.outPort, step4.inPort[1]);
  connect(step2.outPort[1], T3.inPort);
  connect(T3.outPort, step1.inPort[1]);
  connect(T4.outPort, parallel.inPort[1]);
  connect(step5.outPort[1], T4.inPort);
  connect(parallel.outPort[1], T5.inPort);
  connect(T5.outPort, step5.inPort[1]);
  connect(parallel.entry[1], step2.inPort[1]);
  connect(parallel.entry[2], step3.inPort[1]);
  connect(step1.outPort[1], parallel.exit[1]);
  connect(step4.outPort[1], parallel.exit[2]);

end UnsafeParallel5;

Modelica_StateGraph2.Examples.WrongStateGraphs.NoUnaryConnection1 Modelica_StateGraph2.Examples.WrongStateGraphs.NoUnaryConnection1

Two steps are wrongly connected to the same outPort of a transition

Modelica_StateGraph2.Examples.WrongStateGraphs.NoUnaryConnection1

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model NoUnaryConnection1 
  "Two steps are wrongly connected to the same outPort of a transition"

  extends Modelica.Icons.Example;
  Modelica_StateGraph2.Transition T1;
  Modelica_StateGraph2.Step step1(
                                nIn=1, nOut=1);
  Modelica_StateGraph2.Step step2(
                                nIn=1, nOut=1);
  Modelica_StateGraph2.Step step3(
    nIn=2,
    nOut=1,
    initialStep=true);
  Modelica_StateGraph2.Transition T2;
  Modelica_StateGraph2.Transition T3;
equation 
  connect(T1.outPort, step1.inPort[1]);
  connect(T1.outPort, step2.inPort[1]);
  connect(step3.outPort[1], T1.inPort);
  connect(step2.outPort[1], T2.inPort);
  connect(T2.outPort, step3.inPort[1]);
  connect(step1.outPort[1], T3.inPort);
  connect(T3.outPort, step3.inPort[2]);
end NoUnaryConnection1;

Modelica_StateGraph2.Examples.WrongStateGraphs.NoUnaryConnection2 Modelica_StateGraph2.Examples.WrongStateGraphs.NoUnaryConnection2

Two steps are wrongly connected to one element of an entry port

Modelica_StateGraph2.Examples.WrongStateGraphs.NoUnaryConnection2

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model NoUnaryConnection2 
  "Two steps are wrongly connected to one element of an entry port"

  extends Modelica.Icons.Example;
  Parallel step4(
    nIn=0,
    use_inPort=false,
    nEntry=1,
  initialStep=true);
  Modelica_StateGraph2.Step step1(
             nIn=1);
  Modelica_StateGraph2.Step step2(
             nIn=1);
equation 
  connect(step4.entry[1], step1.inPort[1]);
  connect(step4.entry[1], step2.inPort[1]);
end NoUnaryConnection2;

Automatically generated Fri Nov 12 17:27:07 2010.