T O P I C R E V I E W |
JokerOne |
Posted - 02/18/2016 : 11:17:01 AM Origin Ver. 9 and Service Release 1(Select Help-->About Origin): Operating System: Win 7
Is there a LabTalk Command that provides the root of a polynom-equation, like 3x^3 -7.1527x = 0 to solve for all x that fulfills this equation.
e.g.: dataset roots coeff[1] = 3 coeff[2] = 0 coeff[3] = -7.1527 coeff[4] = 0 roots = find_roots(coeff)
The function is suppose to also work for polynom equation of higher order.
As as option, is there an option to investiage a polynom for maximum/minimum condition, etc?
Thanks for your help. |
4 L A T E S T R E P L I E S (Newest First) |
Hideo Fujii |
Posted - 02/19/2016 : 09:58:46 AM Hi,
As a reference for public, the following is the workable code:col(1)=data(-100,100, 0.05);
col(2)=3*col(1)^3 -7.1527*col(1);
range bbb = [??]!loose_a; //to define the range of a loose dataset
levelcrossing iy:=col(2) level:=0 oy:=bbb;
bbb[1]=; You can read the details about the loose dataset at: http://www.originlab.com/doc/LabTalk/guide/Range-Notation#Loose_Dataset
--Hideo Fujii OriginLab
P.S. You can also write the range string of the loose dataset in the x-function like: levelcrossing iy:=col(2) level:=0 oy:=[??]!loose_a; loose_a[1]=;
|
JokerOne |
Posted - 02/19/2016 : 06:57:00 AM I guess, that I found the correct syntax now.
I had an issue with providing the XYRange in levelcrossing correctly, at least that is what I am thinking.
Thanks again for the hint for the levelcrossing function, this is very helpful.
|
JokerOne |
Posted - 02/19/2016 : 05:56:06 AM Thanks again,
may I continue with a question refering:
I would prefer, to store the result, i.e., the roots in a dataset rather than in a particular worksheet. If I get the documentation correctly, this will then be called a loose dataset? I tried to do this, but my syntax is properly not correct
dataset bbb; col(2)=3*col(1)^3 -7.1527*col(1); levelcrossing iy:=col(2) level:=0 oy:=bbb; bbb[1]= [does not work] bbb[2]= [does not work]
also, maybe, I cannot put the result of the the levelcrossing function in a dataset? When the documentation requests an "Output Vector" as datatype, is a [loose?-]dataset allowed?
Maybe, I can store the results in bbb, but I did not manage to access the dataset correctly?
|
Hideo Fujii |
Posted - 02/18/2016 : 2:15:43 PM Hi JokerOne,
> Is there a LabTalk Command that provides the root of a polynom-equation, like > 3x^3 -7.1527x = 0
To solve this numerically, the following should do that task:col(1)=data(-100,100, 0.05);
col(2)=3*col(1)^3 -7.1527*col(1);
levelcrossing iy:=col(2) level:=0; Hope this helps.
--Hideo Fujii OriginLab |
|
|