TRENDING NEWS

POPULAR NEWS

There Is No Grid Control In C

Can anyone help me with a computer science program?

Umm...Here it goes...

public void magic(int a[][])
{
int r = a.length-1;
int c = a[0].length-1;
int ois =0;
int fd =0;
int bd =0;
int sr =0;
int sc =0;
int pts =0;
for(int q =0;q{
fd=fd+a[q][q];
}
ois = fd;
for(int t=0;t{
for(int w=c;w>0;w--)
{
bd=bd+a[t][w];
}
for(int i=0;i{
sr=0;
for(int j =0;j{
sr=sr+a[i][j];
}
if(sr==ois)
{
pts++;
}
}
for(int u=0;u{
sc=0;
for(int y=0;y{
sc=sc+a[u][y];
}
if(sc==ois)
{
pts++;
}
}
if((bd!=ois)||(fd!=ois))
{
System.out.println("Not a magic square");
System.exit(0);
}
if((sc!=ois)||(sr!=ois))
{
System.out.println("Not a magic square");
System.exit(0);
}
if((pts==(r+c))&&(fd==bd)&&(bd==ois))
{
if(fd==ois)
{
if(bd==fd)
{
System.out.println("It is a magic square!");
System.exit(0);
}
}
}
}
}

Can we convert a grid tied solar inverter for off grid application, if yes then how?

Simple answer No. Grid tied inverter require a voltage/frequency reference which is provided by the Grid/Diesel Gen etc. In off Grid application you don’t have any Grid reference hence Grid inverter will not even start.Lets call Offgrid inverter as grid forming inverter, if you have grid forming inverter then you can connect Grid tied inverter to it and then both inverters will work. As soon as the battery of grid forming inverter drains it will shut down and grid tied inverter will loose its referenceI hope it helps

In power grid management, why does the frequency drop if load is greater than generation and vice versa?

To a non-technical person my explanation will be as given below:Let us assume for simplicity that the losses are negligible and that the load is insensitive to small frequency changes . At a given time, say, t=0, the load is 100 MW and hence the total generation, ( input) is also 100 MW and the system is in equilibrium.So you have, input = output ----> 100 MW = 100 MWThe loads coming on the system is not under the control of the grid operators. So let us say that an additional load of 10 MW is suddenly applied to the system at t=to (>0) with the same input, and you find that the additional load IS also SUPPLIED by the GRID, without any delay !!!Now the equilibrium equation is: 100 MW = 110 MW !!! , which is just impossible.But the energy IS supplied without any increase in the input, so where from ?The answer is that the stored kinetic energy of the machines supply this extra 10 MW for a few seconds. Kinetic energy is proportional to the square of the speed. So speed will reduce as kinetic energy is reduced ( taken away ). As the speed is slightly reduced frequency will reduce as frequency is proportional to speed. This then is the required explanation.After a few seconds the GOVERNOR of the turbine detects the reduction in speed and opens the steam valve ( in a thermal station) and eventually input will be adjusted to 110 MW, so you have 110 MW = 110 MW, and after some time even the frequency is adjusted to its nominal value. Such changes keep occurring all the time in a grid. Hope this rough explanation helps you,

If the power grid went down and the government loses control, what would happen next?

Ok, looking at the comment that you put below. The government would likely attempt to retake back control. The power grid does not control everything. There are shielded back-ups for almost everything. Its likely that the government will calm the people down, by force if required, declaring martial law. All police who can be contacted will be contacted and ordered to suppress the riots. Millions of civilians will react differently. Some will simply go home and begin to stock up to survive. Some will become part of the rioters you mentioned. Some will take fight ti leave the city to hopefully seek out less chaotic areas elsewhere. Sooner or later order will be restored. Black markets pop up. People begin to barter with whatever they have. Roving gangs might form, but will soon fall under the weight of government forces. Speaking of government forces, the army will also be put on high alert. Its very unlikely that any hacker group can launch such a powerful EMP without government backing. Invasion is likely as clashes with foreign invaders capitalizing on events occur. Foreign aid will pour in as allies send in help, from medical supplies to manpower to maintain order to troops to help repulse invasion.

Can you solve this route cipher for me?

First, I apologize for the periods as spacing control in this text format is not great, so the examples below will be a little sloppy.

A Route Cipher, as you might have figured out by your instructions, is a cipher where the text provided is placed into a pattern, usually a grid, and then read in an unusual pattern or direction. For example:

THIS IS A CIPHER TEXT could be written as:

A C I P H E
S T X E T R
I .S I .H T _

And then read in a spiral pattern, clockwise, starting at the bottom right. To decode your message using your instructions, I laid the letters in a 6 x 6 grid, including the spaces, since, including the spaces, there are 36 total characters in your message (6x6=36).

That gives us:

A ..M ..W ...F ....D . ...L
H .._ ...._ ....I .....E .....L
A ..T ....U ..._ ....K .....E
H ..N ....O ..E ....S. ....D
_ ...A ...Y ...M ....A ....E
E ..W . ._ ..._ ....._ ....C

This immediately produces some obvious results, as the keyword you offered - "want" - already appears in the second column, bottom-up. The first word on the left makes no immediate sense, and the first word on the right seems incomprehensible at first glance, but using the middle characters in a bottom-to-top first, left-to-right second pattern, we get:

ASKED_ME_IF_YOU_WWANT_ME

If I, as an outsider, assume that this is a personal message, and that "Cedell" is the name of a mutual friend; and if I further assume that the extra "w" in "wwant" is a simple coding error on the part of the author, then the message becomes:

"Cedell asked me if you want me haha!" Not really too "inappropriate," but obviously a personal communique.

You must have some interesting friends if they swap messages in code! 8^D

Thanks for the fun!

Electrolux refrigerator ERB 9048 - freezer problems?

A few days my fridge started acting strange - i notice that the fridge temp was lower than usual..
Normally it was about -18°C, but now it was just -7°C..
I figured that perhaps ice formation might be causing this so I plugged it from the grid to let it melt..
After it was ice-free i plugged it back in... Temperature dropped to -2°C and stayed there...
Over the course of the last few days it has risen up to +4°C.....
What's ridiculous is that the upper part of my fridge (not the freezer) is working normally - temperature near 0°C...

The temperature control thingy - i can turn it in whatever direction i want - to min; to max - no difference..
Also - the temperature display is flashing - from showing me the freezer temperature to a 2 letter acronym - "AL" - perhaps an error code of some sort?

What could be the problem?
How do i fix it?

Can anyone help me in my assignment in C++?

here's the task:

(Turtle Graphics) The Logo Language, which is particularly popular among personal computer users, made the concept of turtle graphics famous. Imagine a mechanical turtle that walks around the room under the control of a C++ program. The turtle holds a pen in one of two positions up or down. While the pen is down, the turtle trace out shapes as it moves; while the pen is up, the turtle moves about freely without writing anything . In this problem you will simulate the operation of the turtle and create a computerized sketchpad as well.

Use a 20-by-20 array floor that is initialized to zeros. Read commands from an array that contains them. Keep track of the current position of the turtle at all times and whether the pen is currently up or down. Assume that the turtle always starts as position 0,0 of the floor with its pen up. The set of turtle commands your program must process are shown in FIG 4.29.

Suppose that the turtle is somewhere near the center of the floor. The following "program" would draw and print a 12 by 12 square and end with the pen in the up position.

FIG. 4.29 Turtle graphics commands. Command Meaning
1 Pen up
2 Pen down
3 Turn right
4 Turn left
5 , n Move forward n spaces
6 Print 20-by-20 array
9 End of data (sentinel)

2

5 , 12

3

5 , 12

3

5 , 12

3

5 , 12

1

6

9

As the turtle moves with the pen down, set the appropriate element of the array floor to 1's. When the 6 command (print) is given, wherever there is a 1 in the array, display an asterisk or some other character you choose. Wherever there is a zero, display a blank. Write a program to implement the turtle graphics capabilities discussed here. Write several turtle graphics programs to draw interesting shapes. Add other commands to increase the power of your turtle graphics language.


i can't figure out how to create and execute this program. pls help... thank you...

TRENDING NEWS