# Search results

1. ### Engineering Modelling a DC Motor

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...

anyone?
3. ### FFT in MATLAB help

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...
4. ### C/++/# Sudoku Solver in C++

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...
5. ### C/++/# Sudoku Solver in C++

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"...
6. ### Determine where a complex function is analytic

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) =...
7. ### Gauss' Law, Spherical Charge Distribution

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...
8. ### Cockroft Walton Voltage Multiplier Problems

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...
9. ### Curl of a vector field

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...
10. ### Curl of a vector field

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...
11. ### Curl of a vector field

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...
12. ### Curl of a vector field

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...
13. ### Curl of a vector field

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...
14. ### Curl of a vector field

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
15. ### Curl of a vector field

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)...
16. ### Insulating bare wire

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...
17. ### Optimization of C code: smoothing an image.

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[];? Or would I even have to do that? Could I just use src[]? Or...
18. ### Optimization of C code: smoothing an image.

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...
19. ### Optimization of C code: smoothing an image.

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)...
20. ### Optimization of C code: smoothing an image.

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...
21. ### Optimization of C code: smoothing an image.

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) {...
22. ### Optimization of C code: smoothing an image.

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?
23. ### Optimization of C code: smoothing an image.

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...
24. ### Optimization of C code: smoothing an image.

ERROR: Dimension=96, 282 errors E.g., You have dst.{red,green,blue} = {28763,43398,44112} It should be dst.{red,green,blue} = {23151,37441,41242} Benchmark "smooth() function" failed correctness check for dimension 96. We're using a makefile that runs through the...
25. ### Optimization of C code: smoothing an image.

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...
26. ### Optimization of C code: smoothing an image.

Honestly, that was just me trying to get rid of the error. My original code had sum = &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...
27. ### Optimization of C code: smoothing an image.

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 ...
28. ### Transfer Functions

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...
29. ### Voltage drop and current for each resistor

So the members here don't do your homework
30. ### Voltage drop and current for each resistor

Err, fallen186, you may want to read https://www.physicsforums.com/showthread.php?t=5374" over real quick. Specifically this line: