Modified Nodal Analysis

Modified Nodal Analysis - Messaggi

#1 Pubblicato: 18/02/2019 13:13:53
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

This a solver for electrical circuits with the MNA method, here implemented as "stamps" for each linear circuit element. That's meaning that it's modular: can be extended adding more circuit elements stamps. To do: add nullors, diodes, transistors and describe how to handle subciruits.

mna_stamps.sm (405,83 KiB) scaricato 1693 volta(e).

Best regards.
Alvaro.
4 utenti hanno apprezzato questo post
Arie 18/02/2019 15:36:00, Вячеслав Мезенцев 19/02/2019 03:28:00, Davide Carpi 19/02/2019 16:44:00, frapuano 18/02/2019 14:07:00
#2 Pubblicato: 19/02/2019 02:08:39
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

opamps.gif
1 utenti hanno apprezzato questo post
frapuano 19/02/2019 05:25:00
#3 Pubblicato: 19/02/2019 15:48:51
Arie

Arie

94 apprezzamenti in 285 post.

Gruppo: User

Alvaro,

Awesome work! I'm excited to start using this. I see a lot of potential uses. I did have a question regarding your algorithm. In the attached segment, what is the purpose of repeating the for-loop inside the if/else condition on the right? I get the purpose of the for-loop to select the correct Stamp prefix, but do not see the benefit of added if/else on right side.
Untitled.png

Thanks,
alyles
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
1 utenti hanno apprezzato questo post
Alvaro 28/02/2019 06:10:00
#4 Pubblicato: 19/02/2019 19:16:17
Oscar Campo

Oscar Campo

135 apprezzamenti in 309 post.

Gruppo: Moderator

Wrote

This a solver for electrical circuits with the MNA method, here implemented as "stamps" for each linear circuit element. That's meaning that it's modular: can be extended adding more circuit elements stamps. To do: add nullors, diodes, transistors and describe how to handle subciruits.

mna_stamps.sm (405,83 KiB) scaricato 1693 volta(e).

Best regards.
Alvaro.



Nice work! and thanks for the use of one of my very old posts!!
1 utenti hanno apprezzato questo post
Alvaro 19/02/2019 20:44:00
#5 Pubblicato: 19/02/2019 20:59:27
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Wrote

Alvaro,

Awesome work! I'm excited to start using this. I see a lot of potential uses. I did have a question regarding your algorithm. In the attached segment, what is the purpose of repeating the for-loop inside the if/else condition on the right? I get the purpose of the for-loop to select the correct Stamp prefix, but do not see the benefit of added if/else on right side.

Thanks,
alyles



Hi alyles. Thanks for your words. As you say, the first loop it's for choose the correct Stamp with the first circuit element letter. The if ensure that if the string is largest than one, then can take a substring largest, but there are a bug there: must to be substr(str#, 1, 2), for make avaible the use of two letters too as stamp identifier.

Best regards.
Alvaro.
#6 Pubblicato: 20/02/2019 21:10:36
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi. In the attached, bug about selecting stamps pointing by alyles not "corrected" but just eliminate the second loop. Also shows how to work with a pulse train, choosing a true periodic laplace transform from the input signal, not only the transform that figures on the books.

opamp integrator.sm (316,26 KiB) scaricato 1631 volta(e).

opamp integrator.pdf (464,25 KiB) scaricato 1071 volta(e).

Best regards.
Alvaro.
1 utenti hanno apprezzato questo post
NDTM Amarasekera 21/02/2019 22:47:00
#7 Pubblicato: 23/02/2019 06:15:39
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi. In the attached, bug for selecting stamps corrected. Also frequency domain analysis tools for use with MNA analysis: BodeMag, BodePhase, ZP Plot, Nyquist and Nichols charts.

mna_RLC_freq_domain.pdf (308,9 KiB) scaricato 950 volta(e).
mna_RLC_freq_domain.sm (187,22 KiB) scaricato 1648 volta(e).

Best regards.
Alvaro.



1 utenti hanno apprezzato questo post
frapuano 23/02/2019 08:16:00
#8 Pubblicato: 27/02/2019 00:13:38
Norm Schutzkus

Norm Schutzkus

9 apprezzamenti in 90 post.

Gruppo: User

Hello Alvaro, nice work!

I was planning to convert the attached (copy of) MathCad worksheet, but it seemed difficult for me. Would some of the routines, or stamps work in place of the solve block?

I welcome your review and look forward to your reply.

Sincerely,

NormRLC step response - MC.pdf (695,17 KiB) scaricato 1018 volta(e).
#9 Pubblicato: 27/02/2019 06:20:53
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi Norm. Thanks. This is what think that you can do with the MNA method.

RLC Norma.sm (194,82 KiB) scaricato 1520 volta(e).
RLC Norma.pdf (175,12 KiB) scaricato 973 volta(e).

Best regards.
Alvaro.
#10 Pubblicato: 27/02/2019 10:32:03
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Wrote

I was planning to convert the attached (copy of) MathCad worksheet, but it seemed difficult for me.


If you can setup in form of DE [Differential Equation]
It will surely have a Laplace solution easy to extract.

#11 Pubblicato: 27/02/2019 12:58:20
Norm Schutzkus

Norm Schutzkus

9 apprezzamenti in 90 post.

Gruppo: User

Many thanks Alvaro!

The "Thanks" icon presented an error.

Norm
#12 Pubblicato: 27/02/2019 13:07:04
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Wrote

The "Thanks" icon presented an error.


This is a long lasting/reported bug.
#13 Pubblicato: 27/02/2019 18:43:59
Norm Schutzkus

Norm Schutzkus

9 apprezzamenti in 90 post.

Gruppo: User

If you can setup in form of DE [Differential Equation]
It will surely have a Laplace solution easy to extract.

Thanks Jean, I'll try that as well... if I do it correctly.

Norm
#14 Pubblicato: 27/02/2019 20:55:16
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

Wrote

Ifyou can setup in form of DE [Differential Equation]
It will surely have a Laplace solution easy to extract.

Thanks Jean, I'll try that as well... if I do it correctly.


The technical approach is simply write the Laplace algebra
of the circuit ... maple, bingo/done.
Literature call it H(s) ... I call it L(s).
You can find some examples browsing the web.
Those operational [symbol triangle] supplier
should give the L(s). Here is an old example.

Jean

Maths Laplace Circuit Algebra.sm (38,29 KiB) scaricato 1545 volta(e).
#15 Pubblicato: 24/03/2021 23:51:47
Norm Schutzkus

Norm Schutzkus

9 apprezzamenti in 90 post.

Gruppo: User

Hello Alvaro, I hope you are well in this challenging time.

The MNA worksheet throws an error when I updated to version 0.99(build: 7610). It worked fine before then.

Here's the sheet:

RLC Norma.sm (194,94 KiB) scaricato 1556 volta(e).

The error:
Error.pdf (8,16 KiB) scaricato 851 volta(e).

I welcome your review and recommendation(s) to repair the issue.

Stay safe and take care.

Sincerely,

Norm
#16 Pubblicato: 25/03/2021 02:29:29
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi Norm. Thanks for the good wishes. I hope you are well too. First issue is that new versions can't get the number of rows in the stamps matrix. So, change rows(E#) by it's value, 12.

Clipboard01.jpg

That make almost all other calculus ok. But there are also a bug in SMath when when you invert matrices with units. For some reason, you must to change A#^-1 by maple(invert(A#)) for calculate the voltage in the first calculus with units (in this case for the current SMath can invert the matrix)

Clipboard02.jpg

Now there are only one last red in a plot, but can't remember why is it.

RLC Norma.pdf (146,53 KiB) scaricato 966 volta(e).
RLC Norma.sm (194,95 KiB) scaricato 1583 volta(e).

Finally, in the meantime I improve the Peaks function

MPeaks.sm (16,49 KiB) scaricato 1545 volta(e).

Best regards.
Alvaro.
#17 Pubblicato: 25/03/2021 09:47:10
Norm Schutzkus

Norm Schutzkus

9 apprezzamenti in 90 post.

Gruppo: User

Many thanks, for your prompt reply and fixes!

Sincerely,

Norm
#18 Pubblicato: 10/01/2022 09:37:52
babElec

babElec

1 apprezzamenti in 5 post.

Gruppo: User

Really good job! I have to try it !!
1 utenti hanno apprezzato questo post
Alvaro 10/01/2022 13:24:00
  • Nuovi post
  • Nessun nuovo post