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
 Forum for Origin C
 Nonlinear fit

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
zlostar Posted - 12/06/2008 : 10:50:47 AM
Origin Ver.8G and SR 4
Operating System: xp SR2

Hi all,

I want to make two nonlinear curves with the equations
y = B*x - B*C*x^2 and
y = (C*x)/(1 + A*x),
where A, B and C are parameters, but
I have no Idea what will the C-Code look like?

Can somebody help me??
1   L A T E S T    R E P L I E S    (Newest First)
Iris_Bai Posted - 12/10/2008 : 02:49:19 AM
Hi,

In Origin C, vector support do calculation with operator +, -, *, /, ^. See the following example:


void calculate(vector& vx, vector& vy, double B, double C)
{	
	vy = B*vx - B*C*vx^2;	
}

void testOK()
{
	Worksheet wks;
	wks.Create("origin");
	
	Dataset dsX(wks, 0);
	Dataset dsY(wks, 1);
	dsX.Data(1, 10, 1); // set data from 1 to 10 with 1 increment
	
	calculate(dsX, dsY, 0.5, 1);
	
	GraphPage gp;
	gp.Create("origin");
	GraphLayer gl = gp.Layers(0);
	gl.AddPlot(wks);
}


Iris

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