From: Jack Crenshaw on 14 Mar 2010 14:24 Hi. I have some models that I'm building for aerospace work, and I'd like to turn them into masked subsystems with internal parameters that can be altered, just like the big boys do it. For example, I have a gravity model with the grav constant mu as one of the inputs. I'd like to use this to generate models for earth, moon, sun, etc. Just change the mu parameter. I also have a rocket thrust model, with Isp (specific impulse) and nominal thrust as parameters. Same deal. The reason I'm asking is, I tried this before on the rocket model, and got into a lot of trouble. I built the motor as a masked subsystem, and stored it in a library. Then I made three copies, to simulate a three-stage booster. But when I changed the thrust level for any one of the three motors, it changed them _ALL_, including the value in the library. I know I was doing something fundamentally wrong, but can't figure what it would be. A word from a guru here will probably suffice to get me back on track. Thanks Jack
From: Rune Allnor on 14 Mar 2010 15:58 On 14 Mar, 19:24, Jack Crenshaw <jcr...(a)earthlink.net> wrote: > Hi. I have some models that I'm building for aerospace work, and I'd > like to turn them into masked subsystems with internal parameters that > can be altered, just like the big boys do it. > > For example, I have a gravity model with the grav constant mu as one of > the inputs. I'd like to use this to generate models for earth, moon, > sun, etc. Just change the mu parameter. > > I also have a rocket thrust model, with Isp (specific impulse) and > nominal thrust as parameters. Same deal. > > The reason I'm asking is, I tried this before on the rocket model, and > got into a lot of trouble. I built the motor as a masked subsystem, and > stored it in a library. Then I made three copies, to simulate a > three-stage booster. > > But when I changed the thrust level for any one of the three motors, it > changed them _ALL_, including the value in the library. > > I know I was doing something fundamentally wrong, but can't figure what > it would be. A word from a guru here will probably suffice to get me > back on track. Don't know much about simulink, but it seems you would want to define the rocket as a class, and the particular examples as instances of that class. Look up the simulink docs for "object oriented programming". Rune
From: Jack Crenshaw on 15 Mar 2010 12:15 Rune Allnor wrote: > On 14 Mar, 19:24, Jack Crenshaw <jcr...(a)earthlink.net> wrote: >> Hi. I have some models that I'm building for aerospace work, and I'd >> like to turn them into masked subsystems with internal parameters that >> can be altered, just like the big boys do it. >> >> For example, I have a gravity model with the grav constant mu as one of >> the inputs. I'd like to use this to generate models for earth, moon, >> sun, etc. Just change the mu parameter. >> >> I also have a rocket thrust model, with Isp (specific impulse) and >> nominal thrust as parameters. Same deal. >> >> The reason I'm asking is, I tried this before on the rocket model, and >> got into a lot of trouble. I built the motor as a masked subsystem, and >> stored it in a library. Then I made three copies, to simulate a >> three-stage booster. >> >> But when I changed the thrust level for any one of the three motors, it >> changed them _ALL_, including the value in the library. >> >> I know I was doing something fundamentally wrong, but can't figure what >> it would be. A word from a guru here will probably suffice to get me >> back on track. > > Don't know much about simulink, but it seems you would want > to define the rocket as a class, and the particular examples > as instances of that class. > > Look up the simulink docs for "object oriented programming". Thanks, but that's not how Simulink works. It's programmed by connecting blocks in a graphical block-diagram kind of way. A user can define his own blocks, cascade them like nested functions, and copy them. He can put created blocks in a library, and copy them into new Simulink models. OOD has nothing to do with it, except in the notion of making multiple instances of library blocks. But thanks anyway, for responding. Jack
|
Pages: 1 Prev: How to find position of specific vector value Next: Urgent Help |