SAM SDK automation using Matlab

  • Mohammed Alfailakawi
  • Topic Author
More
08 Feb 2021 21:41 #9271 by Mohammed Alfailakawi
SAM SDK automation using Matlab was created by Mohammed Alfailakawi
I am trying to automate a solar power tower (SPT) model in Matlab using the SDK.

My goal is to loop the SPT model multiple times using an array of inputs for some variables, e.g. c_atm_0. 

I modified the already existing command based on one single value as follows:
a0= [-0.000558728];
ssccall('data_set_number', data, 'c_atm_0', a0);
    
To a command which I thought can take an array of values as follows:
a0= [-0.000558728;     -0.000347126; -6.89E-05;   4.73E-05];
ssccall('data_set_array', data, 'c_atm_0', a0);
    
However, I got this message in the Matlab command window:
precheck input: variable 'c_atm_0' (<array>) of wrong type, <number> required.

Can you please help me change this single value based set up in order for the model to accept multiple values.

Thanks in advance.

Regards,
Mohammed

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
11 Feb 2021 19:20 #9280 by Paul Gilman
Replied by Paul Gilman on topic SAM SDK automation using Matlab
Hi Mohammed,

In this case, the data type of c_atm_0 is a number, so you can not assign an array value to it.

The following should all work
ssccall('data_set_number', data, 'c_atm_0', -0.000558728);
a0 = -0.000558728;
ssccall('data_set_number', data, 'c_atm_0', a0);

a0= [-0.000558728;  -0.000347126; 6.89E-05; 4.73E-05];
ssccall('data_set_number', data, 'c_atm_0', a0(1));

Thanks,
Paul.

Please Log in or Create an account to join the conversation.

  • Mohammed Alfailakawi
  • Topic Author
More
14 Feb 2021 16:01 #9289 by Mohammed Alfailakawi
Replied by Mohammed Alfailakawi on topic SAM SDK automation using Matlab
Dear Mr. Gilman,

Thanks a lot for your reply, I really appreciate your help and support.

Thanks for the confirmation, I believe I have a better understanding now.

Thanks a lot.

Regards,
Mohammed 

Please Log in or Create an account to join the conversation.

Moderators: Paul Gilman
Powered by Kunena Forum