Curve fit identical to input data

Discussion in 'Off-Topic Chat' started by pk28831, Feb 9, 2021.

  1. pk28831

    pk28831

    Joined:
    Feb 9, 2021
    Messages:
    1
    Likes Received:
    0
    Hi,
    I am a newbe to Scilab .
    I did a curve fit in Octave, based on digitized data, and wanted to reproduce it in Scilab
    What I get in Scilab is an exact reproduction of the data, not a fitted curve. It seems that all data points are knots, even when I use the option "not_a_knot" .
    I have updated the text file, so that the x-axis is monotone increasing
    I have uploaded the input file and the figure I get in octave.
    The .sci file is:

    charge3=fscanfMat('charge_10C_3.txt');
    d=zeros(size(charge3,1)-1);
    d=diff(charge3( :,1));
    max(d)
    min(d)
    figure;
    p3= splin(charge3( :,1),charge3( :,2), "not_a_knot");
    yyk = interp(charge3( :,1),charge3( :,1), charge3( :,2), p3);
    plot(charge3( :,1),charge3( :,2),'b',charge3( :,1),yyk,'g');
    legends (["U charge","U fit"],[1 2],opt="ul", fontsize=4);
    xlabel (["Soc [-]"],"fontsize",4);
    ylabel (["U cell [V]"], "fontsize" ,4);
    e=charge3( :,2)-yyk
    max(e)
     

    Attached Files:

    Last edited: Feb 9, 2021
    pk28831, Feb 9, 2021
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...