[Scilab-users] Simulation of static general equilbiirum model

Eric Dubois grocer.toolbox at gmail.com
Sun Sep 28 16:25:28 CEST 2014


Hi

The function does not seem to match the problem you exposed. For instance,
I Would have written:
resid(2)=param(7)-1/(A*(param(2)/param(1))*(alpha/(1-alpha)))^(alpha)

You can simply check that your function si 0 at the solution you calculated
manually:
Solve_m(solution)

I this is not 0 (or very small numbers), then either the function does not
replicate your problem and you must cahnge it until it is the case or your
solution is wrong.

I this is 0, come back to me.

Éric.


2014-09-28 15:56 GMT+02:00 Mathseco <rashmi.19 at gmail.com>:

> @Eric : Thank you so much ...my function works as you told..Sorry i ask so
> many ques as i'm just a beginner in scilab ...i'll be highly grateful if
> you
> could help me in one more ques....This is the function which i have written
> :
> clear;
> function resid=Solve_m(param)
>
> resid(1)=param(5)-(1/((A*((param(2)/param(1))*(alpha/(1-alpha))))^(alpha-1)));
> resid(2)=(param(7)*A*(((param(2)/param(1))*(alpha/(1-alpha)))^alpha))-1;
> resid(3)=(param(8)*B*(((param(2)/param(1))*(beeta/(1-beeta)))^beeta))-1;
> resid(4)=(param(6)*B*(((param(2)/param(1))*(beeta/(1-beeta)))^beeta))-1;
> resid(5)=((param(5)*param(1))+(param(7)*param(2)))-Px;
> resid(6)=((param(6)*param(1))+(param(8)*param(2)))-(Py*(1+t));
> resid(7)=((param(5)*param(3))+(param(6)*param(4)))-L;
> resid(8)=((param(7)*param(3))+(param(8)*param(4)))-S;
> endfunction
>
> //constants
> A=10;
> B=10;
> t=0.2;
> Px=1;
> Py=1;
> alpha=0.3;
> beeta=0.1;
> L=500;
> S=200;
>
> sol=fsolve([1,10,1280,1200,0.2,0.06,0.1,0.09],Solve_m);
> w=sol(1);
> ws=sol(2);
> X=sol(3);
> Y=sol(4);
> alx=sol(5);
> aly=sol(6);
> asx=sol(7);
> asy=sol(8);
>
> I have calculated the same values manually just to check whether what i'm
> doing through scilab is correct or not because i need to use this for more
> complicated models. But unfortunately, my manual calculated values  and the
> one i got through above function is not coming same...Could you help wht
> can
> be the reason? (I have double check the calculated manual values) , Thanks
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Simulation-of-static-general-equilbiirum-model-tp4031213p4031225.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140928/15a0352a/attachment.htm>


More information about the users mailing list