(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

6.3.b highlighted in attachment.

Have solved part a (which gives the approximant used in part b) and problem 3.8 (which gives the original function). 3.8 was definitely solved correctly. Part a could be wrong, but the solution seems OK.

a = acreage

y = yield

from 3.8 - p1,p2,c1,c2 are prices and consumption in periods 1 and 2.

2. Relevant equations

a = 0.5+0.5*Ey(f(ay)) where Ey is the expected price in terms of y and f(ay)=p1(s).

3. The attempt at a solution

%DEFINE FUNCTION FOR Part b

function [fval] = f63b(y)

fval = 0.5+0.5*Exp;

%5-POINT GAUSSIAN QUADRATURE

[y,w] = qnwlogn(20,0,0.01);

Exp = w'*p1;

fprintf('Exp'); disp(Exp)

a = broyden('f63b',s/2);

fprintf('a'); disp(a)

Gives value for expectation that is accurate, but then the following error:

??? Undefined function or variable 'Exp'.

Cannot find solution for a! Should we have 5 nodes or 20? When change to qnwlogn(5,0,0/01) get no value for Exp.

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# 5-point Gaussian Quadrature using constructed approximant in Matlab

Loading...

Similar Threads - point Gaussian Quadrature | Date |
---|---|

LaTeX Align at multiple points | Feb 2, 2017 |

Matlab How to make 2D plot of points with different colors? | Dec 13, 2016 |

Mathematica How to get data points from plot? | May 12, 2016 |

Plotting A Set of Points in Mathematica | Jun 28, 2015 |

Fitting data to a Gaussian Distribution in Excel | Jun 24, 2015 |

**Physics Forums - The Fusion of Science and Community**