Changes between Initial Version and Version 1 of Ticket #1715


Ignore:
Timestamp:
2012-10-02T11:05:56Z (12 years ago)
Author:
Martin Sjölund
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1715

    • Property Cc Jens Frenkel added
  • Ticket #1715 – Description

    initial v1  
    22
    33 In Dymola I couln't get it to simulate using instantatnious gear shifts because of issues with signals without well defined derivative. As workaround I added a first order system for the speed equation, as follows:
    4 {{{model IdealGearBox
     4{{{
     5model IdealGearBox
    56        extends
    67        Modelica.Mechanics.Rotational.Interfaces.PartialElementaryTwoFlangesAndSupport2;
     
    2223      phi_b = flange_b.phi - phi_support;
    2324      0 = gearRatio*flange_a.tau + flange_b.tau;
    24 end IdealGearBox;}}}
    25 
    26  
    27 
     25end IdealGearBox;
     26}}}
    2827
    2928When simulatig a simple vehicle with this gearbox solution i get the following:
    3029
    31 {{{"Following Error has occurred.
     30{{{
     31"Following Error has occurred.
    3232Unknown error throw   | [line] 42 | [file] util/division.c
    33         | division by zero"}}}
     33        | division by zero"
     34}}}
    3435
    3536Running the executable manually gives:
    36 {{{ warning | division by zero in partial equation: $DER.simplevehicle1.clutchAndGearbox.gearboxAndFinalDrive.phi_a / simplevehicle1.chassis.Wheel.w because simplevehicle1.chassis.Wheel.w == 0
     37{{{
     38 warning | division by zero in partial equation: $DER.simplevehicle1.clutchAndGearbox.gearboxAndFinalDrive.phi_a / simplevehicle1.chassis.Wheel.w because simplevehicle1.chassis.Wheel.w == 0
    3739        | [line] 1102 | [file] TestModel.c
    3840throw   | [line] 42 | [file] util/division.c
    39         | division by zero}}}
    40 
    41 If I remove
    42 {{{der(gearRatio) = ((if Gear == 0 then 1 else ratios[Gear]) - gearRatio)/Tg;}}}
    43 
    44  and replace with
    45 {{{gearRatio = (if Gear == 0 then 1 else ratios[Gear]);}}}
    46 
    47 everyting is running smoothly but in my opinion this shouln't happen.
     41        | division by zero
     42}}}
     43
     44If I remove `der(gearRatio) = ((if Gear == 0 then 1 else ratios[Gear]) - gearRatio)/Tg;` and replace with `gearRatio = (if Gear == 0 then 1 else ratios[Gear]);` everything is running smoothly but in my opinion this shouln't happen.
    4845
    4946 
     
    5249
    5350 
    54 {{{function Modelica.Math.tempInterpol1 "Temporary function for linear interpolation (will be removed)"
     51{{{
     52function Modelica.Math.tempInterpol1 "Temporary function for linear interpolation (will be removed)"
    5553
    5654  input Real u "input value (first column of table)";
     
    119117}}}
    120118
    121 {{{class TestModel
     119{{{
     120class TestModel
    122121
    123122  input Real simplevehicle1.ThrottlePedal;
     
    793792  Throttle.y = simplevehicle1.ThrottlePedal;
    794793
    795 end TestModel;}}}
     794end TestModel;
     795}}}