Convert x, y, z data into a z=f(x,y) function

classic Classic list List threaded Threaded
8 messages Options
Larissa Larissa
Reply | Threaded
Open this post in threaded view
|

Convert x, y, z data into a z=f(x,y) function

Hi everyone,

I conducted an experiment and thus my results are composed ofx,y,z data, whereas:
x= time (0-25days)
y= light intensity (9 different light intensities, ranging from 25 to 1000 µmol*m^-2*s^-1)
z= biomass increase acording to time and light intensity

I was able to generate a 3D graph out of this information (using both plot3d and surf),
but I can't figure out how to get an equation "z=f(x,y)" out of it. It should be possible
though, shouldn't it? If so, how?

I would be very very grateful if somebody could help me on that - I am very new in Scilab and
I am nothing close to an engineer, so you can imagine that it is quite a challenge for me...
'Till yesterday I was happy of being able to plot such nice graphs - now i want MORE!!!;-P

Thanks a lot,
Larissa
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: Convert x, y, z data into a z=f(x,y) function

Hello,

De la part de Larissa
Envoyé : mardi 25 juin 2013 09:52

> I conducted an experiment and thus my results are composed of
> x,y,z data,
[...]
> but I can't figure out how to get an equation "z=f(x,y)" out of it.

This is more a math problem than a Scilab problem.

You must have a mathematical model, i.e. a parametric formula,
then you can adjust the parameters by regression (or maximum likehood).

You may have theoretical models that derive from elementary assumptions
-- you usually find such model in the bibliography --,
or use a "nice model that fit the global shape"
-- you may ask the math laboratory in your neighbourhood,
this is usually polynomials, exponentials, statistical laws...

So if you come to us with a parametric model,
we will be able to help you.

best regards.

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

______________________________________________________________________

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
______________________________________________________________________
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Denis Crété Denis Crété
Reply | Threaded
Open this post in threaded view
|

Re: Convert x, y, z data into a z=f(x,y) function

Hello,

The general procedure for fitting data in the case of 2 variables is the following:
// First define your mathematical model by changing the following line
deff('z=MyFunction(x,y)', 'z=p(1)*x + p(2)*y + p(3)*x.*y');
// Store all experimental data in a single array ExD; X, Y, Z assumed to be 1 x NZ vectors
ExD=[X;Y;Z];
// Define the error function (to be minimized with respect to the parameters p)
deff('erro=G(p,ExD)','x=ExD(1),y=ExD(2), z=ExD(3), erro=z-MyFunction(x,y)')
// Fit experimental data contained in W
// The column vector p0 is an initial guess of the values for the parameters of your Model
[p,err]=datafit(G,ExD,p0)
// you can check values generated with
MyFunction(X,Y)

HTH
Denis

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Dang, Christophe
Envoyé : mardi 25 juin 2013 10:20
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function

Hello,

De la part de Larissa
Envoyé : mardi 25 juin 2013 09:52

> I conducted an experiment and thus my results are composed of x,y,z
> data,
[...]
> but I can't figure out how to get an equation "z=f(x,y)" out of it.

This is more a math problem than a Scilab problem.

You must have a mathematical model, i.e. a parametric formula, then you can adjust the parameters by regression (or maximum likehood).

You may have theoretical models that derive from elementary assumptions
-- you usually find such model in the bibliography --, or use a "nice model that fit the global shape"
-- you may ask the math laboratory in your neighbourhood, this is usually polynomials, exponentials, statistical laws...

So if you come to us with a parametric model, we will be able to help you.

best regards.

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

______________________________________________________________________

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
______________________________________________________________________
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Denis Crété
Larissa Larissa
Reply | Threaded
Open this post in threaded view
|

Re: Convert x, y, z data into a z=f(x,y) function

This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Mike Page Mike Page
Reply | Threaded
Open this post in threaded view
|

Re: Convert x, y, z data into a z=f(x,y) function


Hi,
 
You are asking a question which in general has no answer.  There are an infinite number of models which can fit your data.  You need to find some possible candidate model forms based on physical properties and then try fitting to them.  You are probably looking for a fit which leaves residues which are Gaussian and mean zero (but that's not always true...).
 
Try giving us a clue about where the data come from.  Maybe somebody has the physical background to suggest some models.  If not, try plotting the data and guessing a model from the shape.  To me the shape looks vaguely exponential or logarithmic, so maybe plotting as log-linear or log-log will give a clue.
 
HTH,
Mike.
 
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]On Behalf Of Larissa Schultze
Sent: 01 July 2013 09:43
To: International users mailing list for Scilab.
Subject: Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function

Hello all,
 
first of all, thanks a lot for your effort. I must say that I don't really have anyone to run to for asking about mathematical models - I could go to the mathematicians at the University, but I don't know anyone there and I barelly know where the institute is located...
 
therefore I decided to insert my simplest table in here (it is actually very simple) - may be someone here knows which kind of mathematical model I could use?
I have been searching for it in literature, but I don't seem to be in the right path...
 
So attached you will find my data table as well as the scilab commands I used to create the respective graph. I mean, my data is already interpolated...shouldn't it be easy to get a function (z,x,y) out of it?
 
I would be very very thankful for any help...I'm getting a bit desperate...
 
best regards,
Larissa
 
 
 
 
Gesendet: Dienstag, 25. Juni 2013 um 11:09 Uhr
Von: "CRETE Denis" <[hidden email]>
An: "International users mailing list for Scilab." <[hidden email]>
Betreff: Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function
Hello,

The general procedure for fitting data in the case of 2 variables is the following:
// First define your mathematical model by changing the following line
deff('z=MyFunction(x,y)', 'z=p(1)*x + p(2)*y + p(3)*x.*y');
// Store all experimental data in a single array ExD; X, Y, Z assumed to be 1 x NZ vectors
ExD=[X;Y;Z];
// Define the error function (to be minimized with respect to the parameters p)
deff('erro=G(p,ExD)','x=ExD(1),y=ExD(2), z=ExD(3), erro=z-MyFunction(x,y)')
// Fit experimental data contained in W
// The column vector p0 is an initial guess of the values for the parameters of your Model
[p,err]=datafit(G,ExD,p0)
// you can check values generated with
MyFunction(X,Y)

HTH
Denis

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Dang, Christophe
Envoyé : mardi 25 juin 2013 10:20
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function

Hello,

De la part de Larissa
Envoyé : mardi 25 juin 2013 09:52

> I conducted an experiment and thus my results are composed of x,y,z
> data,
[...]
> but I can't figure out how to get an equation "z=f(x,y)" out of it.

This is more a math problem than a Scilab problem.

You must have a mathematical model, i.e. a parametric formula, then you can adjust the parameters by regression (or maximum likehood).

You may have theoretical models that derive from elementary assumptions
-- you usually find such model in the bibliography --, or use a "nice model that fit the global shape"
-- you may ask the math laboratory in your neighbourhood, this is usually polynomials, exponentials, statistical laws...

So if you come to us with a parametric model, we will be able to help you.

best regards.

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

______________________________________________________________________

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
______________________________________________________________________
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Larissa Larissa
Reply | Threaded
Open this post in threaded view
|

Aw: Re: Convert x, y, z data into a z=f(x,y) function

Hi,
 
so regarding the data..
it was an experiment related to algal biomass yield (g/m²) ("z") according to time (0-25days, the "x"-data) and light intensity (25-1000µmol*m^-1*s^-1, the "y" values). Increase in biomass might have been exponential right at the beginning, but with increasing time I guess it turned out to be linear...
 
does anybody have a hint about the model I could use?:)
 
 
 
Gesendet: Montag, 01. Juli 2013 um 11:14 Uhr
Von: "Mike Page [via Scilab / Xcos - Mailing Lists Archives]" <[hidden email]>
An: Larissa <[hidden email]>
Betreff: Re: Convert x, y, z data into a z=f(x,y) function

Hi,
 
You are asking a question which in general has no answer.  There are an infinite number of models which can fit your data.  You need to find some possible candidate model forms based on physical properties and then try fitting to them.  You are probably looking for a fit which leaves residues which are Gaussian and mean zero (but that's not always true...).
 
Try giving us a clue about where the data come from.  Maybe somebody has the physical background to suggest some models.  If not, try plotting the data and guessing a model from the shape.  To me the shape looks vaguely exponential or logarithmic, so maybe plotting as log-linear or log-log will give a clue.
 
HTH,
Mike.
 
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]On Behalf Of Larissa Schultze
Sent: 01 July 2013 09:43
To: International users mailing list for Scilab.
Subject: Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function

 
Hello all,
 
first of all, thanks a lot for your effort. I must say that I don't really have anyone to run to for asking about mathematical models - I could go to the mathematicians at the University, but I don't know anyone there and I barelly know where the institute is located...
 
therefore I decided to insert my simplest table in here (it is actually very simple) - may be someone here knows which kind of mathematical model I could use?
I have been searching for it in literature, but I don't seem to be in the right path...
 
So attached you will find my data table as well as the scilab commands I used to create the respective graph. I mean, my data is already interpolated...shouldn't it be easy to get a function (z,x,y) out of it?
 
I would be very very thankful for any help...I'm getting a bit desperate...
 
best regards,
Larissa
 
 
 
 
Gesendet: Dienstag, 25. Juni 2013 um 11:09 Uhr
Von: "CRETE Denis" <[hidden email]>
An: "International users mailing list for Scilab." <[hidden email]>
Betreff: Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function
Hello,

The general procedure for fitting data in the case of 2 variables is the following:
// First define your mathematical model by changing the following line
deff('z=MyFunction(x,y)', 'z=p(1)*x + p(2)*y + p(3)*x.*y');
// Store all experimental data in a single array ExD; X, Y, Z assumed to be 1 x NZ vectors
ExD=[X;Y;Z];
// Define the error function (to be minimized with respect to the parameters p)
deff('erro=G(p,ExD)','x=ExD(1),y=ExD(2), z=ExD(3), erro=z-MyFunction(x,y)')
// Fit experimental data contained in W
// The column vector p0 is an initial guess of the values for the parameters of your Model
[p,err]=datafit(G,ExD,p0)
// you can check values generated with
MyFunction(X,Y)

HTH
Denis

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Dang, Christophe
Envoyé : mardi 25 juin 2013 10:20
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function

Hello,

De la part de Larissa
Envoyé : mardi 25 juin 2013 09:52

> I conducted an experiment and thus my results are composed of x,y,z
> data,
[...]
> but I can't figure out how to get an equation "z=f(x,y)" out of it.

This is more a math problem than a Scilab problem.

You must have a mathematical model, i.e. a parametric formula, then you can adjust the parameters by regression (or maximum likehood).

You may have theoretical models that derive from elementary assumptions
-- you usually find such model in the bibliography --, or use a "nice model that fit the global shape"
-- you may ask the math laboratory in your neighbourhood, this is usually polynomials, exponentials, statistical laws...

So if you come to us with a parametric model, we will be able to help you.

best regards.

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

______________________________________________________________________

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
______________________________________________________________________
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

 
If you reply to this email, your message will be added to the discussion below:
http://mailinglists.scilab.org/Convert-x-y-z-data-into-a-z-f-x-y-function-tp4026897p4026925.html
To unsubscribe from Convert x, y, z data into a z=f(x,y) function, click here.
NAML
Michael J. McCann-2 Michael J. McCann-2
Reply | Threaded
Open this post in threaded view
|

Re: Convert x, y, z data into a z=f(x,y) function

Larisssa,
Now we have a clue. Many years ago I worked on dynamic system models of fermentation. What I did was to create a differential equation set to account for the identifiable "species" --- abstract idea which includes various bio-chemical generic classes -- and running those models and experimenting it became possible to get a working model, by choosing parameters.  When that reached its limit, moving on to more complex models enabled us (me and a micologist) to create a model good enough to predict the performance of an industrial process.
    In your case I'd start with a very simple model, and I'd expect that since the growth rate in biomass would initially probably increase in proportion to the mass present the model would give an exponential initial rate, then as the algae blocked the light it wanted and the other key food sources (dissolved oxygen?) were depleted, the rate would decline. In the work I did in the past we got into the metabolic pathways and  energy balances with heat and synthesis reaction rates, but I'd start with something simpler in your case to see how simple a model would explain the process. I would be a good candidate for a model in Xcos. You can look into my website
    http://www.mccannscience.com/fermenta.htm
if you are interested.
Mike
=======================
On 01/07/2013 09:24, Larissa wrote:
Hi,
 
so regarding the data..
it was an experiment related to algal biomass yield (g/m²) ("z") according to time (0-25days, the "x"-data) and light intensity (25-1000µmol*m^-1*s^-1, the "y" values). Increase in biomass might have been exponential right at the beginning, but with increasing time I guess it turned out to be linear...
 
does anybody have a hint about the model I could use?:)
 
 
 
Gesendet: Montag, 01. Juli 2013 um 11:14 Uhr
Von: "Mike Page [via Scilab / Xcos - Mailing Lists Archives]" <[hidden email]>
An: Larissa <[hidden email]>
Betreff: Re: Convert x, y, z data into a z=f(x,y) function

Hi,
 
You are asking a question which in general has no answer.  There are an infinite number of models which can fit your data.  You need to find some possible candidate model forms based on physical properties and then try fitting to them.  You are probably looking for a fit which leaves residues which are Gaussian and mean zero (but that's not always true...).
 
Try giving us a clue about where the data come from.  Maybe somebody has the physical background to suggest some models.  If not, try plotting the data and guessing a model from the shape.  To me the shape looks vaguely exponential or logarithmic, so maybe plotting as log-linear or log-log will give a clue.
 
HTH,
Mike.
 
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]On Behalf Of Larissa Schultze
Sent: 01 July 2013 09:43
To: International users mailing list for Scilab.
Subject: Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function

 
Hello all,
 
first of all, thanks a lot for your effort. I must say that I don't really have anyone to run to for asking about mathematical models - I could go to the mathematicians at the University, but I don't know anyone there and I barelly know where the institute is located...
 
therefore I decided to insert my simplest table in here (it is actually very simple) - may be someone here knows which kind of mathematical model I could use?
I have been searching for it in literature, but I don't seem to be in the right path...
 
So attached you will find my data table as well as the scilab commands I used to create the respective graph. I mean, my data is already interpolated...shouldn't it be easy to get a function (z,x,y) out of it?
 
I would be very very thankful for any help...I'm getting a bit desperate...
 
best regards,
Larissa
 
 
 
 
Gesendet: Dienstag, 25. Juni 2013 um 11:09 Uhr
Von: "CRETE Denis" <[hidden email]>
An: "International users mailing list for Scilab." <[hidden email]>
Betreff: Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function
Hello,

The general procedure for fitting data in the case of 2 variables is the following:
// First define your mathematical model by changing the following line
deff('z=MyFunction(x,y)', 'z=p(1)*x + p(2)*y + p(3)*x.*y');
// Store all experimental data in a single array ExD; X, Y, Z assumed to be 1 x NZ vectors
ExD=[X;Y;Z];
// Define the error function (to be minimized with respect to the parameters p)
deff('erro=G(p,ExD)','x=ExD(1),y=ExD(2), z=ExD(3), erro=z-MyFunction(x,y)')
// Fit experimental data contained in W
// The column vector p0 is an initial guess of the values for the parameters of your Model
[p,err]=datafit(G,ExD,p0)
// you can check values generated with
MyFunction(X,Y)

HTH
Denis

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Dang, Christophe
Envoyé : mardi 25 juin 2013 10:20
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Convert x, y, z data into a z=f(x,y) function

Hello,

De la part de Larissa
Envoyé : mardi 25 juin 2013 09:52

> I conducted an experiment and thus my results are composed of x,y,z
> data,
[...]
> but I can't figure out how to get an equation "z=f(x,y)" out of it.

This is more a math problem than a Scilab problem.

You must have a mathematical model, i.e. a parametric formula, then you can adjust the parameters by regression (or maximum likehood).

You may have theoretical models that derive from elementary assumptions
-- you usually find such model in the bibliography --, or use a "nice model that fit the global shape"
-- you may ask the math laboratory in your neighbourhood, this is usually polynomials, exponentials, statistical laws...

So if you come to us with a parametric model, we will be able to help you.

best regards.

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

______________________________________________________________________

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
______________________________________________________________________
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

 
If you reply to this email, your message will be added to the discussion below:
http://mailinglists.scilab.org/Convert-x-y-z-data-into-a-z-f-x-y-function-tp4026897p4026925.html
To unsubscribe from Convert x, y, z data into a z=f(x,y) function, click here.
NAML


View this message in context: Aw: Re: Convert x, y, z data into a z=f(x,y) function
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: Convert x, y, z data into a z=f(x,y) function

De la part de Michael J. McCann
Envoyé : lundi 1 juillet 2013 13:01

> Many years ago I worked on dynamic system models of fermentation.
> What I did was to create a differential equation set to account for
> the identifiable "species"

I agree this would be a good way, which gives you a model that has
sense.

If we make a simple z = f(x) (biomass = f(time)) plot (see attached
document), we can see that

1 - the curves do not follow a simple analytic function

2 - they are not completely parallel, especially for the last points

so, hard to fit with usual simple function.

Now, maybe a non-parametric analysis
-- i.e. not looking for a function but only for some characteristics of
your data --
is enough for you?

Maybe what you're looking for can be extracted from the initial slope,
the height of the first plateau, ..?

In fact, you try to answer a question, but we dont't know the
question...

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

______________________________________________________________________

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
______________________________________________________________________
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

biomass_vs_time.png (19K) Download Attachment