Modified Nodal Analysis

Modified Nodal Analysis - Messages

#1 Posted: 2/18/2019 1:13:53 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: 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 KiB) downloaded 221 time(s).

Best regards.
Alvaro.
4 users liked this post
Arie 2/18/2019 3:36:00 PM, Вячеслав Мезенцев 2/19/2019 3:28:00 AM, Davide Carpi 2/19/2019 4:44:00 PM, frapuano 2/18/2019 2:07:00 PM
#2 Posted: 2/19/2019 2:08:39 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

opamps.gif
1 users liked this post
frapuano 2/19/2019 5:25:00 AM
#3 Posted: 2/19/2019 3:48:51 PM
Arie

Arie

93 likes in 285 posts.

Group: 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 users liked this post
Alvaro Diaz Falconi 2/28/2019 6:10:00 AM
#4 Posted: 2/19/2019 7:16:17 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: 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 KiB) downloaded 221 time(s).

Best regards.
Alvaro.



Nice work! and thanks for the use of one of my very old posts!!
1 users liked this post
Alvaro Diaz Falconi 2/19/2019 8:44:00 PM
#5 Posted: 2/19/2019 8:59:27 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: 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 Posted: 2/20/2019 9:10:36 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: 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 KiB) downloaded 113 time(s).

opamp integrator.pdf (464 KiB) downloaded 112 time(s).

Best regards.
Alvaro.
1 users liked this post
NDTM Amarasekera 2/21/2019 10:47:00 PM
#7 Posted: 2/23/2019 6:15:39 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: 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 KiB) downloaded 122 time(s).
mna_RLC_freq_domain.sm (187 KiB) downloaded 103 time(s).

Best regards.
Alvaro.



1 users liked this post
frapuano 2/23/2019 8:16:00 AM
#8 Posted: 2/27/2019 12:13:38 AM
Norm Schutzkus

Norm Schutzkus

9 likes in 90 posts.

Group: 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 KiB) downloaded 116 time(s).
#9 Posted: 2/27/2019 6:20:53 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

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

RLC Norma.sm (194 KiB) downloaded 103 time(s).
RLC Norma.pdf (175 KiB) downloaded 121 time(s).

Best regards.
Alvaro.
#10 Posted: 2/27/2019 10:32:03 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 2/27/2019 12:58:20 PM
Norm Schutzkus

Norm Schutzkus

9 likes in 90 posts.

Group: User

Many thanks Alvaro!

The "Thanks" icon presented an error.

Norm
#12 Posted: 2/27/2019 1:07:04 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

The "Thanks" icon presented an error.


This is a long lasting/reported bug.
#13 Posted: 2/27/2019 6:43:59 PM
Norm Schutzkus

Norm Schutzkus

9 likes in 90 posts.

Group: 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 Posted: 2/27/2019 8:55:16 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 109 time(s).
#15 Posted: 3/24/2021 11:51:47 PM
Norm Schutzkus

Norm Schutzkus

9 likes in 90 posts.

Group: 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 KiB) downloaded 70 time(s).

The error:
Error.pdf (8 KiB) downloaded 68 time(s).

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

Stay safe and take care.

Sincerely,

Norm
#16 Posted: 3/25/2021 2:29:29 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: 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 KiB) downloaded 90 time(s).
RLC Norma.sm (194 KiB) downloaded 97 time(s).

Finally, in the meantime I improve the Peaks function

MPeaks.sm (16 KiB) downloaded 84 time(s).

Best regards.
Alvaro.
#17 Posted: 3/25/2021 9:47:10 AM
Norm Schutzkus

Norm Schutzkus

9 likes in 90 posts.

Group: User

Many thanks, for your prompt reply and fixes!

Sincerely,

Norm
#18 Posted: 1/10/2022 9:37:52 AM
babElec

babElec

1 likes in 5 posts.

Group: User

Really good job! I have to try it !!
1 users liked this post
Alvaro Diaz Falconi 1/10/2022 1:24:00 PM
  • New Posts New Posts
  • No New Posts No New Posts