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
 Integral with varialbe Limit
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dadude1105

Germany
1 Posts

Posted - 05/28/2014 :  07:07:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello, I need to plot an integral from T to H=const on the y-axis and T on the x-axis. So the integral is regulated by T. How can I do this?

The next step would then be to divide the Integrale by a function regulatet by T.
So I need to plot this against 1/T

lkb0221

China
497 Posts

Posted - 05/29/2014 :  10:12:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please try the following LT script:

// Script Start
range rT = col(A); // assume col(A) contains the T values
range rResult = col(B); // This is where to put the result
double A = 10; // This is the A value, which is const

//Define f(x)
function double TestEq(double x)
{
return 1 + 2 * x + 3 * x^2;
}

// Calculate the result column
for (int ii = 1; ii <= rT.GetSize(); ii++)
{
double currentT = rT[ii];
rResult[ii] = Integral(TestEq, currentT, A); // Calculate the integral of f(H)
rResult[ii] = rResult[ii] / TestEq(currentT); // Devided by f(T)
}

// Plot them
plotxy iy:=(rT,rResult);

// Script End

Edited by - lkb0221 on 05/29/2014 10:16:22 AM
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 05/29/2014 :  12:01:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

If you like a non-script way, you can simply use "Analysis: Math: Integrate" menu (as Integral[T:A]f(x)dx = -Integral[A:T]f(x)dx),
combined with the Set Column Values tool. See the sample screen. Here, col(B) is your function values (e.g., sqrt(x) here),
col(C) is the integration result from Analysis menu. col(D) is the result of the Set Column Values tool to calculate (-1)*col(C)/col(B).
Now you can simply plot col(C) (or col(D)) vs. A(X). Does it work for you?



--Hideo Fujii
OriginLab
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