bugGNU Octave - Bugs: bug #46751, Blank Workspace and blank command...

 
 

bug #46751: Blank Workspace and blank command window after and during code execution

Submitter:  None
Submitted:  Wed 23 Dec 2015 04:48:59 PM UTC
   
 
Category:  GUI Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Other
Status:  Works For Me Assigned to:  None
Originator Name:  Harry Georgiou Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 11 Mar 2016 12:44:43 AM UTC, comment #5: 

Closing report as works for me, it sounds like all issues are addressed. If there are still problems with variables not showing up in the workspace panel when a breakpoint is hit, please file another bug report.

Mike Miller <mtmiller>
Group Member
Tue 26 Jan 2016 12:51:04 PM UTC, comment #4: 

The code you posted below doesn't run for me.

However, if I do something simple such as:

while(1)
   B = "1";
 endwhile

.. and press Ctrl-C, I see the variables I have used, and if I RUN A=1 in the command window, I see variable A added to the work space.



 


John Donoghue <lostbard>
Group Member
Mon 25 Jan 2016 03:18:38 PM UTC, comment #3: 

Hey Mike and John,
Thanks I did not realise I was answered
 What you said worked about the More off command in seeing the output in the command line, I prefer that

Another thing is with break points they don't refresh or clear from the gui which I know is a bug which people are working on. Also the break points get cleared once you click the start script and so if possible I would want to run my scripts without the breakpoints being as this is what happens if I press play for my script.

The only thing is the workspace is not updated during this time which might or might not be a bug, I would expect or rather hope that the work space updates. After this though, if I press ctrl-x or ctrl-c the stop the program and then type out a=1 the workspace remains blank.
Surely this is a mistake?

Harry

Anonymous
Wed 23 Dec 2015 10:21:50 PM UTC, comment #2: 

John has explained that the workspace view does not update during execution, so what you are seeing is the expected behavior.

The screen pager is enabled by default in Octave, meaning output to the command window will be buffered until a command completes or at least a full screen of output is written. To turn this off, run "more off" or "page_screen_output(false)".

So I think the two issues you describe are covered, can you confirm that adding "more off" to the top of your script gives you the command window output you expect?

Mike Miller <mtmiller>
Group Member
Wed 23 Dec 2015 09:39:53 PM UTC, comment #1: 

Hi,

The workspace does not update during run of the program.
To see the values of variables you need to stop the program.

Alternatively you could set breakpoints in the code.

John Donoghue <lostbard>
Group Member
Wed 23 Dec 2015 04:48:59 PM UTC, original submission:  

I am running a program to load every package and then I open up a user interface to load or find the file I want to import from the code.

I load my file, after which though the command window does not load, this could be code issues in what I have written but the other problem loading my file and wait for it to run and get a blank screen in the command window. This is cleared for whatever reason it is happening by pressing control C.
The program runs a bit more and I get an array list in my command window. I then also press q to skip to the end of the program if possible. Things in the code in theory should have been loaded and run but I have to copy and paste them in the command line again to produce variables in the workspace.

I then notice that the workspace is blank and so I cannot be sure if anything was run or skipped and why it would have been skipped is also confusing because the data that may have had problems with the code I have written is after where there apparently is a problem.

Here is part of my code while it is not needed to understand I am just showing the code which does not seem to work: but should the workspace be blank and the command line hang until I press Control C. At least if the code is wrong which I am sure it is the workspace should not be empty and more values should be there.

clc
clear all
pkg load all % this ensures all the octave packages are loaded so that i can use the files

[FNAME, FPATH, FLTIDX] = uigetfile ('Choose an ocw or txt file solar Intensity Sun');
addpath(FPATH); % this adds thehe paths to the working directory
Fid = fopen(FNAME);

[ListofFiles] = dir(FPATH);
skiplines = 2;

formatspec = '%f%f'; %This tells octave that I want two floating point numbers or doubles and have an array
IVDATA = textscan (Fid, formatspec, 'HeaderLines', skiplines);
voltage = IVDATA{1,1};
current = IVDATA{1,2};

voltage = -voltage;
current = -current;
%FIRST LIGHT CURVE IF I PLOT IT////////////////////////////////////////////////////////////////////////////////////

IVDATA = [voltage,current];

y = current;
t = voltage;

%ba=1;
%Now I want to get the Voc point for any curve so just start with an index variable
b=1;

while y(b) < 0 %This obtains the point at which the current hits the Voc position
  b=b+1; % this will increase the value of i until current(i) or the current is just past 0 after the first time
endwhile

Grad2Current = diff(diff(current))
BigValsFirst = sort(Grad2Current)
b2 =1;
while abs(Grad2Current(b2)) < abs(BigValsFirst(1)) %This gets the first quarter of the whole curve even after Voc as the dataset contains two scans with a reverse scan each
  b2 = b2 +1
endwhile

Voc_index=b % just so I know what i is when I see it below
fit = polyfit(voltage(1:150),current(1:150),2)
IV10 = [current(b-100:b), voltage(b-100:b)];
k10 = diff(IV10(:,1))./diff(IV10(:,2));
AveGrad = mean(k10);

%Preparing the matrix of values
A = y(1:Voc_index);
B = -ones(Voc_index,1);
C = t(1:Voc_index);% cumtrapz(t(1:Voc_index), -B);
D = 1/2*t(1:Voc_index).^2; %cumtrapz(t(1:Voc_index), C);
Phi = [A, B, C, D];
%The other matrix
Gamma = cumtrapz(t(1:Voc_index), y(1:Voc_index));   
Theta = (inverse((transpose(Phi)*Phi))*transpose(Phi))*Gamma

%The Resistanc limits
Rs_upp=(1/AveGrad)*-1%as it is a negative resistance otherwise;
Rs_low=0
%creating a set of 100 evenly spaced resistance values between the Resistance limits
Rs = linspace(Rs_upp, Rs_low,100);

%Now the refining
a =Theta(1)
I_L= Theta(2)/Theta(1)
Io = (Theta(3) - Theta(2)/Theta(1)- Theta(1)*Theta(4))
Rsh = 1/Theta(4); %So that Resistance is positive
Initial_Vals = [a, I_L, Io, Rsh]'
q=1
n=1000;
cycle = 1;
Rs = Rs(1)

%Build up yHat
while q <=Voc_index
  q
  yHat(q)= I_L -(Io ( exp( voltage(q)+ Rs y(q) /a ) - 1) ) - ( (voltage(q) +Rs * y(q) ) / Rsh);
  q=q+1;
endwhile

%Getting the ERROR
L = 1;
%ERR=∑N i=1, [yHat(ti)−y(ti)]
while L<Voc_index
  ERR_unit(L) = sum(yHat(L)-y(L));
  L=L+1;
endwhile
ERR = sum(ERR_unit)

%Getting the Root mean square
Nval = 1    
while Nval <=Voc_index
  RMSE_prt1(Nval) = (  yHat(Nval) - y(Nval) ) .^2 ;
  Nval = Nval +1;   
endwhile
RMSE = sqrt(    sum(RMSE_prt1)   /  length(RMSE_prt1) )   

%ERR=∑N i=1, [yHat(ti)−y(ti)]
ERR = sum(ERR_unit)
PosERR= sqrt(ERR*ERR)
Sum_squars = sumsq(y(1:Voc_index));
Tol = 0.001 %it says 2% in the paper, but 2% of what? originally I had Sum_squars*10*RMSE
Rs
q=1

RIndex1 = 1;
RIndex2 = 1;
while PosERR > Tol
  k=1
  Tol
  RMSE
  n =100;
  ERR
  cycle
  if ERR > 0
  %Chooseing Rs_low or Rs_upp
  Rs
  Rs = (Rs +Rs_low)/2;
  Rs
  Rs_upp=Rs

  %fit = polyfit(voltage(1:150),yHat(1:150),2)
  IV10 = [current(b-100:b), voltage(b-100:b)];
  k10 = diff(IV10(:,1))./diff(IV10(:,2));
  AveGrad = mean(k10);

  %Preparing the matrix of values
  A_Hat = yHat(1:Voc_index);
  B = -ones(Voc_index,1);
  C = t(1:Voc_index);% cumtrapz(t(1:Voc_index), -B);
  D = 1/2*t(1:Voc_index).^2; %cumtrapz(t(1:Voc_index), C);
  Phi_Hat = [A_Hat, B, C, D];
  %The other matrix
  Gamma_Hat = cumtrapz(t(1:Voc_index), yHat(1:Voc_index));   
  Theta_Hat = (inverse((transpose(Phi_Hat)*Phi_Hat))*transpose(Phi_Hat))*Gamma_Hat
  %The Resistanc limits
  Rs_upp=(1/AveGrad)*-1%as it is a negative resistance otherwise;
  Rs_low=0
  %creating a set of 100 evenly spaced resistance values between the Resistance limits
  Rs = linspace(Rs_upp, Rs_low,100);

  %Now the refining
  a_Hat =Theta_Hat(1)
  I_L_Hat = Theta_Hat(2)/Theta_Hat(1)
  Io_Hat = (Theta_Hat(3) - Theta_Hat(2)/Theta_Hat(1)- Theta_Hat(1)*Theta_Hat(4))
  Rsh_Hat = 1/Theta_Hat(4); %So that Resistance is positive
  Initial_Vals_Hat = [a_Hat, I_L_Hat, Io_Hat, Rsh_Hat]'
  q=1
  n=1000;
  cycle = 1;
  Rs = Rs(1)

  %Build up yHat
  while q <=Voc_index
    q
    yHat(q)= I_L_Hat -(Io_Hat ( exp( voltage(q)+ Rs yHat(q) /a_Hat ) - 1) ) - ( (voltage(q) +Rs * yHat(q) ) / Rsh_Hat);
    q=q+1;
  endwhile
 
    while q <=Voc_index
      q
      yHat(q)= I_L_Hat -(Io_Hat ( exp( voltage(q)+ Rs yHat(q) /a_Hat ) - 1) ) - ( (voltage(q) +Rs * yHat(q) ) / Rsh_Hat);
      q=q+1
    endwhile 
    q = 1
    L = 1;
    %ERR=∑N i=1, [yHat(ti)−y(ti)]
    Nval = 1
    while Nval <=Voc_index %Getting the RMSE
      RMSE_prt1(Nval) = (  yHat(Nval) - y(Nval) ) .^2 ;
      Nval = Nval +1;       
     endwhile
    RMSE = sqrt(    sum(RMSE_prt1)   /  length(RMSE_prt1) )  
    while L<Voc_index %Recalculating the Error
      ERR_unit(L) = sum(yHat(L)-y(L));
      L=L+1;
    endwhile
    ERR = sum(ERR_unit)       
  elseif ERR < 0
    Rs = (Rs+Rs_upp)/2;
    Rs
    Rs_low=Rs
    q=1
    %Getting yHat with new Rs
      %fit = polyfit(voltage(1:150),yHat(1:150),2)
  IV10 = [current(b-100:b), voltage(b-100:b)];
  k10 = diff(IV10(:,1))./diff(IV10(:,2));
  AveGrad = mean(k10);

  %Preparing the matrix of values
  A_Hat = yHat(1:Voc_index)';
  B = -ones(Voc_index,1);
  C = t(1:Voc_index);% cumtrapz(t(1:Voc_index), -B);
  D = 1/2*t(1:Voc_index).^2; %cumtrapz(t(1:Voc_index), C);
  Phi_Hat = [A_Hat, B, C, D];
  %The other matrix
  Gamma_Hat = cumtrapz(t(1:Voc_index), yHat(1:Voc_index)');   
  Theta_Hat = (inverse((transpose(Phi_Hat)*Phi_Hat))*transpose(Phi_Hat))*Gamma_Hat
  %The Resistanc limits
  Rs_upp=(1/AveGrad)*-1%as it is a negative resistance otherwise;
  Rs_low=0
  %creating a set of 100 evenly spaced resistance values between the Resistance limits
  Rs = linspace(Rs_upp, Rs_low,100);

  %Now the refining
  a_Hat =Theta_Hat(1)
  I_L_Hat = Theta_Hat(2)/Theta_Hat(1)
  Io_Hat = (Theta_Hat(3) - Theta_Hat(2)/Theta_Hat(1)- Theta_Hat(1)*Theta_Hat(4))
  Rsh_Hat = 1/Theta_Hat(4); %So that Resistance is positive
  Initial_Vals_Hat = [a_Hat, I_L_Hat, Io_Hat, Rsh_Hat]'
  q=1
  n=1000;
  cycle = 1;
  Rs = Rs(1)

  %Build up yHat
  while q <=Voc_index
    q
    yHat(q)= I_L_Hat -(Io_Hat ( exp( voltage(q)+ Rs yHat(q) /a_Hat ) - 1) ) - ( (voltage(q) +Rs * yHat(q) ) / Rsh_Hat);
    q=q+1;
  endwhile
 
    while q <=Voc_index
      q
      yHat(q)= I_L_Hat -(Io_Hat ( exp( voltage(q)+ Rs yHat(q) /a_Hat ) - 1) ) - ( (voltage(q) +Rs * yHat(q) ) / Rsh_Hat);
      q=q+1
    endwhile 
    q = 1
    L = 1;
    while q <=Voc_index
      yHat(q)= I_L -(Io ( exp( voltage(q)+ Rs y(q) /a ) - 1) ) - ( (voltage(q) +Rs * y(q) ) / Rsh);
      q=q+1
    endwhile
    L = 1;
    %ERR=∑N i=1, [yHat(ti)−y(ti)]
    Nval = 1    
    while Nval <=Voc_index %Getting the RMSE
      RMSE_prt1(Nval) = (  yHat(Nval) - y(Nval) ) .^2 ;
      Nval = Nval +1;
    endwhile
   
    RMSE = sqrt(    sum(RMSE_prt1)   /  length(RMSE_prt1) )  
    while L<Voc_index %Recalculating the Error
      ERR_unit(L) = sum(yHat(L)-y(L));
      L=L+1;
    endwhile
    ERR = sum(ERR_unit)
    Rs     
    cycle = cycle+1
    endif
endwhile

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-11 mtmiller StatusNeed Info Works For Me
        Open/ClosedOpen Closed
    2015-12-23 mtmiller Severity3 - Normal 2 - Minor
        Item GroupNone Other
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code