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

These units are not compatible

AP_10156885
3-Visitor

These units are not compatible

Hello, I am trying to use this w(k) in my transfer function, but it doesn't work.

I can use w(k) separately.

Do you have any idea how can I do this?
AP_10156885_0-1640186977631.png


 

1 ACCEPTED SOLUTION

Accepted Solutions

As Werner says, that evaluation operator at the end of your function definition is the main culprit here.

 

2021 12 23 a.png

 

Removing it cures the problem, and your function should work as you intend, provided fph has unit Hz (as both Werner and Terry said).

 

2021 12 23 b.png 

 

And just as an aside, because many new users find using range variables slightly confusing on occasion,

 

2021 12 23 c.png

 

Note the -400 in the first definition; this is to ensure that hk's effective indices start at 0 (add ORIGIN to k-400 if you use a different ORIGIN).   

 

Also, note the vectorized operator in the second definition; this is to ensure there are no unintended side effects from passing a vector to HPWRH. Many a head is scratched trying to work out why multiplying vectors v & w returns a scalar instead of an element-by-element product (especially when v^2 does return the square of each element of v).

 

Stuart

View solution in original post

5 REPLIES 5

Hi,

There is a mismatched unit problem.

Can you upload the worksheet so the units or absence of units on constants can be checked.

For example units of fsw, fPH, etc

Cheers

Terry

Hi,

The problem is subtle.  The units of the multiplier of "j" must be unitless.

The units of 2*pi in definition of w(k) is in rad (meaning radians) for w of rad/sec.

The units in the denominator of multiplier of j should for the 2*pi as rad and fPH as Hz for rad/sec to cancel out units of w(k)

 

Capture.JPG

 

Cheers

Terry

I am not quite sure what you mean. There is no need to explicitly assign pseudo unit "rad" to any variable. This "unit" is defined as being 1 and has no effect when balancing the units.

As long as f.PH is a quantity with dimension time^-1 (probably Hz or s^-1) all should be OK.
I guess that AP_10156885  already had defined f.PH with a correct unit and am pretty sure that the problem is just the equal sign after the function definition.

The problem is the inline evaluation of your function H...(k).

Delete the equal sign at the end and type H...(k)= in a separate region if you really want to see a list of the 701 values.

 

I assume that you assigned f.PH a correct unit (dimension time^-1) like 1/s or Hz.

As Werner says, that evaluation operator at the end of your function definition is the main culprit here.

 

2021 12 23 a.png

 

Removing it cures the problem, and your function should work as you intend, provided fph has unit Hz (as both Werner and Terry said).

 

2021 12 23 b.png 

 

And just as an aside, because many new users find using range variables slightly confusing on occasion,

 

2021 12 23 c.png

 

Note the -400 in the first definition; this is to ensure that hk's effective indices start at 0 (add ORIGIN to k-400 if you use a different ORIGIN).   

 

Also, note the vectorized operator in the second definition; this is to ensure there are no unintended side effects from passing a vector to HPWRH. Many a head is scratched trying to work out why multiplying vectors v & w returns a scalar instead of an element-by-element product (especially when v^2 does return the square of each element of v).

 

Stuart

Announcements