From: Jack Crenshaw on
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
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
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