Differintal equation & optimalization & NukeZone que

SLAM: debunk creationism, pseudoscience, and superstitions. Discuss logic and morality.

Moderator: Alyrium Denryle

Post Reply
User avatar
SWPIGWANG
Jedi Council Member
Posts: 1693
Joined: 2002-09-24 05:00pm
Location: Commence Primary Ignorance

Differintal equation & optimalization & NukeZone que

Post by SWPIGWANG »

To quote Sun Tzu: Know thy self, Know thy enemy, one hundred battles, one hundred victories.

Ok, here is for math heads: (other ppl read below)

General Form:
Goal: Maxiumize dM/dt


M is the money earned
dM/dt is the rate where money is earned
(dM/dt)^2 is the rate of change of money making rate

(dM/dt)^2 is proptional to M by a constant

Instead of letting M, grow exponentially, I can also make M grow at dM/dt = ((dMi/dt) + 7500), but in this case (dM/dt)^2 would be zero.

I can switch between the two whenever I want.

So when would be the optimal time to switch?

There are the inital conditions for the specific problem:

(dM/dt)^2 = (dMi/dt)^2 + 12M/125000

The choice between freebies are given
Case 1.
M = 500,000
dMi/dt = 2500
(dMi/dt)^2 = 6

Case 2.
M = 120,000
dMi/dt = 3940
(dMi/dt)^2 = 12

So whats the better starting condition? And at what point should I switch from pumping out money linearly at (dMi/dt) + 7500 and when do I change to pumping though improving dM/dt? (give in dM/dt terms please, and show work)


--------------------non-math section

So you people play nukezone don't math crunch? Fools, as one who does not know oneself can not obtain victory.

By the way, AH-64 has 0.029 attack to cost ratio, and 0.029 defense to cost ratio, while X-35 has 0.049 attack to cost ratio and 0.040 defense to cost ratio. Also note that Heavy Tanks have 0.047 attack to cost ratio and 0.044 attack ratio.

Meaning: AH-64 sucks, though not as bad as rifles at 0.026 ratio for both. Specialized units like SAM, Artillery or SH-60 gets 0.074-0.076 attack to cost ratio.

Since you only has one attack for muti-role units, they suck.
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

Post by Durandal »

The optimum time to switch would be the point at which the function attains minimum growth.
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
User avatar
Seggybop
Jedi Council Member
Posts: 1954
Joined: 2002-07-20 07:09pm
Location: USA

Post by Seggybop »

Aren't you making the game like... super unfun??
my heart is a shell of depleted uranium
User avatar
SWPIGWANG
Jedi Council Member
Posts: 1693
Joined: 2002-09-24 05:00pm
Location: Commence Primary Ignorance

Post by SWPIGWANG »

The Growth of one is constant, and the other is exponential.

And when the switch occurs, the M carries over.


I play to win. Winning is fun.
User avatar
Exonerate
Sith Marauder
Posts: 4454
Joined: 2002-10-29 07:19pm
Location: DC Metro Area

Post by Exonerate »

It should be noted that a unit that can attack one type of unit deals all damage to that unit, and one that can attack 3 types spilts the offensive points up equally.

BoTM, MM, HAB, JL
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

Post by Durandal »

SWPIGWANG wrote:The Growth of one is constant, and the other is exponential.

And when the switch occurs, the M carries over.
So find the point at which the exponential growth is exceeded by the constant growth. Case 2 will give you a higher initial rate of growth with a higher rate of growth acceleration.

By the way, I haven't taken differential equations yet. :)
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
User avatar
The Dark
Emperor's Hand
Posts: 7378
Joined: 2002-10-31 10:28pm
Location: Promoting ornithological awareness

Post by The Dark »

I look not only at the cost/efficiency but also at the versatility of a unit. If I have a crapload of B-2s and get attacked, I'm screwed. Apaches may have a low attack/cost ratio, but they can hit the most common units (infantry and ground) as well as damage buildings. If I start running low on space, I might switch from F-22s and Apaches to F-22, X-35, and B-2, with extra flamethrowers to cover for the infantry loss.
Stanley Hauerwas wrote:[W]hy is it that no one is angry at the inequality of income in this country? I mean, the inequality of income is unbelievable. Unbelievable. Why isn’t that ever an issue of politics? Because you don’t live in a democracy. You live in a plutocracy. Money rules.
BattleTech for SilCore
User avatar
SWPIGWANG
Jedi Council Member
Posts: 1693
Joined: 2002-09-24 05:00pm
Location: Commence Primary Ignorance

Post by SWPIGWANG »

I've read forums of nukezone, and high tier players don't use infantry that much, because only rocket is cost effect enough to do anything, but it spilt attacks REGUARDLESS if the enemy have the said unit type, appearently. So if you attack with vehicle only army for example, the rocket would only do 1/3 damage.

Same for AH64

Also, the cost effectiveness is bloody 1/2 or less than specialized units, so it is better to have 2 specialized units.
User avatar
The Dark
Emperor's Hand
Posts: 7378
Joined: 2002-10-31 10:28pm
Location: Promoting ornithological awareness

Post by The Dark »

Yeah, I ran some figures just on offense, and came up with a new model army :wink:.

All I'm using now are SAM tanks, SH-60 Seahawks, X-35 JSFs, Humvees, and Heavy Artillery.

In order (worst to best) of dollars/point of attack:
Rifle Infantry
AH-64 Apache
F-22 Raptor :!:
Destroyer
Hover Tank
Cruiser
Rocket Soldier
Attack Boat
Heavy Tank
X-35 JSF
Submarine
F/A-18 Super Hornet
B-2 Stealth Bomber
Flamethrower
Heavy Artillery
SAM Tank
Humvee

I haven't done defense yet.
Stanley Hauerwas wrote:[W]hy is it that no one is angry at the inequality of income in this country? I mean, the inequality of income is unbelievable. Unbelievable. Why isn’t that ever an issue of politics? Because you don’t live in a democracy. You live in a plutocracy. Money rules.
BattleTech for SilCore
Malecoda
Padawan Learner
Posts: 340
Joined: 2002-11-13 03:53pm
Location: Maple Valley, WA

Post by Malecoda »

Durandal wrote:
SWPIGWANG wrote:The Growth of one is constant, and the other is exponential.

And when the switch occurs, the M carries over.
So find the point at which the exponential growth is exceeded by the constant growth. Case 2 will give you a higher initial rate of growth with a higher rate of growth acceleration.

By the way, I haven't taken differential equations yet. :)
Yes you have, you just don't know it :) Have you gone from Newtonian to Lagrangian mech yet? Just curio. I tried taking intro to Newtonian (which is after basic gravitational, electromagnetic, and optical stuff) but it was before I had vector analysis so I got kind of lost and I dropped it, then since it wasn't my major I never went back. But I had some in math, and later some Lagrangian crap, but not like a real formal class in it.
I have being given A's for depleting Dragon ball Z the way it should be.
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

Post by Durandal »

Malecoda wrote:
Durandal wrote:
SWPIGWANG wrote:The Growth of one is constant, and the other is exponential.

And when the switch occurs, the M carries over.
So find the point at which the exponential growth is exceeded by the constant growth. Case 2 will give you a higher initial rate of growth with a higher rate of growth acceleration.

By the way, I haven't taken differential equations yet. :)
Yes you have, you just don't know it :) Have you gone from Newtonian to Lagrangian mech yet? Just curio. I tried taking intro to Newtonian (which is after basic gravitational, electromagnetic, and optical stuff) but it was before I had vector analysis so I got kind of lost and I dropped it, then since it wasn't my major I never went back. But I had some in math, and later some Lagrangian crap, but not like a real formal class in it.
We did Lagrangian multipliers back in multivariable calculus, and actually, I did do a bit of differential equations in physics last semester, and we're doing a bit of them this semester in thermodynamics. Basically, the solution to every differential equation is to integrate it. :)
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
User avatar
SWPIGWANG
Jedi Council Member
Posts: 1693
Joined: 2002-09-24 05:00pm
Location: Commence Primary Ignorance

Post by SWPIGWANG »

GRRRRRRRRRRRRRRRR JUMPS UP AND DOWN.....

*Tries to solve the original equation...*

M = Ce^ct should work.... to solve the differential equation.

Intergrating both sides would be easy in single order equations, but this is second order.

However the optimalization is totally beyond me. I have no idea how to even start solving the equation.

*GRRRRR 1st year = we are bunch of idiots*

HELP HELP HELP
Malecoda
Padawan Learner
Posts: 340
Joined: 2002-11-13 03:53pm
Location: Maple Valley, WA

Post by Malecoda »

Durandal wrote:
We did Lagrangian multipliers back in multivariable calculus, and actually, I did do a bit of differential equations in physics last semester, and we're doing a bit of them this semester in thermodynamics. Basically, the solution to every differential equation is to integrate it. :)
I may have been kind of abrupt with my subject changes there. I wasn't referring to Lagrangian multipliers, although it's somewhat serendipitous that they arise in a talk abt optimization. I mean Lagrangian mechanics, where your point of reference is accelerating, not observing a moving frame from the outside but from the inside. You make the transformation from an outside observer, describe the real forces in terms of that transformation, and eliminate fictional forces. Newtonian mechanics at MTU was basically vector analysis (so you learn the linear algebra and how to make linear transformations), and a pre-req for Lagrangian mechanics.
I have being given A's for depleting Dragon ball Z the way it should be.
ClaysGhost
Jedi Knight
Posts: 613
Joined: 2002-09-13 12:41pm

Post by ClaysGhost »

SWPIGWANG wrote:GRRRRRRRRRRRRRRRR JUMPS UP AND DOWN.....

*Tries to solve the original equation...*

M = Ce^ct should work.... to solve the differential equation.

Intergrating both sides would be easy in single order equations, but this is second order.

HELP HELP HELP
Do you need to integrate? You have the correct form of solution. Differentiating it once would produce dM/dt, wouldn't it? In your original post, I'm not sure what
There are the inital conditions for the specific problem:

(dM/dt)^2 = (dMi/dt)^2 + 12M/125000
is. Can you clarify?
(3.13, 1.49, -1.01)
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

Post by Durandal »

Malecoda wrote:
Durandal wrote:
We did Lagrangian multipliers back in multivariable calculus, and actually, I did do a bit of differential equations in physics last semester, and we're doing a bit of them this semester in thermodynamics. Basically, the solution to every differential equation is to integrate it. :)
I may have been kind of abrupt with my subject changes there. I wasn't referring to Lagrangian multipliers, although it's somewhat serendipitous that they arise in a talk abt optimization. I mean Lagrangian mechanics, where your point of reference is accelerating, not observing a moving frame from the outside but from the inside. You make the transformation from an outside observer, describe the real forces in terms of that transformation, and eliminate fictional forces. Newtonian mechanics at MTU was basically vector analysis (so you learn the linear algebra and how to make linear transformations), and a pre-req for Lagrangian mechanics.
Those are the only Lagrangians I have experience with. :)
I'm actually taking linear algebra this semester.
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
Malecoda
Padawan Learner
Posts: 340
Joined: 2002-11-13 03:53pm
Location: Maple Valley, WA

Post by Malecoda »

Linear algebra is sweet. You can move mountains.
I have being given A's for depleting Dragon ball Z the way it should be.
ClaysGhost
Jedi Knight
Posts: 613
Joined: 2002-09-13 12:41pm

Post by ClaysGhost »

Ok, I think I worked out what you're on about.

M'' = M''(0) + 12M/125000
(M'' = d^2M/dt^2)

The general solution to this diff. equation will require two steps. First, you find the general solution to the "homogenous" diff. eqn that corresponds to your (inhomogenous) D.E. - this equation is got from the first by just removing any terms that do not operate on or contain M:

M'' - PM = 0

(P = 12/125000)

To solve this, you form the "auxilliary equation" by representing the differential operator d/dt with D,

(D - sqrt(P)).(D + sqrt(P)).M = 0

This particular example (two real roots, sqrt(P) and -sqrt(P)) has the corresponding general solution

M = A.exp(t*sqrt(P)) + B.exp(-t*sqrt(P))

A and B are the arbitrary constants.

To solve the original (inhomogenous) equation, there is a second step. You must find a particular integral, a function that is a solution of the inhomogenous equatiion (it will not be a unique solution)

M'' - PM = M''(0)

Often, these can be done by inspection, as in this case. Try M = K (constant) so M'' = 0,
and substitution produces

K = - M''(0) / P

The general solution for the inhomogenous equation is the sum of the particular integral you found and the complementary function,

M = A.exp(t*sqrt(P)) + B.exp(-t*sqrt(P)) - M''(0)/P

From here, all you need to do is to establish A and B. Differentiate the solution,

M' = A*sqrt(P)*exp(t*sqrt(P)) - B*sqrt(P)*exp(-t*sqrt(P))
M'' = A*P*exp(t*sqrt(P)) + B*P*exp(-t*sqrt(P))

Since your cases provide initial conditions, consider t = 0:

M(0) = A + B - M''(0)/P
M'(0) = (A - B)*sqrt(P)
M''(0) = (A + B)*P

Obviously, you have plenty of equations with which to solve for A and B. Finding these and rearranging gets me

M' = (M''(0)/sqrt(P)) * sinh[t*sqrt(P)] + M'(0)*cosh[t*sqrt(P)]

as the most compact representation. Since sinh and cosh increase monotonically with positive t, I expect that there is only one intersection with your other possibility, M' = M'(0) + 7500, and so sophisticated optimisation is unnecessary. Simply find the intersection and you can be sure that for t > t(intersection) the exponential growth option will win. The simplest way is to set M'(0) + 7500 = (M''(0)/sqrt(P))*sinh .... and solve with a simple numerical method, such as Newton-Raphson. For your first case, I find that after t = 188.3 you should switch to the exponential. For the second, after t = 149.06, you should switch. Before these times the linear option is better.
You should really get hold of a textbook on this sort of thing, as this is not a good "how to solve DEs" explanation. Boas is quite good.
(3.13, 1.49, -1.01)
User avatar
SWPIGWANG
Jedi Council Member
Posts: 1693
Joined: 2002-09-24 05:00pm
Location: Commence Primary Ignorance

Post by SWPIGWANG »

Bows

Thanks alot :)
General Trelane (Retired)
Jedi Knight
Posts: 620
Joined: 2002-07-31 05:27pm
Location: Gothos

Post by General Trelane (Retired) »

Ummm, if all you really wanted was the answer as to when to switch the earning scheme, you could have gotten an approximation by simply iterating (I would suggest using a spreadsheet so that you can just copy and paste the cells for each iteration).

But if you want to drive the calculus nail through your head, then by all means...
Time makes more converts than reason. -- Thomas Paine, Common Sense, 1776
User avatar
SWPIGWANG
Jedi Council Member
Posts: 1693
Joined: 2002-09-24 05:00pm
Location: Commence Primary Ignorance

Post by SWPIGWANG »

yeah, I can just write a program that takes me 1/2 an hour.

But it wouldn't teach me anything.

*and the thing is that I should have learned 2nd order linear eq already, but 1/2 week at the end of the term....GRRRRRRRRRRR*
Post Reply