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

Solving symbolically a system of equations


Solving symbolically a system of equations

Hello, I’m trying to solve a system of equations symbolically using the Given & Find commands.

Mathcad finds the solution but it won’t display it because it’s too long. It does however mention that the outcome may be further used if allocated to a function or variable. I… don’t know how to do this….

The solution of the system consists of 8 terms: v1,v2….v8 which will be expressed as a function of the z1,z2,z3…z8,za,zb,zc,zd variables.

I can imagine that the entire solution is very large. I’m interested though only in the formulae found for v1.

Can anyone help in allocating the system solution to a variable and display only the v1 solution?



Appended by Werner Exinger:

Hmmm, thats crazy. While a document sure is not the right way to ask for help, I hadn't expected that I would be allowed to edit that post and attach files.

It seems that I am and so I will do.

As I already posted in the comment v1 alone still is too large to display for MC15. I doubt that to be able to view an expression that large and complex would be of any help anyway. As the error message states you are able to use the expression in further calcuations and/or manipulations - you simply have to assign it a variable or function. See attched file for some ways to do.


Appended by Andrei: I'm sorry for posting this question as a document. Following Werner's comments I deleted it out of the document section and copied it to Discussions. In the process I copied Werner's comment.

Werner thanks for showing how the results may be attributed to a variable. It's still quite unfortunate that I can't get a formulae for v1, as z1..zd are in my case other formulaes - this is just a first step for calculating the impedance of a complex electrical network.Finding numerical solutions is not an option for me.

Anyways, your help is much appreciated. Thanks!



FYI, the limit for "too large to display" is somewhere beyond four pages wide. I've had results that large shown. I just wanted to support Werner's comment about "I doubt that to be able to view an expression that large and complex would be of any help anyway".

Looks like Werner is getting your problem solved so I'll bow out now.

So you want to substitute your z... for other expressions. You could do this using the symbolic evaluation with substitute, but again I guess you would not be able to view the result. At the end, I assume, you will arrive at apoint where you will want to get numeric results. Up to that moment you could use the "invisible" expressions, anyway. The problem with expressions being too large for MC15 has been around for some times and some people explained that they need the symbolic result as they intend to publish it. I really doubt that the publication of a more than 4 page wide formula would make sense to anyone.

Maybe it would be a good idea if you post the original problem and goal to achieve at the end and some specialists may find an alternative solution.

Two ideas if you still insinst on viewing the symbolic evaluation of v1:

1) As i had already written in the comment you deleted, Mathcad Prime2 handles that too large expressions differently. The region they are in can be stretched by the user as far as he wants. So you would see the whole expression. At least thats how I understood that feature - not sure if there still is some kind of limit. So if you have access to Prime (not the free Express version as it does not support solve blocks), you could convert your sheet and give Prime2 a try,

2) Sometimes (quite seldom) the modifier "simplify" or even "simplify,max" will help reducing the size of the expression to en extent that Mathcad is able to display it. But be warned that this could take alot of time (and memory). I just tried and cancelled operation after ten minutes - but my machine is rather lame.

3) (yes - thats number three of two 😉 You could try using the symbolic solve (putting all 9 equations in a vector) rather than the solve block. While I don't think it will change anything on the outcome - maybe its worth a try. Use it with without simplify.

I understand the expression I'm after is long. Let me explain the context: The electrical network that I'm modelling is actually a simplified rectangular type antenna with a variable (user defined) number of turns. Each turn is composed of inductances and inter-segment parasitic capacitors. I generated a simplified model with lumped elements (Ls and Cs) and simulated it with Spectre (Cadence simulator). My goal is to find the self-resonance frequency of the antenna. Next, I built a Matlab program where I enter the parameters of the antenna and I need a formulae to calculate the self-resonance of the antenna. At the end I will convert this into an executable that can be run on any machine without the need of a Cadence/ADS/Matlab expensive simulator. But for that I need a formulae for the self-resonance frequency. The first step in getting there is the formulae for the antenna impedance. Next, I will take the first derivative over frequency of the antenna impedance and the first "zero-crossing" will be the sefl-resonance frequency.

I did this whole exrcise by hand for a 1 turn antenna. Calculated the antenna impedance using tensors. Mathcad came with the same formulae .. well in an expanded form. Took the first derivative and estimated the self-resonance frequency. Performing the simulation in Cadence I could find exactly the same value....good news. Next, I added one more turn to the antenna ... two turns and here I got stuck with the antenna impedance calculation - this is how I came up with the 8 equations system. Adding one more turn (3 turns) will lead to 12 equations and so on.

This is just to give you a bit of background.... I need to rethink my strategy here; I have the feeling I might drive into the wrong direction. I'll try the Prime2 direction though..... Thanks for your inputs! Really appreciate it!

I understand that you need the symbolic results t ofeed them in another tool and at the and in self contained executable. Obviously you do not want implement numeric algorithms in that program.

Concerning Mathcad Prime: I just converted your sheet and it seems, that Prime does not allow symbolic evaluations in solve block. I'm not that firm with Prime so maybe the problem is something else.

So to do it in Prime you have to resort to using the symbolic solve. My try (without any simplify) resulted in having to cancel it after half an hour as it seemed to run endless. But maybe you have more patience and/or a better machine.

On the other hand the situation really could mean that its a good idea to rethink your stragegy, look if you can simply something, reduce variable etc. or that you are simply using the wrong tool for the task. Mathcad is a good allround tool for formatting, calculating woth units, numeric algorithms and symbolics. In every aspect it does its job equally good or equally well, as you would like to see it. Obviously a symbolic specialist like Mathematica could do a better job. Jan has provided the output. Don't know how good the free Maxima would do on this job - maybe its worth giving it a try.

Result in Mathematica 9

Solution for v1,v2,v3,v4,v5,v6,v7,v8 is in the file Solution1.7z

Simplified solution is in the file Solution2.7z

Jan Kowalski schrieb:

Result in Mathematica 9

Solution for v1,v2,v3,v4,v5,v6,v7,v8 is in the file Solution1.7z

Simplified solution is in the file Solution2.7z

Gave them a quick look - somewhat daunting!

But as Mathcad got a solution it should be able to reduce the system of 9 equations with 8 variables to solve for, to only 8 equations. Maybe Mathcad then would do better on it.

Great, I'll feed this formulae in Matlab and check the match between the analog simulations in Cadence and the Matlab simulations outcome. Will let you know. Thanks Jan!

I'm export result to three different file ...(pdf,tex,xml)

And what about this system - see the attach

See the attach file.Result in Mathematica.

Jan Kowalski schrieb:

See the attach file.Result in Mathematica.

I, too, think, that Mathematica would be the tool to choose when it comes to heavy symbolics.

Jan, just for curiosity, wouldn't you like to give that task a try with Mathematica?

Its basically about the following task


Jan Kowalski schrieb:

See to

Yes, thanks. Have just commented there.

Hi all, I imported the formulae posted by Jan in Matlab and computed the antenna impedance between 10kHz and 100MHz in steps of 10kHz. I was expecting the machine will get really warm and will run for a while; I'm running Matlab R2009b on an HP Elitebook Laptop.

I was completely took by surprise to see that the simulation ended in approximately 10seconds whereas the same simulation for one turn antenna only took 7..8 seconds and there is a huge difference between the formula for v1 between the two cases.

The self-resonance frequency is not calculated - I'll need to get analytical formulae for the second derivative but I can see it on the impedance shape (numerically calculated) and ... again it matches perfectly the analog simulator. This is really great! I will get Mathematica and try the three turns as well. This is such a nice surprise for a friday afternoon. I was quite scheptical after the first few comments on this Discussion but now I think this methodology may still have a chance.....

hello everyone, I'm new at mathcad and Im using the prime 3 version. Reading this and looking for in internet I haven´t been able to find how to solve system of equations with end value condition.

What I'm trying to do is to solve g ' ' (x):=M with M:=P2*x-P3 for g ' (x=0) := 0, g ' (x=L) := 0, g (x=0) := 1, and g (x=L) := 0.

I already tried with solve block and with replace like doing it step by step almost by hand but, is there an eassier way?

I paste a sheet with averything i have tried



Your system of equations ends up with a singular matrix - there is no solution for P2 and P3 given the initial/end conditions you state.

You end up with: C1=0, C2=1, and the two equations L*P2-P3=0 and L*P2-P3=-1, which obviously can't have any solution unless 0=-1.

This thread is in no way related to your problem, so why are you posting here and don't open up a new discussion?

thank you, and sorry about that, may be I didn´t explain myself correctly...

I´ll open a new discussion.