The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Roots of a polynom equation

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000