rquirt

65 Reputation

3 Badges

12 years, 57 days

MaplePrimes Activity


These are questions asked by rquirt

I created a user library and added a component that I had created from a shared subsystem and this worked fine.

I edited the component in the library to add some additional functionality and saved it.  I then had to reload the library in Maplesim but now I get this error everytime I try to run the simulation:

Cannot resolve `ControlLogix.PIDE` in model `Main`; there is no `ControlLogix` visible

Yet I dragged and dropped the component PIDE from the ControlLogix library.

Can anyone help me to resolve this?

Thanks

I have created a custom port in my MapleSim file and when I try to add the port to a Custom Component I keep getting an error that the connector cannot be found.

The custom port appears in the components pane of my MapleSim model.

I am guessing that I am missing something to fully qualify the port name.

I would like to create a custom component with thermal fluid flow ports but I don't see that type of port as an option in the DAE Custom Component Template.  Can anyone help me with now I would go about doing this?

I have been trying to use fsolve to iteratively solve a free convection heat transfer problem for a heated vertical plate using units and the ThermoPhysicalData library.  I have received some help and have managed to get rid of the eror messages but I still can't seem to get it to solve.

Here is the code

 

restart;
with(Units:-Standard); with(ThermophysicalData);

conv_VerticalPlate_proc := proc (T__side, T__amb, Area, L, varepsilon, q__i)
 
  local sigma, g, T__s, `T__∞`, T__f, k, rho, Cp, Pr, mu, nu, alpha, beta, Ra__L, Nus__L, h, q__h, q__r, q__total;
  g := 9.81*Unit('m'/'s'^2); sigma := 5.6703*Unit('W'/('m'^2*'K'^4))/10^8;
 
  if type(T__side, with_unit) then
    T__s := convert(T__side, temperature, kelvin)
  elif T__side = 0 then
    T__s := 273.15*Unit('K')
  else
    T__s := T__side*Unit('K')
  end if;
 
  if type(T__amb, with_unit) then
    'T__∞` := convert(T__amb, temperature, kelvin)
  elif T__amb = 0 then
    'T__∞` := 273.15*Unit('K')
  else
    `T__∞` := T__amb*Unit('K')
  end if;
 
  T__f := (1/2)*T__s+(1/2)*`T__∞`;
 
  k := Property(thermal_conductivity, temperature = T__f, pressure = Unit('atm'), air);
  rho := Property(density, temperature = T__f, pressure = Unit('atm'), air);
  Cp := Property(Cpmass, temperature = T__f, pressure = Unit('atm'), air);
  Pr := Property(prandtl, temperature = T__f, pressure = Unit('atm'), air);
  mu := Property(viscosity, temperature = T__f, pressure = Unit('atm'), air);
 
  if type(k, with_unit) and type(rho, with_unit) and type(Cp, with_unit) and type(mu, has_unit) then
    nu := mu/rho;
    alpha := k/(rho*Cp);
    beta := 1.0/T__f;
    Ra__L := g*beta*abs(T__s-`T__∞`)*L^3/(alpha*nu);
    Nus__L := (.825+.387*(Ra__L^(1/6))/(((1+(.492/Pr)^(9/16))^(8/27))))^2;
    h := Nus__L*k/L; q__h := h*(T__s-`T__∞`)*Area;
    q__r := varepsilon*sigma*(T__s^4-`T__∞`^4)*Area;
    q__total := q__h+q__r
  else
    0.1e-6*Unit('W')
  end if
 
end proc;
 
conv_VerticalPlate_proc(31.5*Unit('degC'), 20*Unit('degC'), Unit('m'^2), Unit('m'), .9);

                      100.8567010 Unit(W)
 
conv_VerticalPlate_proc(x*Unit('degC'), 20*Unit('degC'), Unit('m'^2), Unit('m'), .9);
 
                         0.001 Unit(W)
 
fsolve(100*Unit('W')-conv_VerticalPlate_proc(x, 20*Unit('degC'), Unit('m'^2), Unit('m'), .9), x = Unit('degC') .. 100*Unit('degC'));
 

 

I would appreciate help wih this.

 

Thanks

when a variable has a value of 0.0 it seems to lose its units.

with(Units:-Standard):

temp := 0.*Unit('degC');
                           temp := 0.
convert(temp, temperature, kelvin);
Error, (in convert/temperature) insufficient information for a temperature conversion
 
temp := 0.1e-1*Unit('degC');
                   temp := 0.01 Unit(°C)
 
Is this true?  How are you supposed to do calculations for example at 0.0 C?
 
convert(temp, temperature, kelvin);
                      273.1600000 Unit(K)
1 2 3 Page 2 of 3