Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

scale functions

Please login with a confirmed email address before reporting spam

I am trying to scale a geometry object using a function. The documentation for the scale() function says this should be possible, but I keep getting errors as described below:

given a 3D geometry object g1, I've tried the following:

g2=scale(g1,1,1,3*z,0,0,0)
ERROR - ??? Undefined function or variable 'z'.

g2=scale(g1,1,1,'3*z',0,0,0)
ERROR - ??? Error using ==> geom3.scale at 78, zscale must be a real scalar


I've also tried similar approaches in the COMSOL GUI, but with no success.




Can anyone tell me how to apply a scale function?



Thanks!


Douglas Cook
Purdue University

1 Reply Last Post 23 juin 2009, 09:31 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago 23 juin 2009, 09:31 UTC−4
Hi Douglas,

The scale function takes real numbers as input, both for the scale factors and and the scale base point. To scale a geometry object g1 by a factor 3 in the z-direction, about (0,0,0), use

g2 = scale(g1,1,1,3,0,0,0);

or even shorter

g2 = scale(g1,1,1,3);

In the COMSOL GUI, this is equivalent to selecting Draw>Modify>Scale and setting the z Scale factor to 3.

Anders
Hi Douglas, The scale function takes real numbers as input, both for the scale factors and and the scale base point. To scale a geometry object g1 by a factor 3 in the z-direction, about (0,0,0), use g2 = scale(g1,1,1,3,0,0,0); or even shorter g2 = scale(g1,1,1,3); In the COMSOL GUI, this is equivalent to selecting Draw>Modify>Scale and setting the z Scale factor to 3. Anders

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.