Plotting a Curve in Polar Coordinates Using MATLAB

Click For Summary

Discussion Overview

The discussion revolves around plotting a curve defined in polar coordinates using MATLAB. Participants explore parameterization, MATLAB syntax, and integration related to the curve, specifically focusing on the Archimedes spiral.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • One participant presents a parameterization of the curve in polar coordinates as x(t) = r*cos(theta) and y(t) = r*sin(theta), with theta ranging from 0 to 2pi.
  • Another participant suggests correcting the MATLAB syntax from "2pi" to "2*pi".
  • A participant describes their attempt to plot the Archimedes spiral using symbolic variables in MATLAB, expressing confusion about the plotting process.
  • One participant provides a formula for the element of arc length along the curve, ds = √(dr² + r² dθ²), indicating it could aid in integration.
  • Another participant mentions they can compute line integrals by hand but struggles with MATLAB usage.
  • A suggestion is made to evaluate the integral ∫(0 to 2π) √(1 + θ²) dθ, with a hint to look for a corresponding MATLAB command.
  • A participant expresses gratitude for the assistance and indicates they have resolved their issues with the plotting.

Areas of Agreement / Disagreement

Participants generally agree on the mathematical concepts involved but express varying levels of understanding regarding MATLAB implementation. The discussion remains unresolved regarding the best approach to plotting in MATLAB.

Contextual Notes

Some assumptions about MATLAB syntax and functionality are not explicitly stated. There are unresolved steps in the integration process and how to effectively plot the curve.

Who May Find This Useful

Individuals interested in using MATLAB for plotting polar coordinates, as well as those studying line integrals and arc length in polar systems.

morry
Messages
136
Reaction score
0
Ok, so I've been given a curve in polar coordinates.

I came up with a parameterisation:
x(t)=rcos(theta)
y(t)=rsin(theta)

But now I have to plot the graph using MATLAB and I have no idea. Theta lies between 0 and 2pi.

This is what I put in and got back in matlab:
>> t=[0:pi/50:2pi]
? t=[0:pi/50:2pi]
|
Error: Missing MATLAB operator.

Cheers.
 
Physics news on Phys.org
Should that be 2*pi?
 
Thanks Tide. I must still be doing something wrong.

The graph is archimedes spiral. r= theta

Heres what I've tried to do:

>>syms x y r theta
>>x=r*cos(theta)
>>y=r*sin(theta)
>>ezpolar(x,y)

I only need to plot from theta= 0-->2pi

Im really lost.

Any info on how to do line integrals would also be appreciated.

Thanks again.
 
You need to find the element of arc length along the curve. This should help:

ds = \sqrt {dr^2 + r^2 d\theta^2}

which you can easily integrate.
 
Thanks Tide. I am not having trouble doing the maths by hand. I can find line integrals no worries by hand its just that I have no idea how to use matlab.
 
morry,

Since r = \theta you just need to evaluate the integral

\int_{0}^{2\pi} \sqrt{1+\theta^2} d\theta

so look for a MatLab command resembling "int(sqrt(1+x^2), x = 0..2pi)"
 
Thanks for the help again Tide, I think I've got it all out! Finally!
 

Similar threads

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