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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

cannot express the function in symbolic

mark_neil2
1-Newbie

cannot express the function in symbolic

Hi,
In the attached file, I calculate the Fourier series of a function but want to express the calculated series in symbolic mode therefore I can apply symbolic keywords to it (like inverse laplace, etc.). I use MC14. I have also attached it in pdf for those who has earlier version of Mathcad. Thanks.

Mark.
26 REPLIES 26

On 9/2/2009 6:29:06 PM, jmG wrote:
>The expanded form, I can't see
>any use as not resulting from
>a root of polynomial. Whatever
>it should expand the iterated
>form but I will not do it if
>users < 14 don't deserve the
>work sheet and only a *PDF.

ok, I have saved it in MC11 and attached here. However, making it work MC11 won't help me since I use MC14.

>Make sure you always state all
>conditions completely, you
>didn't. You are using units,
>check about 14 symbolic. Do
>you have to define pi in 14 ?

I have deleted pi in the definition section...It was a copy/paste from some other file and it was left over in this file...

>Red highlight is not
>comfortable to read ! Why did
>you remove the error message ?
>

I have changed the color to green for the confort of your eyes 🙂

>Inverse Laplace of that ? Oh !
>That stuff is not in the
>Laplace domain.
>What do you expect plugging in
>InverseLaplace ?
>Another error message, or a
>Mathcad crash ?
>
>jmG

I meant to say laplace but typed inverse laplace by mistake. It is my bad... I want to see the expression in the form like,

vfourier(t)=0.7*sin(t)+0.2*sin(2t)+...

Mark.


Symbolics don't work with functions defined piecewise using the if construct. You have to use the Φ function as the basis for such functions.

Fourier series for various simple functions (including square waves) have been done previously in the collaboratory. You might want to search the Collaboratory for Fourier series.
__________________
� � � � Tom Gutman

On 9/3/2009 2:37:09 AM, Tom_Gutman wrote:
>Symbolics don't work with
>functions defined piecewise
>using the if construct. You
>have to use the � function
>as the basis for such
>functions.
>

As far as I see, the problem I am having is that the symbolic assign has been removed as a feature on MC14 (and some versions back) therefore I cannot assign a numeric function to make it a symbolic function. I tried to use A and B in my file to construct the function back in symbolic mode but it also didn't work because of this reason.

>Fourier series for various
>simple functions (including
>square waves) have been done
>previously in the
>collaboratory. You might want
>to search the Collaboratory
>for Fourier series.
>__________________
>� � � � Tom Gutman

The square function was just an example I happened to have in my file.

I thank those who have replied to my question.

Mark.


On 9/3/2009 6:43:09 PM, jmG wrote:
>On 9/3/2009 4:02:32 PM, mark_neil wrote:
>...
>>As far as I see, the problem I am having
>>is that the symbolic assign has been
>>removed as a feature on MC14 (and some
>>versions back)
>==> No collab takes that unless you
>confirm the sheet I created in 11.2a
>(especially for you) does not work. If
>my work sheet fails, return an image
>where it fails and the error message in
>order that those who have made the 11.2a
>construct work equivalently in 14.
>
>>therefore I cannot assign a numeric function to >make it a symbolic function.
>==> p(x) is a scalar function and if the
>Mathcad 14 does not take it, either
>limited or unlimited, I don't believe,
>simply !
>
>>I tried to use A and B in my file to construct >the function back in symbolic mode but it also >didn't work because of this reason.
>==> nothing else to do than running my
>sheet.
>
>>>Fourier series for various
>>>simple functions (including
>>>square waves) have been done
>>>previously in the
>>>collaboratory. You might want
>>>to search the Collaboratory
>>>for Fourier series.
>>>__________________
>>>� � � � Tom Gutman
>>
>>The square function was just an example
>>I happened to have in my file.
>==> the only good point that might need
>+ tutoring. If the Fourier polynomial
>does not extract for any kind of
>function, which I doubt, you would then
>have to reconstruct a function from the
>cfft/CFFT. So much was posted and so
>regularly, that you would have to come
>with a project for purpose with a good
>abstract so collabs can take the plunge
>instead of chewing the stuff all over
>again. That's because there are ready
>made tools in circulation.
>
>>Mark.
>
>==> jmG

Rather than asking about some details, I decided to post the problem here in case some people might have easier/more practical approach in solving this.
I am analyzing the circuit in the attached file. "Isource" is a periodic current source and I have shown its waveshape in the attached file. I want to solve for the currents I1, I2, I3, I4.
I was trying to solve for the currents by writing the Y matrix of the circuit, finding Fourier series of the Isource, solving for the currents in s-domain for each component of the series and taking inverse laplace to find the currents in time domain.
I have posted the file in MC11 for more people to see although I use MC14.
In case someone wants to spend time on this for a solution in MC14...

Mark.

On 9/4/2009 1:35:45 AM, jmG wrote:
>Your circuit does not make
>sense. Z1, Z2, Z3, Z4 in
>parallel make up for 'Z'
>equivalent from handbook. Then
>complement adding Zin for the
>equivalent complex Z.

Yes, Z1 to Z4 can be simplified as parallel combination; agree with you. However, I have 4 different current branches and I am interested in calculating rms value of current of each branch. That is why I have Z1 to Z4.

>What you
>call Isource viewed from the
>RHS, but the circuit show
>nowhere to feed from this
>source ... then Isource as you
>draw is Iload.

You are right; taking Vdc as input voltage source, Isource is the load in my circuit. However, if I were to draw this circuit in a circuit simulator, I would chose a current source from the parts library to define "Isource" in my schematic. That is why I used the name source. However, it is a load, too. No big deal...

>Read more and
>you define Vdc, then Z could
>be interpreted as "resistive"
>only from the first look, but
>it can be transient and more
>generally complex depending
>upon the load. The load may
>and will surely reflex true
>complex in the system. These
>are circuit details.
>
>Your calculations for Z1...4
>don't understand. They are in
>parallel including the
>internal reistance of what you
>call Isource. And be cautious
>if they are complex. You have
>to look more carefully how to
>setup the circuit for the
>maths. Your discontinuous
>function is incompletely
>defined ... read some of the
>work sheets I posted. So,
>there is nothing to solve yet,
>only "calculate" !

Solving or calculation, I don't mind. Either one is ok. Numeric solution is fine...

>You have switched horse so
>drastically from your original
>sheet that this one is
>completely new, out of the
>blue.

I attemted to solve it by Y-Matrix approach and I was asking about details of this approach. Then I posted the circuit itself in case someone suggests that there is an easier way to tackle this circuit in MC14 rather than Y-matrix approach.

>Calculate the Fourier
>p(x) as I did and please don't
>persist saying it does not
>work in Mathcad 14 if you want
>to go your own wrong way
>instead of as guided. If you
>can't put units correctly,
>don't put any that makes no
>sense. m is "metre" and that's
>it. What is 'm' doing for
>calculating impedance 'Z', Oh
>! you could argue on that.

I never used or intented to use units in Mathcad. However, my circuit component values are mostly miliohms, micro or nano or pico farads and micro henries. It makes it easier to define "m", "n", and "p" as multipliers and that go with the component values instead of typing 10^(-3) for mili, for example.

>
>If you think Laplace will
>solve something in there, it
>might if you construct the
>equivalent circuit in the
>Laplace domain. You might have
>seen that from books, then
>show the book page circuit to
>limit the search. 's' in your
>work sheet is 1*s (time in
>seconds). Your 's' is any wild
>argument. The Laplace 's'
>results from transforming the
>independent domain (t, x,,,)
>of a function into the Laplace
>domain 's'. What I mean here
>is that if the equivalent
>circuit is constructed in the
>Laplace domain then it is the
>XFR function [XFR = transfer].
>Here, you don't have a closed
>circuit, rather a dividing
>circuit that goes resistive
>and/or an hybrid system of
>resistive and complex
>components, that does not
>involve Laplace. It could be
>that what you call "Isource"
>is by itself a 2nd order
>system, but the representation
>is totally incorrect and
>incomplete. There are curious
>numbers, but here out of 4
>numbers you have two most
>curious ones 5454545454545454
>.... 303030303030303 !!! For
>God sake, I think it's joke.
>
>jmG
>
>Maybe something you don't
>tell.

No it is not a joke :-). The cap values in my fle are standard values. However, 1/C becomes a weird number. That is how I got them.

I plan to post this circuit in "Electrical Engineering" section since more electrical engineers may see my file in this section and possibly tackle my problem.

Mark.

LouP
11-Garnet
(To:mark_neil2)

>I was trying to solve for the currents by
>writing the Y matrix of the circuit, finding
>Fourier series of the Isource, solving for the
>currents in s-domain for each component of the
> series and taking inverse laplace to find the
>currents in time domain.

This was my approach, using a numeric solution and DFT's , not Laplace transforms. I don't see any merit in trying a symbolic solution for anything other than textbook/tutorial examples with 1 or 2 poles. For any network of this complexity, symbolics are unlikely to work, and even so, would be unlikely to provide more insight than could be obtained with variations of the numeric solution.

Lou

On 9/4/2009 3:50:05 PM, lpoulo wrote:
>>I was trying to solve for the currents by
>>writing the Y matrix of the circuit, finding
>>Fourier series of the Isource, solving for the
>>currents in s-domain for each component of the
>> series and taking inverse laplace to find the
>>currents in time domain.
>
>This was my approach, using a
>numeric solution and DFT's ,
>not Laplace transforms. I
>don't see any merit in trying
>a symbolic solution for
>anything other than
>textbook/tutorial examples
>with 1 or 2 poles. For any
>network of this complexity,
>symbolics are unlikely to
>work, and even so, would be
>unlikely to provide more
>insight than could be obtained
>with variations of the numeric
>solution.
>
>Lou

Lou,
Actually, I got very close to the solution with Laplace transformation but I felt it was little bit too complex for Mathcad to handle it and may not work properly on some examples with different shapes of Isource. That is why I posted the question.
I compared your solution in the Mathcad file with that of circuit simulator and they are impressively close! I have changed some circuit parameters and compared again and everytime Mathcad generates the right result w.r.t. to the simulator output. Also, it is impressively fast. Thank you very much for spending time on this.
I almost haven't used matrix or vector calculations or DFT with Mathcad. I need to calculate the rms values of these currents and I don't know the right syntax for this. Would you mind adding rms calculations of the currents to the file you have posted?
Thanks again.

Mark.
PhilipOakley
5-Regular Member
(To:mark_neil2)

Is the simulator actually accurate 😉

It has to use numerical methods just the same..

Philip Oakley

On 9/5/2009 7:36:43 AM, philipoakley wrote:
>Is the simulator actually
>accurate 😉
>
>It has to use numerical
>methods just the same..
>
>Philip Oakley

Philip,
What makes you say that the circuit simulator may not be accurate? There may be occasional problems with certain models of circuits with some simulators but it is my experience that many circuit simulators generate the same/identical simulated waveforms with the same circuit models that I have worked on so far.

The simulator I use (PSIM) generates results of transient plus steady state whereas the DFT method that Lou used in his MC spreadsheet displays the result only for steady state. I doubt that the circuit simulator I used uses the same method as in Lou's file (DFT).

Mark.
PhilipOakley
5-Regular Member
(To:mark_neil2)

On 9/5/2009 3:15:19 PM, mark_neil wrote:
>On 9/5/2009 7:36:43 AM, philipoakley
>wrote:
>>Is the simulator actually
>>accurate 😉
>>
>>It has to use numerical
>>methods just the same..
>>
>>Philip Oakley
>
>Philip,
>What makes you say that the circuit
>simulator may not be accurate? There may
>be occasional problems with certain
>models of circuits with some simulators
>but it is my experience that many
>circuit simulators generate the
>same/identical simulated waveforms with
>the same circuit models that I have
>worked on so far.
>
>The simulator I use (PSIM) generates
>results of transient plus steady state
>whereas the DFT method that Lou used in
>his MC spreadsheet displays the result
>only for steady state. I doubt that the
>circuit simulator I used uses the same
>method as in Lou's file (DFT).
>
>Mark.

Mark,

It was more that both are numerical solvers, each
with their own foibles. Sometimes the foibles
point out a learning point, and other times they
indicate an (internal) error. No programme is
without its assumptions. MathCAD often makes picky
maths assumptions, while simulators will
(generally) tend toward assumptions of a finite
reality.

The exponential growth problems Tom mentions
should not be ignored. Each solver has its limits. Analytic solutions are the most troublesome
because we think they can be solved
numerically, when in many cases they don't solve
properly. It is a type of hindsight bias.

Making reasonable assumptions about FET drives is
always an issue (ideal edges?) [I'm doing an EMC
problem on that at the moment]

Philip Oakley

On 9/5/2009 10:22:55 AM, jmG wrote:
>On 9/5/2009 7:36:43 AM, philipoakley
>wrote:
>>Is the simulator actually accurate ?
>==> Question for Watson
>>It has to use numerical
>>methods just the same..
>>
>>Philip Oakley
>________________________
>
>Easy to check the accuracy of the
>simulator by comparing with the
>analytical solution. The work sheet as
>presented is a disaster. The circuit is
>needed. If the collab has no drawing
>tool for the circuit, this one can be
>used to make up the individual branches
>on Paint. An equivalent closed loop
>circuit is then to come but nothing is
>specified about the "Load". The load can
>be any 1rst, 2nd ... order system. What
>complicates matters is that the overall
>"supposed system" is under some vagary
>potential as shown by the discontinuous
>graph.
>
>In my "real times", we had about nothing
>in hands(numerical algos, PC's ...etc).
>But we had tools that seemed to be
>ignored today as they had been
>progressively replaced by numerical
>methods and CAS. We had the "Analog
>Computers"... just to name one: Systron
>Donner. Things were damned easy and
>visual by putting the capacitors,
>inductances, resistances of all
>components, putting them in the holes of
>the bread board, and put the system
>under some voltage generators of
>appropriate shape. Multitrace
>oscilloscopes existed [Textronix, Ribet
>Desjardin ...], you could see each
>branch under excitation and then steady
>state. Recording was either on paper,
>film or collected and data logged.
>
>This project could conclude as a tool,
>but as it stands, more is needed. So
>many times it was stated than Mathcad 14
>"can't do" and there are work sheets
>exchanged in different versions that
>finally the project is not traceable. At
>least, at this point it is clear that
>the project is solving DAE/ODE systems
>rather than getting the Fourier
>polynomials of the discontinuous
>function. In fact, the project is new,
>from scratch and no circuit.
>
>What is the scope of the project ? Close
>the loop on the load and get it work
>with all these branches acting as
>"notching" filters, or else ? Reading
>the collab that the simulator was close
>to Mathcad, then why visit the collab if
>a solution or a kind of solution is
>already in hand and never posted. If a
>Mathcad solution is in hand, either the
>collab is already an expert or the crew
>around is expert. The solutions are
>about = , solutions of which circuit ?
>
>jmG
>
>PS: passed for the interest of the
>matter 11.2a
>From the Mathcad 8 Treasury.
>

JmG,

I didn't give details about how the discontinuous current is generated because it is immeterial to know that detail for the purpose of solving the currents of impedances Z1 to Z4. Just assume I have such a discontinuous current waveform to the impeances as shown in my file. Since you have made it an issue, let me explain more. This is the input stage of a switching step-down dc/dc power converter. It generates a regulated dc output voltage wih a closed loop control system from a dc input voltage source that I have shown as Vdc in the schematic in my file.

The discontinuous current is generated by switching action of a power mosfet in the topology that I haven't shown in the schematic. The slope on the current waveform is the slope of the inductor current in the converter topology.

The impedance Zin is the stray resistance and inductance of the path that connects the dc input voltage source to the power mosfet. The impedances Z1 to Z4 are decoupling capacitors. Often times, there may be several and different kinds of capacitors connected in parallel and I model the capacitors from Z1 to Z4 as series connected R-L-C.

Althought these details were unnecessary in solving the currents from Z1 to Z4, I explained them for your curiosity.

I wanted to get a solution in Mathcad because the circuit simulator available in my company has a network license with multiple users, may not be available sometimes while I have Mathcad with single user license, which is always available.

I will look at the MC file you posted about DAE/ODE and learn from it. I haven't used DAE/ODE with Mathcad much.

Mark.

On 9/4/2009 7:29:16 PM, mark_neil wrote:
>On 9/4/2009 3:50:05 PM, lpoulo wrote:
>>>I was trying to solve for the currents by
>>>writing the Y matrix of the circuit, finding
>>>Fourier series of the Isource, solving for the
>>>currents in s-domain for each component of the
>>> series and taking inverse laplace to find the
>>>currents in time domain.
>>
>>This was my approach, using a
>>numeric solution and DFT's ,
>>not Laplace transforms. I
>>don't see any merit in trying
>>a symbolic solution for
>>anything other than
>>textbook/tutorial examples
>>with 1 or 2 poles. For any
>>network of this complexity,
>>symbolics are unlikely to
>>work, and even so, would be
>>unlikely to provide more
>>insight than could be obtained
>>with variations of the numeric
>>solution.
>>
>>Lou
>
> Lou,
>Actually, I got very close to the
>solution with Laplace transformation but
>I felt it was little bit too complex for
>Mathcad to handle it and may not work
>properly on some examples with different
>shapes of Isource. That is why I posted
>the question.
>I compared your solution in the Mathcad
>file with that of circuit simulator and
>they are impressively close! I have
>changed some circuit parameters and
>compared again and everytime Mathcad
>generates the right result w.r.t. to the
>simulator output. Also, it is
>impressively fast. Thank you very much
>for spending time on this.
>I almost haven't used matrix or vector
>calculations or DFT with Mathcad. I need
>to calculate the rms values of these
>currents and I don't know the right
>syntax for this. Would you mind adding
>rms calculations of the currents to the
>file you have posted?
> Thanks again.
>
> Mark.

Lou,
I have added to the file the rms calculation of the currents; it wasn't as difficult as I thought. Thanks.

Mark.

On 9/5/2009 3:06:59 PM, mark_neil wrote:
>On 9/4/2009 7:29:16 PM, mark_neil wrote:
>>On 9/4/2009 3:50:05 PM, lpoulo wrote:
>>>>I was trying to solve for the currents by
>>>>writing the Y matrix of the circuit, finding
>>>>Fourier series of the Isource, solving for the
>>>>currents in s-domain for each component of the
>>>> series and taking inverse laplace to find the
>>>>currents in time domain.
>>>
>>>This was my approach, using a
>>>numeric solution and DFT's ,
>>>not Laplace transforms. I
>>>don't see any merit in trying
>>>a symbolic solution for
>>>anything other than
>>>textbook/tutorial examples
>>>with 1 or 2 poles. For any
>>>network of this complexity,
>>>symbolics are unlikely to
>>>work, and even so, would be
>>>unlikely to provide more
>>>insight than could be obtained
>>>with variations of the numeric
>>>solution.
>>>
>>>Lou
>>
>> Lou,
>>Actually, I got very close to the
>>solution with Laplace transformation but
>>I felt it was little bit too complex for
>>Mathcad to handle it and may not work
>>properly on some examples with different
>>shapes of Isource. That is why I posted
>>the question.
>>I compared your solution in the Mathcad
>>file with that of circuit simulator and
>>they are impressively close! I have
>>changed some circuit parameters and
>>compared again and everytime Mathcad
>>generates the right result w.r.t. to the
>>simulator output. Also, it is
>>impressively fast. Thank you very much
>>for spending time on this.
>>I almost haven't used matrix or vector
>>calculations or DFT with Mathcad. I need
>>to calculate the rms values of these
>>currents and I don't know the right
>>syntax for this. Would you mind adding
>>rms calculations of the currents to the
>>file you have posted?
>> Thanks again.
>>
>> Mark.
>
>Lou,
>I have added to the file the rms
>calculation of the currents; it wasn't
>as difficult as I thought. Thanks.
>
>Mark.

In the attached file, I compare Mathcad and circuit simulation results for two different set of component values. Both Mathcad and circuit simulation results are pretty close...

Mark
LouP
11-Garnet
(To:mark_neil2)

>>I have added to the file the rms
>>calculation of the currents; it wasn't
>>as difficult as I thought. Thanks.
>>
>>Mark.
>
>In the attached file, I compare Mathcad
>and circuit simulation results for two
>different set of component values. Both
>Mathcad and circuit simulation results
>are pretty close...
>
>Mark

Getting RMS is simply applying the built-in stdev fct. to one period of the current component of interest - presumably what you did.

I would expect that the numeric analysis results from the two solution methods should match quite well.

Other than the computer numerical precision, the mathcad model I used is exact up to the order of harmonic components considered (which can be quite high), since it is simply doing the superposition of discrete Fourier components present in a periodic input. There are no other approximation assumptions in analyzing the steady state response of a linear system with a periodic forcing function, and no convergence issues, except possibly at discontinuities, and no stability issues. Using DFT's in this case is not an approximation (except for the max harmonic caveat).

For other than sinusoidal steady state (which your example is not), I believe that the SPICE-based simulators use numeric integration techniques (I am assuming that PSIM is one of these, but I don't know for sure). These have typically been refined so that their sim results are quite accurate for both linear and nonlinear models. The results are generally more limited by the validity of the model than by the accuracy of the analysis. In this respect, I would expect good agreement between the two techniques. whether you see this result in the real world is another story.

Some comments:
Mathcad can handle units, and it is a good idea to use them, since dimensional errors can flag many mistakes, and it's easy to keep track of typical components and frquencies, which rarely have values in the 0.1 -10 range (the limit of my mental calcs).
Don't bother with symbolics; they're rarely useful for real problems.

Lou

On 9/8/2009 4:38:17 PM, lpoulo wrote:
>>>I have added to the file the rms
>>>calculation of the currents; it wasn't
>>>as difficult as I thought. Thanks.
>>>
>>>Mark.
>>
>>In the attached file, I compare Mathcad
>>and circuit simulation results for two
>>different set of component values. Both
>>Mathcad and circuit simulation results
>>are pretty close...
>>
>>Mark
>
>Getting RMS is simply applying
>the built-in stdev fct. to one
>period of the current
>component of interest -
>presumably what you did.
>
>I would expect that the
>numeric analysis results from
>the two solution methods
>should match quite well.
>
>Other than the computer
>numerical precision, the
>mathcad model I used is exact
>up to the order of harmonic
>components considered (which
>can be quite high), since it
>is simply doing the
>superposition of discrete
>Fourier components present in
>a periodic input. There are no
>other approximation
>assumptions in analyzing the
>steady state response of a
>linear system with a periodic
>forcing function, and no
>convergence issues, except
>possibly at discontinuities,
>and no stability issues. Using
>DFT's in this case is not an
>approximation (except for the
>max harmonic caveat).
>
>For other than sinusoidal
>steady state (which your
>example is not), I believe
>that the SPICE-based
>simulators use numeric
>integration techniques (I am
>assuming that PSIM is one of
>these, but I don't know for
>sure). These have typically
>been refined so that their sim
>results are quite accurate for
>both linear and nonlinear
>models. The results are
>generally more limited by the
>validity of the model than by
>the accuracy of the analysis.
>In this respect, I would
>expect good agreement between
>the two techniques. whether
>you see this result in the
>real world is another story.
>
>Some comments:
>Mathcad can handle units, and
>it is a good idea to use them,
>since dimensional errors can
>flag many mistakes, and it's
>easy to keep track of typical
>components and frquencies,
>which rarely have values in
>the 0.1 -10 range (the limit
>of my mental calcs).
>Don't bother with symbolics;
>they're rarely useful for real
>problems.
>
>Lou

Lou,

To calculate the rms value of the currents, I took the square of the current values, and calculated the area of it within one switching cycle by assuming two adjacent points form a trapezoid. Then I divided the resultant number by the switching period and took the root of it. I have attached the formula here. Could you attach the image of the rms calculation formula with the built-in stdev fct. so that I learn that? I have double major: mechanical and power engineering. I mostly work with continuous functions and very rarely with discrete functions. Therefore, I use s-domain analysis more than any other methods and I am weak at discrete analysis techniques.

Correct; correlating the results to real world will not be perfect: one dominant reason is that the esr of the caps are frequency dependent in the real world but I use constant resistor values in my calculations.

Thanks,

Mark.
LouP
11-Garnet
(To:mark_neil2)

Lots of fct's available; see the Data Analysis Functions in mcd help. The two most common I use are mean and stdev. Just define a new variable Irms as

I2rms:stdev(I2),

or to just display the value without assigning it, write

stdev(I2)=

The function name is stdev, and it takes one or more arguments, which can be a mixture of scalars and arrays. In the present case the argument is a single vector of current sample values on a time grid. since the sample grid is dense enough and represents a whole period, the std dev. calculation gives the correct RMS value. The fct. mean works in the same way. No need to define the formula as you have. Try it yourself on some examples.

As far as always using the continuous s (and f) doomains, you get to stay there only for symbolics. For almost everything real (practical) you will need to use the discrete models; that's what you get with digital computers. One can set up appropriate models that approximate the continuous time behavior sufficiently well for good results. That's what modeling is about.

You can also set up templates/formats that provide data entry and results in familiar terms. This is the easy part. The key thing is to learn how various discrete approximations, diff eq solvers, and DFT's relate to the continuous domains that you (and I) learned, and how to set up good models using the discrete domain analysis tools. Might as well get started; it's the only game in town these days 🙂

Lou

On 9/9/2009 5:25:36 PM, lpoulo wrote:
>Lots of fct's available; see
>the Data Analysis Functions in
>mcd help. The two most common
>I use are mean and stdev. Just
>define a new variable Irms as
>
>I2rms:stdev(I2),
>
>or to just display the value
>without assigning it, write
>
>stdev(I2)=
>
>The function name is stdev,
>and it takes one or more
>arguments, which can be a
>mixture of scalars and arrays.
>In the present case the
>argument is a single vector of
>current sample values on a
>time grid. since the sample
>grid is dense enough and
>represents a whole period, the
>std dev. calculation gives the
>correct RMS value. The fct.
>mean works in the same way. No
>need to define the formula as
>you have. Try it yourself on
>some examples.
>
>As far as always using the
>continuous s (and f) doomains,
>you get to stay there only for
>symbolics. For almost
>everything real (practical)
>you will need to use the
>discrete models; that's what
>you get with digital
>computers. One can set up
>appropriate models that
>approximate the continuous
>time behavior sufficiently
>well for good results. That's
>what modeling is about.
>
>You can also set up
>templates/formats that provide
>data entry and results in
>familiar terms. This is the
>easy part. The key thing is to
>learn how various discrete
>approximations, diff eq
>solvers, and DFT's relate to
>the continuous domains that
>you (and I) learned, and how
>to set up good models using
>the discrete domain analysis
>tools. Might as well get
>started; it's the only game in
>town these days 🙂
>
>Lou

stdev function generates nearly the same number for rms values of the currents as the discrete integral of the currents with trapezoidal approximation does. However, they differ significantly for Isum in your file (or Isource current). I know that the number calculated by stdev is wrong. Don't know why though... I need to check the assumptions and formula of the stdev function...

Yes, you are right that one can setup a template to discretize continuous fucntions with DFT and replace it for s-domain analysis. This is actually what strike me when I saw your file. The discrete analysis is uncomparably faster...

Thanks.

Mark.

stdev is actually wrong for calculating RMS values. What stdev calculates is the RMS value of the deviations from the mean. When the mean is zero (as for the currents through the capacitors, capacitors don't pass a DC component) the results are the same. When the mean is non-zero, they will differ.

I usually use the magnitude operator (||). It gives the square root of the sum of the squares, you still have to divide by the square root of n to get the RMS value.

Note that either way you are getting the RMS value for the discrete points. That is equivalent to doing the integral with simple Euler sums. For a fine enough grid that will not differ appreciably from the trapezoidal rule that you used. How fine is fine enough is a matter of the necessary accuracy.
__________________
� � � � Tom Gutman

On 9/9/2009 8:08:15 PM, Tom_Gutman wrote:
>stdev is actually wrong for
>calculating RMS values. What
>stdev calculates is the RMS
>value of the deviations from
>the mean. When the mean is
>zero (as for the currents
>through the capacitors,
>capacitors don't pass a DC
>component) the results are the
>same. When the mean is
>non-zero, they will differ.
>
>I usually use the magnitude
>operator (||). It gives the
>square root of the sum of the
>squares, you still have to
>divide by the square root of n
>to get the RMS value.
>
>Note that either way you are
>getting the RMS value for the
>discrete points. That is
>equivalent to doing the
>integral with simple Euler
>sums. For a fine enough grid
>that will not differ
>appreciably from the
>trapezoidal rule that you
>used. How fine is fine enough
>is a matter of the necessary
>accuracy.
>__________________
>� � � � Tom Gutman

Thanks Tom. Yes, I tried it as you explained and now the trapezoidal formula and |I|/root(N) gives very close result for all currents.

Mark.

On 9/8/2009 2:21:48 PM, mark_neil wrote:
...
>In the attached file, I compare Mathcad
>and circuit simulation results for two
>different set of component values. Both
>Mathcad and circuit simulation results
>are pretty close...
>
>Mark
________________________

Pretty close, Oh !
Either one is wrong in the ramp part, at same ramp/flat ratio. Better check, f_Z does not seem correct. Just comment from the visible graphs.

jmG



On 9/8/2009 9:14:37 PM, jmG wrote:
>On 9/8/2009 2:21:48 PM, mark_neil wrote:
>...
>>In the attached file, I compare Mathcad
>>and circuit simulation results for two
>>different set of component values. Both
>>Mathcad and circuit simulation results
>>are pretty close...
>>
>>Mark
>________________________
>
>Pretty close, Oh !
>Either one is wrong in the ramp part, at
>same ramp/flat ratio. Better check, f_Z
>does not seem correct. Just comment from
>the visible graphs.
>
>jmG
>

In the pdf file comparing Mathcad to simulation, the parameters are not the same as the ones I initially put in the Mathcad file when I posted the question the first time. I think you are comparing the currents for different circuit parameters, which do not match. The Mathcad and simulation current waveforms in the pdf file match well.

Mark.

>The Mathcad and simulation current waveforms in the pdf file match well.<<br> _________________________

NO, they don't ! Look at my image, not yours.
The ramp part spans same for both: the simulator & Mathcad and the two graphs are so much different that something is wrong in either tool. I could not size the Mathcad image same as the simulator because of the 6 arguments taking + vertical space. Does not matter, the shapes aren't same.

jmG

Just in case you need the Laplace of your "shark tooth".



jmG

...as you can see: the Laplace algebra is a bit monkey business !



jmG

Mathcad has never had a separate symbolic and numeric assign. The same construct serves for both, each processor uses the information it needs from the assignments.

There is no distinction between numeric functions and symbolic functions. There are just functions, which you can evaluate (or try to evaluate) with either the numeric or the symbolic processor. There are constructs that only work with one of those processors, and so some functions that can only be evaluated numerically or symbolically. Mostly these are restrictions of the symbolic processor (Mathcad is, at heart, the numeric processor, with a symbolic processor bolted on).

You used an if construct in defining your function. Ifs have very limited support in the symbolic processor, generally not being supported except for known data values. I don't know what your A and B are references to. My sheet constructs your function using Φ, and gets a symbolic expression for the Fourier coefficients. Since I got a symboic result for the Fourier coefficients using MC14, I stand by my statement that your problem is with your original function definition.
__________________
� � � � Tom Gutman

On 9/3/2009 10:08:17 PM, Tom_Gutman wrote:
>Mathcad has never had a
>separate symbolic and numeric
>assign. The same construct
>serves for both, each
>processor uses the information
>it needs from the assignments.
>
>There is no distinction
>between numeric functions and
>symbolic functions. There are
>just functions, which you can
>evaluate (or try to evaluate)
>with either the numeric or the
>symbolic processor. There are
>constructs that only work with
>one of those processors, and
>so some functions that can
>only be evaluated numerically
>or symbolically. Mostly these
>are restrictions of the
>symbolic processor (Mathcad
>is, at heart, the numeric
>processor, with a symbolic
>processor bolted on).
>
>You used an if construct in
>defining your function. Ifs
>have very limited support in
>the symbolic processor,
>generally not being supported
>except for known data values.
>I don't know what your A and B
>are references to. My sheet
>constructs your function using
>�, and gets a symbolic
>expression for the Fourier
>coefficients. Since I got a
>symboic result for the Fourier
>coefficients using MC14, I
>stand by my statement that
>your problem is with your
>original function definition.
>__________________
>� � � � Tom Gutman

Maybe you are right. I have limited understanding of Mathcad and still a lot to learn. Thanks for your explanations...

Mark.
Top Tags