odyseus
Advanced Member level 4
- Joined
- Dec 31, 1999
- Messages
- 115
- Helped
- 6
- Reputation
- 12
- Reaction score
- 4
- Trophy points
- 1,298
- Location
- Cold & Wet Europe!
- Activity points
- 1,216
Hi all,
I want to optimise a matching circuit to achieve mag 0.5 angle -97deg.
I am having problems trying to get a cost function..I tried this..
Mag = mag(s(1,1))
Ang = Ang_deg(s(1,1)
AngCost = Angle+97 so if the simulated angle is -97, AngCost =0
MagCost = mag(s(1,1))-0.5 so if simulated angle is 0.5, MagCost =0
I combine these two to give
CostFunc = AngCost+MagCost
In the optimisation block I set CostFunc goal = 0, weight 1 (I of course set the simulation frequency).
This should work as if simulated mag=0.5 and ang =-97 then both cost functions would equal 0 and so would CostFunc in the optimisation block?? But it seems it doesn't really optimise??
Is there a better way that works?
Cheers
Ody
I want to optimise a matching circuit to achieve mag 0.5 angle -97deg.
I am having problems trying to get a cost function..I tried this..
Mag = mag(s(1,1))
Ang = Ang_deg(s(1,1)
AngCost = Angle+97 so if the simulated angle is -97, AngCost =0
MagCost = mag(s(1,1))-0.5 so if simulated angle is 0.5, MagCost =0
I combine these two to give
CostFunc = AngCost+MagCost
In the optimisation block I set CostFunc goal = 0, weight 1 (I of course set the simulation frequency).
This should work as if simulated mag=0.5 and ang =-97 then both cost functions would equal 0 and so would CostFunc in the optimisation block?? But it seems it doesn't really optimise??
Is there a better way that works?
Cheers
Ody