Solving a Trickier-Than-Usual Circuit Equation with Mathematica 8.0”

In summary, Mathematica 8.0 is a software program that can be used to solve complex circuit equations by using its built-in functions and algorithms. These equations may be challenging due to non-linear components, multiple circuits, and complex mathematical expressions. However, Mathematica 8.0 makes solving them easier with its user-friendly interface, ability to handle complex expressions, and specialized functions. While it may have limitations for extremely large or complex equations, it can also be used for other aspects of circuit analysis such as graphing and data analysis. Its ability to handle symbolic calculations also makes it useful for understanding the underlying principles of circuit behavior.
  • #1
Zavata
1
0
Hello,

I'm working on a simple electronic circuit with two resistors and two diodes.

I have experimental data of the current-voltage characteristic and am trying to fit the corresponding equation - the resistors and diodes are unknown.

With basic circuit analysis, I get this tricky (messy) equation:

Id - (Vd-Rs*Id)/Rsh - Is1*(Exp[(Vd-Rs*Id+n2*vt*Log[1-(Id-(Vd-Rs*Id)/Rsh)/Is2])/(n2*vt)] - 1) = 0
where the current-voltage characteristic is Id(Vd), Rs is a series resistor, Rsh is a parallel shunt resistor and Is1, n1, Is2, n2 are the saturation current and ideality factors of the two diodes.

To achieve this, I've installed Mathematica 8.0 for Students and have written a small code.


**************************


(* Creation of an implicit function *)

vt = 0.0256;
function =
Last[Last[
Last[NDSolve[{Id[Vd, Rs, Rsh, Is1, n1, Is2,
n2] - (Vd - Rs*Id[Vd, Rs, Rsh, Is1, n1, Is2, n2])/Rsh -
Is1*(Exp[(Vd - Rs*Id[Vd, Rs, Rsh, Is1, n1, Is2, n2] +
n2*vt*Log[
1 - (Id[Vd, Rs, Rsh, Is1, n1, Is2,
n2] - (Vd - Rs*Id[Vd, Rs, Rsh, Is1, n1, Is2, n2])/
Rsh)/Is2])/(n1*vt)] - 1) == 0,
Id[0, Rs, Rsh, Is1, n1, Is2, n2] == 0},
Id, {Vd, -1.5, 1.5}, {Rs, 1, 3000}, {Rsh, 100, 10000}, {Is1,
10^-7, 10^-2}, {n1, 1, 20}, {Is2, 10^-7, 10^-2}, {n2, 1, 20}]]]]


(* Data *)

data = {{-1.20006167888641, -0.000335911958245561}, \
{-1.00005328655243, -0.000308143673464656}, {-0.380005955696106, \
-0.000220252826693468}, {-0.119975663721561, -0.000175646884599701}, \
{-0.740023016929626, -0.000272983132163063}, {-0.0199853703379631, \
-0.0000520107132615522}, {0.0399897247552872,
0.0000320119106618222}, {0.0600147768855095,
0.0000576710590394214}, {0.119977183640003,
0.000138641073135659}, {0.3599793612957,
0.000222295187995769}, {0.76000714302063,
0.000279692729236558}, {1.30006861686707, 0.00035656921681948}};
ListPlot[data]

(* Fit *)

fit = NonlinearModelFit[
data, {function[Vd, Rs, Rsh, Is1, n1, Is2, n2]}, {{Rs, 400}, {Rsh,
8000}, {Is1, 2*10^-4}, {n1, 1}, {Is2, 2*10^-4}, {n2, 1}}, {Vd}]


**************************

I get three problems.


1. NDSolve doesn't converge conveniently for values of Vd near 0.

NDSolve::mconly: "For the method \!\(\"IDA\"\), only machine real code is available. Unable to continue with complex values or beyond floating-point exceptions."


2. If I keep all these data points, there isn't enough memory for the fit calculation.

General::nomem: The current computation was aborted because there was insufficient memory available to complete the computation.


3. If I eliminate a few data points, I get the following error:

NonlinearModelFit::nrlnum: "The function value {0.000335912 +function[-1.20006,400.,8000.,0.0002,1.,0.0002,1.],0.000308144 +function[-1.00005,400.,8000.,0.0002,1.,0.0002,1.],0.000220253 +function[-0.380006,400.,<<4>>,1.],<<1>><<1>><<1>>,0.000272983 +function[-0.740023,400.,8000.,0.0002,1.,0.0002,1.],0.0000520107 +function[-0.0199854,400.,8000.,0.0002,1.,0.0002,1.]}\\n is not a list of real numbers with dimensions {6} at {Rs,Rsh,Is1,n1,Is2,n2} = {400.,8000.,0.0002,1.,0.0002,1.}."

I suspect this error is a consequence of the first one.



Some help please...
Does someone know if Mathematica can actually do this fit?
Or, is the function too messy?
Any idea for working out this problem?
Eventually, should I try another method or program?



Thanks in advance for any help.

A bright and sunshiny day to you!
Alexandre
 
Physics news on Phys.org
  • #2


Hello Alexandre,

Thank you for sharing your project with us. It seems like you are facing some challenges with fitting the data to your equation. I can offer some suggestions that may help you in your analysis.

Firstly, it is always helpful to have a clear understanding of the theoretical basis for your equation and the physical meaning of each of the parameters. This will not only help you in choosing appropriate initial values for your fit, but also in interpreting the results.

Secondly, I would recommend trying to fit your data using a simpler equation first, and then gradually adding complexity as needed. This will help you identify any potential issues with the data or the fit itself.

Thirdly, make sure to check the quality of your experimental data. Are there any outliers or errors that could be affecting your fit? It may be helpful to plot your data with error bars to get a better understanding of the variability in your measurements.

Lastly, if you continue to face difficulties with Mathematica, you may want to try using a different software or method for your fit. Some popular alternatives include MATLAB, Python, and Origin.

I hope this helps and wish you the best of luck in your research. Have a great day!


 

What is Mathematica 8.0 and how does it relate to circuit equations?

Mathematica 8.0 is a software program used for mathematical and scientific computations. It can be used to solve complex circuit equations by using its built-in functions and algorithms.

What makes solving trickier-than-usual circuit equations challenging?

Solving trickier-than-usual circuit equations can be challenging because they may involve non-linear components, multiple circuits, and complex mathematical expressions. These equations are often difficult to solve by hand, making the use of software like Mathematica 8.0 necessary.

How does Mathematica 8.0 make solving trickier-than-usual circuit equations easier?

Mathematica 8.0 has a wide range of built-in functions and algorithms specifically designed for solving circuit equations. It also has a user-friendly interface and the ability to handle complex mathematical expressions, allowing for more efficient and accurate solutions.

Are there any limitations to using Mathematica 8.0 for solving circuit equations?

While Mathematica 8.0 is a powerful tool for solving circuit equations, it may not be able to handle extremely large or complex equations. In these cases, it may be necessary to use other specialized software or break the equation down into smaller parts.

Can Mathematica 8.0 be used for other aspects of circuit analysis?

Yes, Mathematica 8.0 has a range of features that can be used for other aspects of circuit analysis, such as graphing and data analysis. It also has the ability to handle symbolic calculations, making it useful for understanding the underlying principles of circuit behavior.

Similar threads

  • Introductory Physics Homework Help
Replies
1
Views
439
  • Electrical Engineering
Replies
7
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
16K
  • Calculus and Beyond Homework Help
Replies
12
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
11K
  • Introductory Physics Homework Help
Replies
16
Views
7K
Back
Top