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
 Plotting 3D Functions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

strain17

USA
Posts

Posted - 11/17/2003 :  4:41:02 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
I was wondering how you could plot 3D funtions in Origin. Lets say for example a sphere, z^2=x^2+y^2. Or if I have a function of Z in terms of sin(x) and sin(y), how would I plot that ?
I tried setting my values in a matrix as z = (x^2+y^2)^(1/2). It gave me this error:

Error, Variable "(i" not declared
Error, general compile error
Error, error(s) found in compiling function _MatrixSetValuesFromXYIJ

Any help would be greatly appreciated. Thanks.

easwar

USA
1965 Posts

Posted - 11/17/2003 :  9:16:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Looks like you are using Orign version 7 or higher, and have the "Compile as Origin C and treat x^y as pow(x,y)" checkbox checked in the Set Matrix Values dialog box. Checking this box results in much faster computation of the matrix values, but the expression needs to be ANSI C compatible.

I am not sure how you got the
Error, Variable "(i" not declared
message, since your expression does now have any "i" in it.
Did you enter the expression:
(x^2+y^2)^(1/2).
with a period at the end of the expression?
You will then get the error:
Error, Variable "(1/2)." not declared
If this is what you got, you need to remove the period, and just enter:
(x^2+y^2)^0.5
Note that I used 0.5 instead of (1/2). In C, (1/2) = 0 because this is treated as integer division, and so your expression for z will be equal to 1 at all x and y values. You need to enter fractions as (1.0/2) or (1/2.0) etc. to get the floating point value you desire.

Now, Origin matrices currently support only single-valued z(x,y) functions and so you cannot plot a sphere with just one matrix.

Easwar
OriginLab.

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/18/2003 :  2:03:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You might find some useful ideas in this topic: plot a sphere.

Mike Buess
Origin WebRing Member
Go to Top of Page

strain17

USA
Posts

Posted - 11/19/2003 :  01:05:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Mike and easwar,
Thanks for the feedback. It helped me.

easwar,
Sorry for not explaining. The error should be:
Error, Variable "(x" not declared
Error, general compile error
Error, error(s) found in compiling function _MatrixSetValuesFromXYIJ

I had changed the "x" in the equation to an "i" after I saw the error. As you can see, same error occurs. I wonder why.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 11/19/2003 :  2:51:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You will need to put variables x, y etc into lower case.

Also, you can use

sqrt(x^2+y^2)


CP


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