This is not homework but I would consider it to fall in this category. I am working on a robotics project and wanted to simulate a PID controller before implementation. I need to find a transfer function for my motor for this to work.
Homework Statement
As mentioned above, I need to find...
Homework Statement
Find the Fourier Transform of a unity amplitude rectangular pulse of width 2T, where T=[ims]. Use MATLAB to plot the magnitude response of this signal's FT.
Homework Equations
The Attempt at a Solution
I got something that LOOKS right, but the first...
Yeah, I had actually thought about using recursion and may still do so. It's been a few years since I had any formal programming class (an Intro to C class my freshman year of college) so I'd just need to read some stuff to refresh my memory. Seems like the safest route to go.
I actually...
Hey everyone, I'm trying to teach myself C++ and I recalled that a few years ago my Comp Sci major buddy of mine did a sudoku solving program as a project for a class so I decided to tackle it on my own. I'm getting some headway, but I'm having trouble figuring out a way to "brute force"...
Homework Statement
Determine the region of analyticity of ln|z| + i*arg(z) and justify your answer.
Homework Equations
The Attempt at a Solution
I said that if z=x+iy, the function has a singularity when both x and y are equal to 0 since ln(0) is undefined and arg(z) = arg(x+iy) =...
Before I get into the question I'd just like to state that this is not homework, but questions in my book that I'm going through to prepare myself for the midterm in one week. I got stuck at a few questions, here's the first one. I won't ask the next until I'm done with this and so forth...
Hey everyone.
So I like to have electronics projects going on to keep me on my toes during the academic year and my project I chose for fall ended up being a Cockroft Walton Generator. Basically, I was just looking to make a simple negative ion generator from it. I finally got the parts in...
Yeahh... It's late (3am here) and I have an 8am class not to mention I've been doing other homework on top of this. I'm really sorry that it's tough for me to type correctly, I should've double checked that second one I posted (or, even better, been more clear in my opening post). The last one...
Yeah, I see that I didn't take that into account.
There I'm using x=2 since the line goes from (2,2) down to (2,1) and so x is constant at 2.
Why not though? If the triangle has a line going from (1,1) to (2,1); (2,1) to (2,2) and (1,1) to (2,2) which is the hypotenuse, how is the point...
I re-did part a based on your recommendation (though I didn't see any benefit in parameterizing the curve, am I missing something?)
Here's what I got:
Integral I worked off of:
\int 3x^{2}y^{2}dx - \int x^{3}y^{2}dy
Leg 1 (from (1,1) to (2,1))
\int_{1}^{2}3x^{2}dx = 7
Leg 2 (from (1,1) to...
Yeah, clockwise. And I have limits from 1 to 2 on both (I should've specified that the triangle legs go from (1,1) to (1,2) and (1,1) to (2,1). Sorry 'bout that.
Now my integral I have for part b is \int_{1}^{2} \int_{1}^{2} (-3x^{2}y^{2} - 6x^{2}y)dxdy
I'm assuming this is incorrect as...
Yeah, I tried doing everything in Latex but it was giving me errors were there shouldn't have been. It was very odd. As for that 2 and 3 thing- the 2 is a typo. The correct equation is A = ax(3x^2y^2) - ay(x^3y^2), my apologies.
In part A- that's what I wasn't sure about. I wasn't sure if I...
I done screwed up. Part b the cross product I did was wrong, stupid mistake. It should be the double integral of -3x^2y^2-6x^2y dxdy from 1 to 2 on both integrals which equals -112/3
Homework Statement
Assume the vector function A = ax(3x^{2}2y^{2})-ax(x^{3}y^{2})
a) Find \ointA\cdotdl around the triangular contour shown in Fig. 2-36 [it is a triangle with base and height of one on the x and y axis. the curl travels so that the normal vector is in the -z direction]
b)...
Hey guys, I'm working on a little project and I need to build an inductor. Now the problem is I have bare copper wire (like, a ton of it) and was hoping there was a way that I could insulate it so I could use it like typical magnet wire? Is it possible for me to just use a spray-enamel? I...
Thank you mark, that is very clear! Now if I wanted to define a pointer to, say, the first column of src (assuming the first dimension is a row and the second is a column) would I say something like pixel *pointer = src[][0];? Or would I even have to do that? Could I just use src[][0]? Or...
When I do that I still get
error: array type has incomplete element type
I tried putting dim in the array while leaving off the 'struct' part and still get the error.
EDIT- I got an email from my prof saying I can't change the structure of smooth so the variables have to be as follows:
void...
So I started from scratch and rethought the whole process and thought I had something that would work well but I'm confused on a few things.
1) I'm getting weird compiler errors that I can't seem to fix
2) It still runs, but the speed up is only 1.2 and it should be much higher (I think)...
It might be worth mentioning, I'm an Electrical Engineering major and this is an Electrical Engineering class. This class is a basic class to understand the point where software meets hardware (but we focus more on the software side. Computer Architecture focuses on hardware). That may...
Ok, gotcha, thanks!
I stumbled across this code which runs 4.3x faster (though I don't want to use it because 1) that's cheating and 2) I've put in so much work already that I don't want it all to be for nothing):
static inline void add_pixel_2(pixel_sum *sum, pixel *a, pixel *b) {...
Wow, can't believe I missed that! Thanks, it runs now!
Only an average speed up of 1.2x though and I need 3.5x. Now what's this inline thing? I've never used it and certainly do not recall learning it in class. Does it align values in the cache or something?
I'm not entirely sure what an edge effect error is, but if I were to wager a guess I'd say it has to do with the pixels on the edges of the picture getting skewed because it's trying to smooth them in with pixels that don't exist (outside the picture)? What steps could I take to fix that...
ERROR: Dimension=96, 282 errors
E.g.,
You have dst[95][93].{red,green,blue} = {28763,43398,44112}
It should be dst[95][93].{red,green,blue} = {23151,37441,41242}
Benchmark "smooth() function" failed correctness check for dimension 96.
We're using a makefile that runs through the...
Cool, thanks Mark! I figured out why I was getting those errors and I now have fixed them. However, now when I run the code I get an error when dim=96. Obviously there is something wrong with my code so I'll start walking through it to make sure it's doing the same thing as naive_smooth. If...
Honestly, that was just me trying to get rid of the error. My original code had
sum = ∑ There is no good reason I recast it, but I figured it was worth a shot :rolleyes:
Also, I talked to my professor briefly and he pointed out that there were a lot of areas where i was confusing...
Homework Statement
I need to optimize this given code:
/* A struct used to compute averaged pixel value */
typedef struct {
int red;
int green;
int blue;
int num;
} pixel_sum;
/* Compute min and max of two integers, respectively */
static int min(int a, int b) { return (a < b ...
Homework Statement
Determine the transfer function for the circuit shown in figure 5 if the output voltage is defined as the voltage drop across the 20\Omega resistor. Note there are two sources in this circuit.
Homework Equations
H(s) = \frac{Vo}{Vi}
The Attempt at a Solution...