Please login with a confirmed email address before reporting spam
Posted:
9 years ago
May 19, 2015, 10:53 p.m. EDT
Could anyone help please....
Could anyone help please....
Magnus Ringh
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
May 20, 2015, 8:36 a.m. EDT
Hi,
I'm not sure what you want to do, but I can see a couple of issues here:
- Using a step size of 0 is not allowed. You should use a nonzero step size for the range function.
- For a variable defined under Variables, you can define an expression in a flexible way, but it must represent a scalar-valued function (that is, when called with its inputs, it returns a scalar value). You can define a variable as
2*pi*r^2
in an axisymmetric model where r is a spatial coordinate, for example.
The range function returns a list (vector) of values, and it is therefore not applicable in the Variables definitions, so it should not work in any of the cases you describe. It is useful where you specify lists of values: In the Times field for the output times from a time-dependent study, for example.
Best regards,
Magnus Ringh, COMSOL
Hi,
I'm not sure what you want to do, but I can see a couple of issues here:
- Using a step size of 0 is not allowed. You should use a nonzero step size for the range function.
- For a variable defined under Variables, you can define an expression in a flexible way, but it must represent a scalar-valued function (that is, when called with its inputs, it returns a scalar value). You can define a variable as
2*pi*r^2
in an axisymmetric model where r is a spatial coordinate, for example.
The range function returns a list (vector) of values, and it is therefore not applicable in the Variables definitions, so it should not work in any of the cases you describe. It is useful where you specify lists of values: In the Times field for the output times from a time-dependent study, for example.
Best regards,
Magnus Ringh, COMSOL
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
May 20, 2015, 9:59 p.m. EDT
Hello Magnus, thanks for the reply. What I want to do is that to define a variable that varies for continuous range of values like the range function does the same but with a step size(discontinuity).
Hello Magnus, thanks for the reply. What I want to do is that to define a variable that varies for continuous range of values like the range function does the same but with a step size(discontinuity).
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
May 21, 2015, 10:14 a.m. EDT
A continuous range of values takes infinitely long to evaluate. So you probably don't want that....
One way I like evaluating my ranges is using normalized ranges, for example:
5 + 7 * range(0, 0.01, 1)
is a range from 5 to 12 with 101 points.
A nice thing about doing a 0 to 1 range is it's easy to modify the progression. For example, if I want to slowly increase the step size I can do:
5 + 7 * range(0, 0.01, 1)^2
Then I get small steps at the beginning but larger steps at the end but I don't need to do any math to figure out how to adjust the function.
A continuous range of values takes infinitely long to evaluate. So you probably don't want that....
One way I like evaluating my ranges is using normalized ranges, for example:
5 + 7 * range(0, 0.01, 1)
is a range from 5 to 12 with 101 points.
A nice thing about doing a 0 to 1 range is it's easy to modify the progression. For example, if I want to slowly increase the step size I can do:
5 + 7 * range(0, 0.01, 1)^2
Then I get small steps at the beginning but larger steps at the end but I don't need to do any math to figure out how to adjust the function.
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
May 21, 2015, 10:15 p.m. EDT
Thanks for the reply Daniel. Actually I want to define a variable in my variables(local) that will take the range of values but in my variables we can not use the range function so what other function we have in comsol to define a variable that takes a range of values and can be defined in my variables.
I am working on the fault diagnosis of the grounding grid. For the diagnosis I am using electromagnetic Induction Method. As I inject the current, the magnetic flux density that is produced is to be measured. Now I want to put the formula for magnetic flux density B that is through Biot Savat law.
The case I am working on is a conductor of length 1m lying at 45 degrees with the x-axis. When current I flows in the conductor the magnetic flux density produced at point (x0,y0,z0) will be...
B=uI/(4pi)*[cos(45)*integrate((y0-a)/r^3,a,0,cos(45))-sin(45)*integrate((x0-a)/r^3,a,0,sin(45))].
where r is the position vector from the differential element on the conductor to the point of measurement(x0,y0,z0). r=sqrt((xo-a)^2+(y0-a)^2+(z0-0)^). where (a,a,0) is the position of differential elements.
where a ranges from 0 to 0.707. Now I want to define this 'a' in my variables(local) because it takes range of values. How can we define? I defined the 'B' in my variables as well.
Thanks for the reply Daniel. Actually I want to define a variable in my variables(local) that will take the range of values but in my variables we can not use the range function so what other function we have in comsol to define a variable that takes a range of values and can be defined in my variables.
I am working on the fault diagnosis of the grounding grid. For the diagnosis I am using electromagnetic Induction Method. As I inject the current, the magnetic flux density that is produced is to be measured. Now I want to put the formula for magnetic flux density B that is through Biot Savat law.
The case I am working on is a conductor of length 1m lying at 45 degrees with the x-axis. When current I flows in the conductor the magnetic flux density produced at point (x0,y0,z0) will be...
B=uI/(4pi)*[cos(45)*integrate((y0-a)/r^3,a,0,cos(45))-sin(45)*integrate((x0-a)/r^3,a,0,sin(45))].
where r is the position vector from the differential element on the conductor to the point of measurement(x0,y0,z0). r=sqrt((xo-a)^2+(y0-a)^2+(z0-0)^). where (a,a,0) is the position of differential elements.
where a ranges from 0 to 0.707. Now I want to define this 'a' in my variables(local) because it takes range of values. How can we define? I defined the 'B' in my variables as well.
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
May 22, 2015, 9:22 p.m. EDT
???????????
???????????