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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Capacitor model unit issue

Bogdan_d
8-Gravel

Capacitor model unit issue

Hi,

I am trying to model a capacitor based of the input values for L and R and plot the results.

If I plotting unit-less then the calculation is OK, others I get wired values for Xc and Xl.

Can somebody can point me where is the problem?

ACCEPTED SOLUTION

Accepted Solutions
ttokoro
20-Turquoise
(To:Bogdan_d)

14 REPLIES 14
Cornel
19-Tanzanite
(To:Bogdan_d)

Are you looking at this?

Cornel_0-1710518458592.png

 

Werner_E
25-Diamond I
(To:Bogdan_d)


@Bogdan_d wrote:

Hi,

I am trying to model a capacitor based of the input values for L and R and plot the results.

If I plotting unit-less then the calculation is OK, others I get wired values for Xc and Xl.

Can somebody can point me where is the problem?


Yes 🙂

You assign the unit MHz TWICE! So "freq" ends up with unit Hz^2 or 1/s^2

You have two options to assign the unit just once, either in the "logspace" function or as a factor after it, but not both!

Werner_E_0-1710519685132.png

 

ttokoro
20-Turquoise
(To:Bogdan_d)

image.pngimage.pngimage.pngimage.pngimage.png

Hi,

Thank you to all for your quick answer.

I am still not able to plot the values. It is drive me crazy. For such a simple thing, I still cannot find error.

ttokoro
20-Turquoise
(To:Bogdan_d)

Attach it.

Hi,

I understood your answer, now I am struggle with unitless values in the plot representation.

It is curious that  after I downloaded your file and open as it is is working, if I delete and try to apply the same what you did I start to have again issues.

For sure I am doing something wrong and cannot catch the point. I have look on the post here with unitless problem, but still I cannot fix it.  I do miss something here.

ttokoro
20-Turquoise
(To:ttokoro)

Add with vectorisation.

Hello,

I am coming back with this topic. I have some time to play with some real values for the capacitor.

Unfortunately it seems that by plotting the value using logarithm axes on the plot the frequency is shifted by x10 times.

As it can be seen in the supplier of the capacitor the value from his chart is matching the values calculated using the same formulas as used in MathCAD, but in excel and there are matching.

image.png

supplier data.png

 

Here on the MathCAD are multiplied by almost 10. Please advice here.

Either is an issue of the plotting, or using logspace and then changing the axes to log the result is log x log or...

Thank you.

 

Werner_E
25-Diamond I
(To:Bogdan_d)


@Bogdan_d wrote:

Hello,

I am coming back with this topic. I have some time to play with some real values for the capacitor.

Unfortunately it seems that by plotting the value using logarithm axes on the plot the frequency is shifted by x10 times.

No, its  not 10 times, its 2*pi = 6.28 times 🙂

The suppliers plot shows freuency (freq) at the absicissa, but your plot shows circular freqency (omega).

Werner_E_0-1728476105638.png

 

Prime 10 sheet attached

 

BTW, an additional question after that long time dealing with a different problem sure would have deserved opening a new thread for it.  Doing so also has the benefit of possibly getting more attention as opposed to an older already closed thread.

 

EDIT: Added log-grid

Werner_E_1-1728477381612.png

 

Many thanks for pointing this, it works 🙂

LucMeekes
23-Emerald III
(To:Bogdan_d)

You are plotting, but the |Xc(w)| takes the norm of the vector, which is a single value. You can see the point at w=0, |Xc(w)|=0.5

If you want the result to be a vector, you have to vectorise the expression, so make it:

LucMeekes_0-1710787623961.png

Then you get:

LucMeekes_1-1710787675943.png

And on a log/log plot you get the (probably) expected:

LucMeekes_2-1710787783591.png

 

Success!
Luc

Hi,

Yes, for a matrix with vectors you have to vectorize the multiplication of them to have them one by one multiplied.

LucMeekes
23-Emerald III
(To:Bogdan_d)

This has little to do with 'multiplication', it's rather about an operation, namely |x|, that takes the absolute value if x is a scalar, but it takes the norm when x is a vector. If you want instead that the absolute value of each of the vector elements is taken, you have to apply vectorisation.

LucMeekes_0-1710801036004.png

You can also do what ttokoro did, and that is index your vectors. Note that he plotted |Xc(w.i)| versus w.i, in which case the argument to the absolute value is again a scalar, and no vectorisation is needed. But this requires that you define the index i.

LucMeekes_0-1710802151580.png

 

Success!
Luc

 

Hi,

Thank you to all for your help.

The issue was that in the end I didn't catch under the vector also the modulo.

Announcements

Top Tags