Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We need to do a matlab script code with these requirements: Script files: - - > There will be one script file dedicated for the
We need to do a matlab script code with these requirements:
Script files:
There will be one script file dedicated for the physics of the problem. The physics needs to be solved with odecode A
There will be one script file dedicated for the cost function. This script file will call ode and calculate the cost. code B
There will be one script file dedicated for the optimization routine. code C
Therefore; code A will call code B Code B will call code C
Pyhsics of the system:
Here is a very brief description of the case and the physical system:
You are a researcher to build a test setup for a specific experiment. In this experiment you want to rotate a small spherical object immersed in a viscous fluid.
Sphere, which is immersed in silicone oil, will be rotated by a DCmotor. DCmotor is powered up with a LiPo battery.
The experiment will last till the battery is depleted.
The motor is doing work against internal friction torque and the friction torque of the liquid exerted on the sphere.
The battery is doing work against overall resistance of the system and the backemf effect.
Everything is coupled.
Expectations:
You want to achieve the fastest rotation rate but the flow must remain laminar. Reynolds number
You want to conduct the experiment as long as possible but the battery has a capacity limit
Ah x V x Joules
Therefore you face two objectives and two constraints.
There are two variables potantiometeradjustable resistance connected in series and in parallel, in the circuit to modify the current passing through the circuit. These are what you are supposed to optimize.
Therefore you have two optimization variables to play with.
Cost Function:
The cost function has two separate objectives.
Objectives might be imbalanced in magnitude; therefore, might need to be scaled to weigh equally.
The objectives could be determined with the help of the constraints andor educated guesses.
Constraints can directly be embedded in the cost functions ifwhen it makes sense.
Variables and Bounds:
The variables adjustable variables cannot be negative.
You will see that it will be most logical to assume that both cannot be equal to zero.
Variables will be embeded in the equations as in equivalent value of resistances.
initial guesses should be justifiable. The choice of very small or very large values, if used, should be explained carefully.
Further details physics modeling, geometric properties, material specific constants on the problem are available in the tiff files
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started