Get Help

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- solve block error this variable is undefined

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
03:39 PM

08-04-2013
03:39 PM

Hi everyone my name is jimmy from Mexico im student researcher my major is electromechanical engineer, i have a project for evaluation of PV modules, and one of my objectives is too use data-sheet information with 4 parameters Voc,Isc,Vmp,Imp from the PV module to extract another parameters (a,Iph,Io,Rs,Rp) that not included in the data-sheet. For that im using a five parameter model to solve that problem, im using the solve block (Given,Find) for a nonlinear systems, the method im using is the conjugate gradient. im attaching my file and you will see all the equations that i use, my problems is that when i put the solve command an error display appear saying that some variable is undefined and i check all the file to see what would be the problem and when i use the track error option put me in the first formula the saying that Iph is undefined. i will really appreciated if you can help me because im new on this software

Best regards to the PTC community.

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-06-2013
03:27 PM

08-06-2013
03:27 PM

the five equations that i put it is from the model. It supposed works solving with the conjugated gradients method with mathcad solve block (Find,Given).

Nevertheless iot seems that Alan is right and you are missing a fifth equation. Or in other words, there is more you can wish.

Being an underdetermined system would perfectly explain the different results achieved with different methods.

Of course this does not mean that I think that there is mistake in the De Soto model, but maybe it needs some further inverstigation from your side.

38 REPLIES 38

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
04:13 PM

08-04-2013
04:13 PM

Re: solve block error this variable is undefined

What I spotted on first glance is that

1) Rs has no guess value

2) Most/All of your five functions don't use all parameters, so these obesolete parameters should be omitted

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
04:27 PM

08-04-2013
04:27 PM

Re: solve block error this variable is undefined

hi Werner i will check carefully all ur points in my file thanks for the comments.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
04:36 PM

08-04-2013
04:36 PM

Re: solve block error this variable is undefined

Unfortunately changing it does not help ;-(

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
04:39 PM

08-04-2013
04:39 PM

Re: solve block error this variable is undefined

Werner Exinger escribió:

Unfortunately changing it does not help ;-(

if there any other way to solve it?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
04:40 PM

08-04-2013
04:40 PM

Re: solve block error this variable is undefined

Think it should work that way. I am not sure what the problem is.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
04:45 PM

08-04-2013
04:45 PM

Re: solve block error this variable is undefined

Werner Exinger escribió:

Think it should work that way. I am not sure what the problem is.

ok Man i ll try to see what should be the problem thx for everything best regards.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
04:53 PM

08-04-2013
04:53 PM

Re: solve block error this variable is undefined

Error messages with solve blocks are worse than awful. In fact the one you got is the only one a solve block would throw, no matter what the error ist. Usually Trace Error helps a bit, but not in your case.

Neverthess I found that if I provide a guess value for Rs and if I disable the equation with h(), I get a solution - whatever that may mean. You may want to double check your model.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
05:28 PM

08-04-2013
05:28 PM

Re: solve block error this variable is undefined

Werner Exinger escribió:

Error messages with solve blocks are worse than awful. In fact the one you got is the only one a solve block would throw, no matter what the error ist. Usually Trace Error helps a bit, but not in your case.

Neverthess I found that if I provide a guess value for Rs and if I disable the equation with h(), I get a solution - whatever that may mean. You may want to double check your model.

yes Werner i do the same and only fails when i enable the eq h() , but the values are not the correct one and i also check the articule of the model and it seems to not have a problem ;(

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
05:40 PM

08-04-2013
05:40 PM

Re: solve block error this variable is undefined

At least the error is now more meanigful - if you use trace error it says that the no solution was found and suggested to change TOL/CTOL (which didn't help) or provide different guess values. So if your equations are correct try the correct solution values as guess values to see if it would come to an solution.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
06:03 PM

08-04-2013
06:03 PM

Re: solve block error this variable is undefined

Werner Exinger escribió:

The five reference parameters (a, Io, Iph, Rs, and Rp) can be

obtained by simultaneously solving Eq. (7) through Eq.

(11) using the Mathcad solve block (Given …. Find) and

by implementing the method of Conjugate Gradients.

The necessary guess values are easily determined as

follows:

The value Iph is approximately equal to the value of Isc

which can be used as a good guess value. Usually, the diode quality factor 1 ≤ a ≤ 1.5 . The reverse saturation current Io guess value can be obtained using the following equation.

A guess value for Rp can be obtained by evaluating Eq. 2 at

open circuit condition. Also, a guess value for Rs can be

obtained by evaluating Eq. 2 at short circuit condition and

assuming Rp→ ∞

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
07:23 PM

08-04-2013
07:23 PM

Re: solve block error this variable is undefined

The factor Io is at the wrong position in the first three equations.

Not sure about the last two equations

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
07:46 PM

08-04-2013
07:46 PM

Re: solve block error this variable is undefined

Werner Exinger escribió:

The factor Io is at the wrong position in the first three equations.

Not sure about the last two equations

could you explain me with more details Werner cuz i dont see the problem

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
08:11 PM

08-04-2013
08:11 PM

Re: solve block error this variable is undefined

jaime guevara wrote:

Werner Exinger escribió:

The factor Io is at the wrong position in the first three equations.

Not sure about the last two equations

could you explain me with more details Werner cuz i dont see the problem

In all three equations there is an exponential function followed by "-1". Both should be multiplied by Io but in your sheet only the exponential expression is multiplied by Io.

Unfortunately changing it does not help in finding a solution so there may be an error in the last two equations.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
09:51 PM

08-04-2013
09:51 PM

Re: solve block error this variable is undefined

i check the last comments and checking the model i found the derivates and the last equation was not right, but i changing the values and put the correct ones but didnt works too.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
11:15 PM

08-04-2013
11:15 PM

Re: solve block error this variable is undefined

What is f_Imp and f_Vmp.

And whats the connex of the last two equ and to the two expression given in the literature you cited?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-04-2013
11:32 PM

08-04-2013
11:32 PM

Re: solve block error this variable is undefined

Plotting theP–V andI–V curves requires solving (2) for I∈[0,Isc,n] and V∈[0,Voc,n]. Equation (2) does not have

a direct solution because I=f(V,I) and V=f(I,V).This transcendental equation must be solved by a numerical method and this imposes no difficulty.

I = f (I , V ) .........................................(14)

where f (I, V ) is the right side. By differentiating (14):

doing the same analogy for dV/dI we got the dP/dI.

this came from the reference of the model paper

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
05:01 AM

08-05-2013
05:01 AM

Re: solve block error this variable is undefined

Solution seems to be mostly working; but with the use of units one error has been noted in the definition of Rs.

Depending on whether you choose to use units or not the symbloic solver may (or may not) give a sensible answer.

The final solve block did not converge for "Find" but does work with "Minerr"

Hope this helps

Andy

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
05:42 AM

08-05-2013
05:42 AM

Re: solve block error this variable is undefined

Your sheet works for me using Find(), too, and comes up with the same solutions.

I found that Jaime's sheet would find a solution using Find() if Find() is evaluated symbolically. But the solution differs from yours! Its noticeable in your solution that Iph doesn't change.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
06:19 AM

08-05-2013
06:19 AM

Re: solve block error this variable is undefined

Hi Werner,

Minerr is giving a lower ERR value, but the Find solution definitely appears better from the Io current value returned.

An understanding of the meaning of the equations is required to say what is correct and / or meaningful.

Regards

Andy

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
07:17 AM

08-05-2013
07:17 AM

Re: solve block error this variable is undefined

Maybe, but in your sheet we get the same solutions using Find and MinErr (symbolic eval is not possible ere because of the units).

So I wonder if you have changed something else other than adding units and correcting the definition of Rs (which at the end only affects slightly the initial guess value for Rs).

I just tried and deleted all units in your sheet and it still evaluates using Find() - so obviously something else was changed, too.

This is what I get with your sheet and symbolic eval (numeric will give the same results as with units). Notice especially the difference in Io and a!

And the values are different from what I got with Jaimes's sheet and symbolic eval.

I have no explanation.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
11:16 AM

08-05-2013
11:16 AM

Re: solve block error this variable is undefined

I think that it might be another case for the MathCad Mad House ...

I've narrowed the search down to the Find statement , but I can't spot the difference... :-))

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
12:00 PM

08-05-2013
12:00 PM

Re: solve block error this variable is undefined

Obviously much dependent on the algorithm chosen (LM, CG)

Wonder what algorithm the symbolic eval choses - should not be an approximating numerical algorithm.

Wouldn't say that the results from the symbolic are best while I think they should be.

In your comparison you have to pull down the functions you evaluate a bit so the correct values are taken

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
01:20 PM

08-05-2013
01:20 PM

Re: solve block error this variable is undefined

hi Werner and Andy let me put the correct answer from the model paper

thats the values from each parameter i use the last revision of my file and seems only working with the LM algorithm

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
04:49 PM

08-05-2013
04:49 PM

Re: solve block error this variable is undefined

Usually it is said the LM is the to be preferred algorithm.

Maybe you can come closer to the published values by changing the values for TOL and CTOL.

Anyway your solve block remains a puzzle

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
06:02 PM

08-05-2013
06:02 PM

Re: solve block error this variable is undefined

i found something if i change the guess value of **a** wich is the diode factor, its afects with all the system. maybe i need to find the correct guess value of this parameter to find the correct solution.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
07:14 PM

08-05-2013
07:14 PM

Re: solve block error this variable is undefined

Selection of guess values can in some cases influence the solution quite a lot. So what happens if you chose a:=1.3?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-05-2013
11:32 PM

08-05-2013
11:32 PM

Re: solve block error this variable is undefined

Werner Exinger escribió:

i random values between the range of 1 to 1.5 , and i found that the most approach correct values is between 1.3 and 1.4 and changing the values for TOL and CTOL. but im still working on it

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-06-2013
03:24 AM

08-06-2013
03:24 AM

Re: solve block error this variable is undefined

Seems to me you don't have 5 independent equations with which to find the five unknowns. These last two:

provide basically the same information in a slightly different form (substitute one into the other and you get a trivial identity). I think you need a fifth, *independent* condition.

Alan

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-06-2013
03:14 PM

08-06-2013
03:14 PM

Re: solve block error this variable is undefined

AlanStevens escribió:

Seems to me you don't have 5 independent equations with which to find the five unknowns. These last two:

provide basically the same information in a slightly different form (substitute one into the other and you get a trivial identity). I think you need a fifth,

independentcondition.Alan

Hi Alan thanks for your comments, im using this method for my project becuse i want to use it as a predicted method , the five equations that i put it is from the model. It supposed works solving with the conjugated gradients method with mathcad solve block (Find,Given).