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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

3D data fit

Yack_attack
4-Participant

3D data fit

Hi, I need a function that can characteris 3 sets of data. Ideally a function like this z=f(x,y).

So X and Y are inputs resulting in Z. 

 

The 3 sets of data consist of forward current, voltage and temperature measurments of a diode. 

17 REPLIES 17
-MFra-
21-Topaz II
(To:Yack_attack)

Hi,

something like this?!?!:

fitfield.jpg

 

Werner_E
25-Diamond I
(To:Yack_attack)

So you have three equal sized data vectors X, Y and Z?

Are you looking for an interpolation or fitted surface/regression?

If you look for a regression function you would have to decide which type of function you would like to fit.

Concerning interpolation I have posted a file "2D-3D-Interpolation" already a few times here. You have the coice between simple linear interplation or various spline interpolations.

In both cases you get a function z(x,y) to work with.

You'll have to state which version of the program you are using - Prime or real Mathcad (15, for example).

 

Yack_attack
4-Participant
(To:Werner_E)

I'm using mathcad 15.

 

the data vectors are equally sized. As descibed they are foward voltage and current measurments at different temperatures.

The idea would be to have an expression V(I,t)

i'm after a spline interoplation.

 

Werner_E
25-Diamond I
(To:Yack_attack)


@Yack_attack wrote:

I'm using mathcad 15.

 

the data vectors are equally sized. As descibed they are foward voltage and current measurments at different temperatures.

The idea would be to have an expression V(I,t)

i'm after a spline interoplation.

 


Guess I didn't read your question completetly.

To do a generic 2D-interpolation, you would need a vector with temperature and current values, but an array with voltage values - one value for each combination of temperature and current.

And the two vectors don't need to be of equal size with my routines - otherwise you could use lspline, pspline or cspline out of the box.

As you write it, you have just three vectors and voltage and current are dependent on temperature only? So you could just create two separate functions V(t) and I(t).

Anyway - for whatever it may be worth, I attach the interpolation routines I was talking about.

EDIT: I added Valerys example data to demonstrate the usage of the routines:

Pic.png

 


@WernerExinger wrote:

So you could just create two separate functions V(t) and I(t).yway - for whatever it may be worth, I attach the interpolation routines I was talking about.

EDIT: I added Valerys example data to demonstrate the usage of the routines:

 

 


Thanks, Werner!

But my method is more unuversal!

I can use spline (rows) and linterp (columns) for the special data

One example

friction(Delta, Re)


@ValeryOchkov wrote:

But my method is more unuversal!


Really? Personally I prefer generic, universal functions as mine as I don't want to change anything in them in the future when I use them. Thats the reason I don't like the data and units inside that function. But ist good the both of us are happy with our ways of doing our things 😉

 

I can use spline (rows) and linterp (columns) for the special data

One example

friction(Delta, Re)


Hmm, I could't think of the need for using two different interpolations in the two directions. Of course my routines could be changed that way but if I would see the need for it I guees I would create a function with two additionals arguments specifying the interpolation types.

BTW, the link you provided is not working:

Pic.png


@WernerExinger wrote:

BTW, the link you provided is not working:

Pic.png


Now OK! Patience!

I can send the sheet!


@ValeryOchkov wrote:

Now OK!


Yes.

 


Patience!

Never! 😉

 

Just was curious as to why you would need mixed interpolation methods.


@WernerExinger wrote:

@ValeryOchkov wrote:

Now OK!


Yes.

 


Patience!

Never! 😉

 

Just was curious as to why you would need mixed interpolation method

 


Occilation!



 

Just was curious as to why you would need mixed interpolation method

 


Occilation!


Sometimes you can avoid oscillations with spline interpolation if you use lspline instead of cspline.

But of course linear interpolation avoids oscillations completely but may have other indesired effects.

Replace two operators - and no accilation!

occ.png

LucMeekes
23-Emerald III
(To:Yack_attack)

What sort of fit are you after?

Considering that a (simple) diode model is Id=Is*(exp(q*Vd/(n*k*T))-1), {Where Id = diode current, Vd = diode voltage, T=asbolute temperature, q=electron charge, k=Boltzmann constant} you have 2 parameters to play with: Is and n.

 

You say you have three datasets... Please attach them, so we can see what can be done with them.

1-1a-Prime.png

1-1-M15.png

I can send the Mathcad 15 or Prime sheets if it is useful to you!

 

This is pretty close to what I am after.

Could you please send  the mathcad file.

 

cheers

 


@Yack_attack wrote:

This is pretty close to what I am after.

Could you please send  the mathcad file.

 

cheers

 


Glad to help you - see please the attaced Mathcad 15 sheet!


@Yack_attack wrote:

Hi, I need a function


If you need a function (approximation) not interpolation read pleace

Price old car

Announcements

Top Tags