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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 how to choose the row that I want ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nabilou

France
5 Posts

Posted - 01/18/2013 :  10:33:14 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
well my problem is the following:

I have 3 columns, A, B and C
A is X: x
B is Y: f(x)
Y is C: g(x)

knowing that f(x) depends on g(x) as follow:

f(x) = 1/Ln(g(x))
g(x) = [(f(x)/a)^(-1/2)]*b

I need to plot the two curves, but it was not easy because the two are not independent.

by cons, I thought of a solution to the problem. If I know the two initial values of f(x) and g(x), I can do it.

here's how:

A; B; C
1; b1=5; c1=3;
2; b2; c2;
3; b3; c3;
4; b4; c4;
5; b5; c5;

therefore, to calculate the value b2, I should use c1 = 3 , and to calculate the value c2 I should use b2. to calculate the value b3, I should use c2, and to calculate the value c3 I should use b3. and so on

the problem now is that I do not know how I do ...!
should I use set values ? C++ ? LabTalk ?


Thanks

Hideo Fujii

USA
1582 Posts

Posted - 01/18/2013 :  1:44:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi nabilou,

Set Column Value tool wouldn't do your job because the computational process should proceed alternatively between col(B) and col(C), not independently.
Maybe you can try the script using a loop like following:
lastRow=5;
col(A)=data(1,lastRow,1); //init=1, last=lastRow, inc=1
col(B)[1]=5;
col(C)[1]=3;
For(ii=2; ii<=lastRow; ii++) {
  col(B)[ii]=1/ln(col(C)[ii-1]);
  col(C)[ii]=((col(B)[ii]/col(A)[ii])^(-1/2))*col(B)[ii];
}

Hope this works as you expected.

--Hideo Fujii
OriginLab
Go to Top of Page

nabilou

France
5 Posts

Posted - 02/20/2013 :  05:01:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thank you, it's working..!

Thanks
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000