LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fsolve don't work

Hello.

I have a problem with fsolve function. can u help me please?

I think that fsolve function should be work correctly in mathscript node, but I cant use it in my math script node code. this is my code that correctly work in MATLAB:

 

 

 

x0=[150;.00001;1.5];
x1=zeros(Npump,3);
%% make pump curve
for ii=1:Npump
    kk=0;
    QH=zeros(1,3);
    HQ=zeros(1,3);
    for jj=1:2:6
        kk=kk+1;
        QH(kk)=DisQH(ii,jj);
        HQ(kk)=DisQH(ii,jj+1);
    end
    save Q QH
    save H HQ
    x1(ii,:)=fsolve(@pumpcurve,x0);
end

 

 

can u help TO find problem?

0 Kudos
Message 1 of 7
(3,113 Views)

Code snippet of your runnable VI?

0 Kudos
Message 2 of 7
(3,108 Views)

excuse me ToeCutter, I dont understand your mean. this is a part of my code that I have problem with. my code is perform except this part

0 Kudos
Message 3 of 7
(3,104 Views)

Hi behzad,

 

error codes? Error messages? What do you get?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,098 Views)

fsolve() uses Optimization Toolbox. LabVIEW's MathScript does not load toolboxes. You may think about finding the files required for running fsolve() and copying them into your working directory.

 

Check out some other threads: http://forums.ni.com/t5/LabVIEW/Calling-MATLAB-SOAP-From-MathScript/m-p/1237926/highlight/true#M5241...

0 Kudos
Message 5 of 7
(3,088 Views)

thanks a lot ghighuphu. I'll try your suggestion. is any function for nonlinear equation instead of Fsolve?

....

Hi GerdW, thank u too.

0 Kudos
Message 6 of 7
(3,048 Views)

Have you tried searching in the functions palette for "nonlinear?"  The search function is how I got around the various palettes until I learned where most of the stuff was.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(3,041 Views)