cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to plot a tensor (4D surface) in Mathcad 13 or 14?

John_G
1-Newbie

Is it possible to plot a tensor (4D surface) in Mathcad 13 or 14?

I would like to plot a 4-dimensional surface using Mathcad. I think this would be a tensor, i.e. visualized as a 3D surface with vectors of various heights projected on top. I found in Mathcad 14 an quicksheet (Using Regress: Multivariate Regression) of a 3D plot using the 'regress' and 'mesh' functions. I wonder if this is the limit, or if I can plot a tensor somehow using these, or other mathcad 14 functions? Thanks - JCG

6 REPLIES 6

John Gray wrote:

I would like to plot a 4-dimensional surface using Mathcad.

John!

Do you have a function of 3 variables - f(x, y, z)?

I have not yet generated the function in 3 variables - I have test data reduced to 4 sets of (3 sets of (a function of 1 variable))). Further data reduction is required. With the quick sheet method using 'regress' referenced in my original question, I will likely be able to get a least squares reduction to 2 variables.

So, in parallel with my first question, I have a second one. That is: Is there a way to generate a least squares data fit in 3 variables using Mathcad, perhaps using the 'regress' function?

Thanks,

JCG

John Gray wrote:

So, in parallel with my first question, I have a second one. That is: Is there a way to generate a least squares data fit in 3 variables using Mathcad, perhaps using the 'regress' function?

It is possible. You must convert your matrix into 4 vectors f, x, y and z and use the minimize or minerr function.

See same task for 2 variables:

http://twt.mpei.ac.ru/ochkov/car/c_e.html

RichardJ
19-Tanzanite
(To:John_G)

So, in parallel with my first question, I have a second one. That is: Is there a way to generate a least squares data fit in 3 variables using Mathcad, perhaps using the 'regress' function?

You can do a least squares fit in any number of dimensions. Regress will fit multinomials, but you can also fit any arbitrary function. See the worksheet I posted here:

http://communities.ptc.com/message/162498#162498

It was posted in answer to a somewhat different question, but it shows how to fit a function to a surface using minerr. This is easily extensible to any number of dimensions, and any function.

I have not yet generated the function in 3 variables - I have test data reduced to 4 sets of (3 sets of (a function of 1 variable))). Further data reduction is required. With the quick sheet method using 'regress' referenced in my original question, I will likely be able to get a least squares reduction to 2 variables.

If you have a large number of measurements in N variables a very good approach to variable reduction is often principal component analysis. It will generate a new set of variables that are guaranteed to be orthogonal, and they will explain a gradually decreasing amount of the variance in the data. I can't say how well this would work for your data without seeing the data though.

StuartBruff
22-Sapphire II
(To:John_G)

John Gray wrote:

I would like to plot a 4-dimensional surface using Mathcad. I think this would be a tensor, i.e. visualized as a 3D surface with vectors of various heights projected on top. I found in Mathcad 14 an quicksheet (Using Regress: Multivariate Regression) of a 3D plot using the 'regress' and 'mesh' functions. I wonder if this is the limit, or if I can plot a tensor somehow using these, or other mathcad 14 functions? Thanks - JCG

John,

You could try, as a starting point, something like the attached. However, it is rather contingent upon your 'surface' being amenable to such a representation. Sadly, the 3D plot component doesn't seem to allow setting of colour by x,y,z position otherwise that might be another way of visualizing the data.

Stuart

The example mathcad tensor plots certainly have all the graphic elements I have been seeking.

I will need to study the program you've written to generate the arrows as this is an aspect of Mathcad programming that I've not yet worked. I plan to attempt this method and get back to you with any detailed questions.

Thanks,

JCG

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."