bugGNU Octave - Bugs: bug #52921, [octave forge] (symbolic) writing...

 
 

bug #52921: [octave forge] (symbolic) writing symbolic functions to file truncates output

Submitter:  None
Submitted:  Wed 17 Jan 2018 09:06:19 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 18 Jan 2018 04:03:39 AM UTC, comment #4: 

Yes now works. Thanks again.

Anonymous
Wed 17 Jan 2018 10:35:14 PM UTC, comment #3: 

Oh, this is trivial, nothing to do with the symbolic package, you didn't fclose(fileID). The rest of the file is buffered and not yet flushed to the file system. You were checking the file before exiting Octave, and I was exiting Octave before looking at the file.

Mike Miller <mtmiller>
Group Member
Wed 17 Jan 2018 10:12:18 PM UTC, comment #2: 

Thank you for looking into this.

symbolic-2.6.0
Python 2.7.6 || Python 3.4.3
sympy 1.1.1

Linux 3.13.0 #186+7.0trisquel2 x86_64 GNU/Linux

Note: When I try commenting out the fprintf of the first two functions the output is blank.



Anonymous
Wed 17 Jan 2018 09:44:09 PM UTC, comment #1: 

It works for me. It appears to be truncating the output at exactly 4096 characters on your system (the size of your attached partial_derivatives_E0.m). I think we might need more information about how this can be reproduced, including OS, version of symbolic, Python version, SymPy version.

Mike Miller <mtmiller>
Group Member
Wed 17 Jan 2018 09:06:19 PM UTC, original submission:  

Attached are the function and output:

make_all produces all the symbolic functions and writes them to the other file.

This works and then appears to stop see below:

function [fy_d_Y0] = make_fy_d_Y0(c,o,p,k,X0,Y0,Z0,X,Y,Z)
fy_d_Y0=(sin(k)*sin(o)*sin(p) - cos(k)*cos(o))/((X - X0)*sin(p) - (Y - Y0)*sin(o)*cos(p) + (Z - Z0)*cos(o)*cos(p)) - (c*(X - X0)*sin(k)*cos(p) + (Y - Y0)*(-sin(k)*sin(o)*sin(p) + cos(k)*cos(o)) + (Z - Z0)*(sin(k)*sin(p)*cos(o) + sin(o)*cos(k)))*sin(o)*cos(p)/((X - X0)*sin(p) - (Y - Y0)*sin(o)*cos(p) + (Z - Z0)*cos(o)*cos(p))**2;
end

function [fx_d_Z0] = make_fx_d_Z0(c,o,p,k,X0,Y0,Z0,

The function fy_d_Y0 is written with no issue.

Note: If I comment out the fist function the output contains fx_d_Z0 but stops somewhere else:

function [fy_d_Z0] = make_fy_d_Z0(c,o,p,k,X0,Y0,Z0,X,Y,Z)
fy_d_Z0=(-sin(k)*sin(p)*cos(o) - sin(o)*cos(k))/((X - X0)*sin(p) - (Y - Y0)*sin(o)*cos


Is there a character limitation? Is there a better way to implement what I am attempting to do?

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #42942:  make_all.m added by None (10KiB - text/x-objcsrc)
file #42943:  partial_derivatives_EO.m added by None (4KiB - text/x-objcsrc)

 

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)
  •  

    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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-17 mtmiller StatusWorks For Me Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2018-01-17 mtmiller CategoryNone Octave Package
        Item GroupNone Incorrect Result
        StatusNone Works For Me
        SummaryUnable to write symbolic function to file [octave forge] (symbolic) writing symbolic functions to file truncates output
    2018-01-17 None Attached File- Added make_all.m, #42942
        Attached File- Added partial_derivatives_EO.m, #42943

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code