Is There a Typo in Equation [43] Impacting MATLAB Results?

  • Context: MATLAB 
  • Thread starter Thread starter strokebow
  • Start date Start date
  • Tags Tags
    Mistake
Click For Summary

Discussion Overview

The discussion revolves around a potential issue with equation [43] in a MATLAB implementation, specifically whether there is a typo affecting the results obtained from the equation. Participants are examining the equation's formulation, its implementation in MATLAB, and the discrepancies in numerical results.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant reports that their MATLAB implementation of equation [43] yields incorrect results, suggesting either a mistake in their code or a possible typo in the equation itself.
  • The same participant notes that their numerical answers have been verified against published material, indicating confidence in their results despite the discrepancies.
  • Another participant expresses difficulty in understanding the original post due to the cryptic nature of the material and suggests using LaTeX for clarity.
  • A further comment criticizes the formatting of the MATLAB function, pointing out inconsistencies in parentheses and suggesting that clearer formatting would aid understanding.

Areas of Agreement / Disagreement

Participants do not reach a consensus on whether the issue lies in the MATLAB implementation or in the equation itself. There are varying levels of understanding regarding MATLAB syntax and the specifics of the equation.

Contextual Notes

Some participants express uncertainty about the variables used in the MATLAB function and the ranges of evaluation, which may contribute to the confusion surrounding the implementation.

strokebow
Messages
122
Reaction score
0
Hi guys,

Please can someone look at this working (see attached).

The equation in question is [43]. It is highlighted with a red border.

The numerical answers in the pdf are correct and have been verified against published material.

That being said, I believe there must be a problem with equation [43] as I am not getting the same answers. I don't know how the algebra was simplified etc. to get to [43].

I have inputted [43] as it is in MATLAB and get incorrect results:
Code:
function [y] = inf_res_hex_odd(x,y,m,n)
y = ((1)/(4*(pi^2)))*((3-2*cos(y).*cos(m*x+n*y)-cos((m-1)*x+n*y))./(4-cos(y).*(cos(y)+cos(x))));
end

Example:
>> real((quad2d(@(x,y)inf_res_hex_odd(x,y,1,0),-pi,pi,-pi,pi)))

ans =

0.5422

There are 2 possibilities:
1) I made a mistake in my MATLAB function, or,
2) There is a mistake/typo in [43]

If anyone can offer any help with this I would be really appreciative.

Thanks
 

Attachments

Physics news on Phys.org
No takers?

I've been staring at this bad boy for some time now... can't manage to find the problem.

any help/suggestions would be much appreciated... :-)
 
The material is too cryptic to respond to.
 
Don't expect people to look up MatLab syntax and command(s).

Type the equation in Latex so people can see it. What variables do you put in for x,y,m, and n? (I (and maybe others) don't know MatLab syntax/command(s) so don't know what the (x,y,1,0... -pi,pi,-pi,pi) stuff means, although it looks like ranges of evaluation)

In addition, your formatting was sloppy/lazy: there are more ))) on the one side of 1/4pi^2 than there are on the other. How is someone supposed to understand what you actually want?

Something like:
[tex]f(x,y,m,n)=\frac<br /> {\frac {1} {4 \times \pi^2} \times \left ( 3-2 \times \cos{y} \right)<br /> \times \cos \left( m \times x + n \times y \right ) - \cos \left ( \left (m-1 \right ) \times x + n \times y \right)}<br /> {\left ( 4-\cos{y} \right ) \times \left (\cos{y} + \cos{x} \right ) }[/tex]
 
Last edited:

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K