Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

Multiple parameter sweep

0 votes
71 views
Hi All,

I want to have parameter value sweep in a single simulation, all at a same time.

Like I have 3 variables, say var1,var2 & var3.

Can I write a script , which will vary all these variable at same time ?

Say simulation will have 1st run, for Var1 =5, Var2=6 AND Var3=9

simulation will have  2nd  run, for Var1 =15, Var2=6 AND Var3=90

Is it possible?

Regards
asked Apr 28 by rajasaha (14 points)

1 Answer

0 votes

This is a general programming question.  If you know your variables beforehand you can just create separate lists of equal length and go through by indexing.  A simple example in Octave is below.


Var1List = [5,15];
Var2List = [6,6];
Var3List = [9,90];

% Add code to check list lengths are equal

NumberOfRuns = length(Var1List)

for k = 1:NumberOfRuns
   printf('%i, %i, %i \n',Var1List(k),Var2List(k),Var3List(k))
end

 

 
answered Apr 30 by Bryan Lieblick (1,941 points)
...