Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Razonar  
#1 Posted : 18 February 2019 19:13:53(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
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 (406kb) downloaded 159 time(s).

Best regards.
Alvaro.
thanks 4 users thanked Razonar for this useful post.
on 18/02/2019(UTC),  on 18/02/2019(UTC),  on 19/02/2019(UTC),  on 19/02/2019(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Razonar  
#2 Posted : 19 February 2019 08:08:39(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
opamps.gif
thanks 1 user thanked Razonar for this useful post.
on 19/02/2019(UTC)
Offline alyles  
#3 Posted : 19 February 2019 21:48:51(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 275
United States

Was thanked: 91 time(s) in 57 post(s)
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
thanks 1 user thanked alyles for this useful post.
on 28/02/2019(UTC)
Offline oscampo  
#4 Posted : 20 February 2019 01:16:17(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: Razonar Go to Quoted Post
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 (406kb) downloaded 159 time(s).

Best regards.
Alvaro.


Nice work! and thanks for the use of one of my very old posts!!Clap
thanks 1 user thanked oscampo for this useful post.
on 20/02/2019(UTC)
Offline Razonar  
#5 Posted : 20 February 2019 02:59:27(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: alyles Go to Quoted Post
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.
Offline Razonar  
#6 Posted : 21 February 2019 03:10:36(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
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 (317kb) downloaded 56 time(s).

opamp integrator.pdf (465kb) downloaded 54 time(s).

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 22/02/2019(UTC)
Offline Razonar  
#7 Posted : 23 February 2019 12:15:39(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
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 (309kb) downloaded 62 time(s).
mna_RLC_freq_domain.sm (188kb) downloaded 51 time(s).

Best regards.
Alvaro.


thanks 1 user thanked Razonar for this useful post.
on 23/02/2019(UTC)
Offline - Norm -  
#8 Posted : 27 February 2019 06:13:38(UTC)
- Norm -


Rank: Advanced Member

Groups: Registered
Joined: 29/11/2017(UTC)
Posts: 82
United States
Location: Midwest

Was thanked: 9 time(s) in 7 post(s)
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,

Norm RLC step response - MC.pdf (696kb) downloaded 59 time(s).
Offline Razonar  
#9 Posted : 27 February 2019 12:20:53(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi Norm. Thanks. This is what think that you can do with the MNA method.

RLC Norma.sm (195kb) downloaded 52 time(s).
RLC Norma.pdf (176kb) downloaded 54 time(s).

Best regards.
Alvaro.
Offline Jean Giraud  
#10 Posted : 27 February 2019 16:32:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: nasch Go to Quoted Post
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.

Offline - Norm -  
#11 Posted : 27 February 2019 18:58:20(UTC)
- Norm -


Rank: Advanced Member

Groups: Registered
Joined: 29/11/2017(UTC)
Posts: 82
United States
Location: Midwest

Was thanked: 9 time(s) in 7 post(s)
Many thanks Alvaro!

The "Thanks" icon presented an error.

Norm
Offline Jean Giraud  
#12 Posted : 27 February 2019 19:07:04(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: nasch Go to Quoted Post
The "Thanks" icon presented an error.

This is a long lasting/reported bug.
Offline - Norm -  
#13 Posted : 28 February 2019 00:43:59(UTC)
- Norm -


Rank: Advanced Member

Groups: Registered
Joined: 29/11/2017(UTC)
Posts: 82
United States
Location: Midwest

Was thanked: 9 time(s) in 7 post(s)
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
Offline Jean Giraud  
#14 Posted : 28 February 2019 02:55:16(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: nasch Go to Quoted Post
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 (39kb) downloaded 53 time(s).
Offline - Norm -  
#15 Posted : 25 March 2021 05:51:47(UTC)
- Norm -


Rank: Advanced Member

Groups: Registered
Joined: 29/11/2017(UTC)
Posts: 82
United States
Location: Midwest

Was thanked: 9 time(s) in 7 post(s)
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 (195kb) downloaded 19 time(s).

The error:
Error.pdf (9kb) downloaded 11 time(s).

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

Stay safe and take care.

Sincerely,

Norm
Offline Razonar  
#16 Posted : 25 March 2021 08:29:29(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
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 (147kb) downloaded 27 time(s).
RLC Norma.sm (195kb) downloaded 40 time(s).

Finally, in the meantime I improve the Peaks function

MPeaks.sm (17kb) downloaded 32 time(s).

Best regards.
Alvaro.
Offline - Norm -  
#17 Posted : 25 March 2021 15:47:10(UTC)
- Norm -


Rank: Advanced Member

Groups: Registered
Joined: 29/11/2017(UTC)
Posts: 82
United States
Location: Midwest

Was thanked: 9 time(s) in 7 post(s)
Many thanks, for your prompt reply and fixes!

Sincerely,

Norm
Offline babElec  
#18 Posted : 10 January 2022 15:37:52(UTC)
babElec

Rank: Newbie

Groups: Registered
Joined: 06/01/2022(UTC)
Posts: 5
France
Location: grenoble

Was thanked: 1 time(s) in 1 post(s)
Really good job! I have to try it !! Kiss
thanks 1 user thanked babElec for this useful post.
on 10/01/2022(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.