Programming solve function - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Programming solve function (/thread-10871.html) |
Programming solve function - Gene222 - 06-04-2018 05:07 PM I am having trouble programming the SOLVE and fsolve functions, and I am not sure of what I am doing wrong. I can run solve on the HP Prime, but I can't programmatically solve the equation. [9/17/19. Replaced tinypic image] EDIT 6/4/18 corrected error in code with the radius, but still can't get code to work. Code: EXPORT OldAAngleSetting,theta,radius,x,q,v; RE: Programming solve function - Carlos295pz - 06-05-2018 12:33 AM The value returned by SOLVE was not stored. The CAS has a 'radius' command, so it will not be able to directly capture the exported variable of the program. Code: EXPORT OldAAngleSetting,theta,rads,q,v; //← x isn't necessary, radius → rads RE: Programming solve function - Carlos295pz - 06-05-2018 03:07 AM If you persist in using "radius", you can evade the name resolution CAS-Home by manufacturing the data in strings before sending it to the CAS, in this way it can be done for similar cases. Code: theta:=fsolve(EVAL("x-SIN(x)=2*q/(v*"+radius+"^2),x=3")); RE: Programming solve function - Gene222 - 06-05-2018 03:07 AM Thanks. Your "fsolve" equation changes also work with the "solve" command, which is what I initially wanted to do. I used "radius" to differentiate the pipe radius from the hydraulic radius "r". Geez... |