Arrowstar Posted February 12, 2021 Author Share Posted February 12, 2021 On 2/6/2021 at 11:31 PM, Drew Kerman said: hey @Arrowstar have a look at this LVD case file - if you delete the Kerbin III stage and close the vehicle config window the script will propagate to the max 15s. It seems to actually be the SUL-V1 x2 tank. If you delete the SUL-V1 x2 -> LV 303 connection and close the config window, it's okay. If you then delete the Restart x6 tank and close, it's okay. If you remove the LV 303 engine and close, it's okay. As soon as you delete the SUL-V1 x2 tank however the script runs off the deep end Rats, instead of deleting the problem tank after removing the engine and other tank I tried to set the mass to 0 and the script ran amok still. Even 0.0001 didn't work I think I've got this one figured out. It was an issue where the minimum thrust to weight achievable (at zero throttle) was actually greater than your target T2W ratio, causing the system to basically not know what to do. I've added a check for this case, which is in addition to the existing check for a maximum T2W being less than the target T2W. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted February 12, 2021 Share Posted February 12, 2021 24 minutes ago, Arrowstar said: I think I've got this one figured out. It was an issue where the minimum thrust to weight achievable (at zero throttle) was actually greater than your target T2W ratio, causing the system to basically not know what to do. I've added a check for this case, which is in addition to the existing check for a maximum T2W being less than the target T2W. oooohhh daamn I was thinking soo hard on how it could possibly be affecting my script when I made sure no events had anything to do with that stage but I did not think about the mass change affecting TWR. Durr. Nice catch Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 12, 2021 Author Share Posted February 12, 2021 On 2/8/2021 at 11:41 PM, Drew Kerman said: woooah @Arrowstar I'm seeing some more serious hinkyness here when messing with the Initial UT, moreso than just its effect on the Jacobian. Files download. Start with Ascension Mk3 #1 Ascent.mat, which is mostly the same file I linked to in the last post but I reset the Initial UT to 0 and changed my constraints to have it find me a 250km apokee. I also labeled the last event more appropriately since no pitch change happens just the end of the burn so the engine should be shut off, SECO-1. Okay if I optimize from this point, after about 30 iterations or so over 45-60min it gets me the result I want, which you can see in Ascension Mk3 #1 Ascent 250km.mat Now go and set the Initial UT to the day I want to launch: 139494660.0 - you should see the trajectory completely change. I was confused by this but since all I changed was the time I figured the optimizer could get me a launch time during this day that would work again. So I disabled all the event optimizations and set a hi-lo for Initial UT and let the optimizer run. You can see the results of this in Ascension Mk3 #1 Ascent 250km Time Constraint.mat Right, here's where it gets weird. Looking at the final state you can see I'm back to nailing 250km. Now change the Initial UT to 139494659.766019. The trajectory will change to reflect a final state Ap of only 108.5111km. Now change the Initial UT to 139494659.466019 and you should see the trajectory jump again back almost to normal at 249.9998km. Now change the Initial UT again to 139494658.466019. New trajectory will be back on the money at 250km. Okay one more UT change to 139494648.466019 - now it's telling me I'm going up to 810.1884km!! BTW the timing is important for this mission cause I want to launch and put my Ap direct opposite the sun so I can go high on initial climb without hitting the inner radiation belt, which is further away on the night side. This also makes me ask if the Sun Vector view option can draw the arrow through the planet and maybe have a length adjustment? Right now I'm just taking a screenshot and using Paint.NET to continue the vector through to the night side The issue here is that, for whatever reason, your integration is numerically unstable. If you check your output log, you'll see a bunch of warnings about the integrator not being able to hit the desired integration tolerances at the minimum step size. This is causing the integration to terminate early and thus you see what appears to be a different vehicle behavior. Try switching events 5, 7, and 8 to the ODE5 integrator and pick a step size (1 second is probably okay, but you can lower it to get a bit more accuracy). After I did this, I saw about 250 km of altitude at the final state consistently. (It was 245 km, but close enough.) On 2/9/2021 at 12:20 AM, Drew Kerman said: Just to confirm I'm not missing anything, I can't find a way to lock these together so that when I move one the other shows the same data point. This is not a thing Matlab can do? It's think it's possible if you're using the full version of MATLAB, but I guess it's not a feature for axes in deployed applications. There's a lot of options and features I have over here that don't show up in your figure window. I guess that's a limitation of deployed stuff. On 2/9/2021 at 12:30 AM, Drew Kerman said: minor bug - flight path angle is described in the GA output as km/s instead of degrees Typo! Resolved for next release. On 2/9/2021 at 2:49 PM, Drew Kerman said: was there a behavior change with Non-Sequential Events coloring trajectory lines or am I not remembering correctly? I made this last year: And when I went to do one for my current ascent, if I changed the line color for a non-sequential event I don't see a color change on the plot anymore. I thought the non-sequential event triggered a plot color/line type change when it occurred, and this change persisted until the next sequential or non-sequential event happened. Of course I could be remembering wrong and the above colored plot could just be a rough approximation using only sequential event color changes rather than a combo of both The only impact non-sequential events have (and have ever had) is the ability to fire off actions in the middle of a sequential event. They've never been able to change event colors, integrators, stuff like that. I should really disable all that stuff for non-sequential events, to be honest... Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted February 12, 2021 Share Posted February 12, 2021 (edited) 1 hour ago, Arrowstar said: If you check your output log Aha! But frankly what would make me do that? I've only ever treated it as an error log so when the application goes *ding* that's the first place I look but there were no indications of a problem with script execution. In fact when I read this my first thought was that it showed up in the output log in LVD itself and that I could have easily not thought to check it since it updates at the bottom usually out of sight, but it wasn't there either so I finally opened the .log file. This seems like a thing that should pop up in the Warnings & Alerts area no? Also in relation to the output log in LVD/MA - is it possible to lock its position? As in, there's a behavior for some applications where the scroll position remains constant even if stuff is appended to the bottom, but if the scroll bar is all the way to the bottom it scrolls with any addition updates 1 hour ago, Arrowstar said: Try switching events 5, 7, and 8 to the ODE5 integrator Can I get a bit more insight into your decision to switch to ODE5 and for those particular events? I recall you have the ability to see where things get hung up but I'm still wondering if there's a way I can come to this conclusion myself 1 hour ago, Arrowstar said: The only impact non-sequential events have (and have ever had) is the ability to fire off actions in the middle of a sequential event. They've never been able to change event colors, integrators, stuff like that. I should really disable all that stuff for non-sequential events, to be honest... Yea, if you can't use them I would agree they be removed or disabled. But also if they *can* modify trajectory properties like I described that would be cool too So okay then I guess I just re-worked the ascent to use all sequential events to build my colored plot. That's not really a big deal to have to do either if I must, cause like I already did heh heh Edited February 12, 2021 by Drew Kerman Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 12, 2021 Author Share Posted February 12, 2021 13 minutes ago, Drew Kerman said: Aha! But frankly what would make me do that? I've only ever treated it as an error log so when the application goes *ding* that's the first place I look but there were no indications of a problem with script execution. In fact when I read this my first thought was that it showed up in the output log in LVD itself and that I could have easily not thought to check it since it updates at the bottom usually out of sight, but it wasn't there either so I finally opened the .log file. This seems like a thing that should pop up in the Warnings & Alerts area no? You're probably right, actually. It'll take a bit of thought to figure out how to do that, because most of the errors and warnings are discovered after propagation has occurred, whereas this is something that happens more at "runtime" as it were. But yes, you're right, there should be a warning for it. Quote Also in relation to the output log in LVD/MA - is it possible to lock its position? As in, there's a behavior for some applications where the scroll position remains constant even if stuff is appended to the bottom, but if the scroll bar is all the way to the bottom it scrolls with any addition updates I'm not actually sure if it's possible to set the scroll position of the textbox directly. I'll have to look into that. Quote Can I get a bit more insight into your decision to switch to ODE5 and for those particular events? I recall you have the ability to see where things get hung up but I'm still wondering if there's a way I can come to this conclusion myself Sure. When you run into numerical stability issues, switching to a fixed step size integrator like ODE5 can go a long way towards fixing the problem. This is because adaptive step size integrators can get bogged down when the equations of motion get highly nonlinear, as they do with drag and the like. It's the part where they try to keep error small that does that. So one solution is to step away from adaptive step size integrators like ODE45 and ODE113 entirely. ODE5 always takes the same step size that you set, regardless of what the underlying error would be (it doesn't even compute it). This avoids the problem entirely and keeps things humming along. Another thing you can do is to just loosen up the absolute and (especially) relative error tolerances in ODE45 to something bigger than what is default. 1E-5 or 1E-6 is probably not a bad place to start. Bigger tolerances means that step sizes can go bigger and may allow the integrator to get through the tricky bit easier. Quote Yea, if you can't use them I would agree they be removed or disabled. But also if they *can* modify trajectory properties like I described that would be cool too So okay then I guess I just re-worked the ascent to use all sequential events to build my colored plot. That's not really a big deal to have to do either if I must, cause like I already did heh heh Since I'm using the same UI for non-sequential events, they probably can't be removed, but I can certainly just grey them out so that there's no more confusion. I'll add it to my TO DO list. Quote Link to comment Share on other sites More sharing options...
russm Posted February 12, 2021 Share Posted February 12, 2021 (edited) I've picked up KSPTOT (and KSP) again after a while away, and there's a mission plan I'm trying to do but I can't work out how to express it in MA. Any suggestions on how to do this? I'm trying to get MA to plan a Kerbin > Mun powered flybuy > Jool flight. The high-level tools (porkchop &c) give me a general Kerbin > Jool, my current problem is getting the optimiser to then find a good Kerbin departure time - this depends on a shorter timescale on the craft's position around Kerbin to get to the Mun, and on a longer timescale on the Mun's position around Kerbin to usefully help me get to Jool. I'm setting initial Kerbin departure time to the value out of Compute Departure with optimiser boundaries half a month in either direction, to try and find the best time in the Mun's orbit to do the flyby, then initially minimising distance to Jool at Sun apoapsis after a couple of next-soi coasts. But presumably the objective function has *many* local minima (finding the right point in the craft's Kerbin orbit to depart to the Mun and on to Jool throughout the month), but finding the *best* of these minima (where the Mun is optimally placed in its own orbit for this plan) isn't something I've figured out how to do. Is it even possible to get MA to deal with this? In my experimentation so far, I either get garbage plans, or occasionally the MA optimiser spends literal hours at 100% CPU without completing even a single optimisation step - I sorta assume it's just jumping between local minima and getting super confused that the objective function makes no sense at all. Edited February 12, 2021 by russm Quote Link to comment Share on other sites More sharing options...
russm Posted February 12, 2021 Share Posted February 12, 2021 presumably the right way to do this is to fix Kerbin departure on the vehicle's phase angle wrt the Mun and then have the optimised variable be the Mun's position in its orbit, but obviously that's not possible to express in MA... Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 12, 2021 Author Share Posted February 12, 2021 28 minutes ago, russm said: I've picked up KSPTOT (and KSP) again after a while away, and there's a mission plan I'm trying to do but I can't work out how to express it in MA. Any suggestions on how to do this? I'm trying to get MA to plan a Kerbin > Mun powered flybuy > Jool flight. The high-level tools (porkchop &c) give me a general Kerbin > Jool, my current problem is getting the optimiser to then find a good Kerbin departure time - this depends on a shorter timescale on the craft's position around Kerbin to get to the Mun, and on a longer timescale on the Mun's position around Kerbin to usefully help me get to Jool. I'm setting initial Kerbin departure time to the value out of Compute Departure with optimiser boundaries half a month in either direction, to try and find the best time in the Mun's orbit to do the flyby, then initially minimising distance to Jool at Sun apoapsis after a couple of next-soi coasts. But presumably the objective function has *many* local minima (finding the right point in the craft's Kerbin orbit to depart to the Mun and on to Jool throughout the month), but finding the *best* of these minima (where the Mun is optimally placed in its own orbit for this plan) isn't something I've figured out how to do. Is it even possible to get MA to deal with this? In my experimentation so far, I either get garbage plans, or occasionally the MA optimiser spends literal hours at 100% CPU without completing even a single optimisation step - I sorta assume it's just jumping between local minima and getting super confused that the objective function makes no sense at all. The solution is to do this in LVD and not MA. I have done something very similar actually and it's already available as an example. Check out the LVD example "lvdExample_BackPropagationExToDunaViaMun.mat" that ships with the KSPTOT download package. It shows you how to set something like this up using patch points and continuity constraints. Let me know if you have any questions. 12 hours ago, Drew Kerman said: Aha! But frankly what would make me do that? I've only ever treated it as an error log so when the application goes *ding* that's the first place I look but there were no indications of a problem with script execution. In fact when I read this my first thought was that it showed up in the output log in LVD itself and that I could have easily not thought to check it since it updates at the bottom usually out of sight, but it wasn't there either so I finally opened the .log file. This seems like a thing that should pop up in the Warnings & Alerts area no? Yea, if you can't use them I would agree they be removed or disabled. But also if they *can* modify trajectory properties like I described that would be cool too So okay then I guess I just re-worked the ascent to use all sequential events to build my colored plot. That's not really a big deal to have to do either if I must, cause like I already did heh heh Both of these have been added for next release. In particular, when integration gets unstable, you'll now see a red error message in that area of the UI that suggests what to do. Quote Link to comment Share on other sites More sharing options...
russm Posted February 12, 2021 Share Posted February 12, 2021 23 minutes ago, Arrowstar said: The solution is to do this in LVD and not MA. I have done something very similar actually and it's already available as an example. Check out the LVD example "lvdExample_BackPropagationExToDunaViaMun.mat" that ships with the KSPTOT download package. It shows you how to set something like this up using patch points and continuity constraints. Let me know if you have any questions. Oh, sweet! Last time I used KSPTOT, LVD was only just starting to get features beyond launch. Guess it's time to learn a new tool Is MA effectively deprecated these days? Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 12, 2021 Author Share Posted February 12, 2021 10 minutes ago, russm said: Is MA effectively deprecated these days? It's not deprecated, but it's also not under active development anymore. I still release bug fixes and the like for MA from time to time as needed, but LVD has quickly become much easier to maintain and expand. MA still has a place when you need very quick, analytic two-body propagation and impulsive delta-v in a simple trajectory, but LVD is generally what I've been recommending to people now. Quote Link to comment Share on other sites More sharing options...
GigaG Posted February 16, 2021 Share Posted February 16, 2021 Is it possible to run this using a MATLAB install? I have MATLAB and would rather not spend the disk space on a "redundant" runtime. Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 16, 2021 Author Share Posted February 16, 2021 28 minutes ago, GigaG said: Is it possible to run this using a MATLAB install? I have MATLAB and would rather not spend the disk space on a "redundant" runtime. If you have MATLAB R2017b, the executable should just work. If you have a version equal to or greater (newer) than R2017b, you can pull the source code off github and run it directly (projectMain.m). Quote Link to comment Share on other sites More sharing options...
Razgriz1 Posted February 18, 2021 Share Posted February 18, 2021 On 2/15/2021 at 8:44 PM, Arrowstar said: If you have MATLAB R2017b, the executable should just work. If you have a version equal to or greater (newer) than R2017b, you can pull the source code off github and run it directly (projectMain.m). Just a heads up, I believe there are some issues running the source code on newer versions of MATLAB. Mathworks are not particularly good at maintaining backwards compatibility. I tried running it on one of the 2019 versions (iirc) a while ago and ran into errors that I didn't feel like taking the time to debug. Pretty sure that was about when they switched to the new App designer, and that messed up the default arguments of some of the functions dealing with creating UIs. Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 18, 2021 Author Share Posted February 18, 2021 16 hours ago, Razgriz1 said: Just a heads up, I believe there are some issues running the source code on newer versions of MATLAB. Mathworks are not particularly good at maintaining backwards compatibility. I tried running it on one of the 2019 versions (iirc) a while ago and ran into errors that I didn't feel like taking the time to debug. Pretty sure that was about when they switched to the new App designer, and that messed up the default arguments of some of the functions dealing with creating UIs. I've tested KSPTOT on just about every version of MATLAB since R2019b and I've never had an issue with backwards compatibility thus far. I'm not saying it can't happen, but I haven't seen it. In general, KSPTOT should work fine on newer versions of MATLAB. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted February 20, 2021 Share Posted February 20, 2021 @Arrowstar just realized I heard back from you on all my recent postings except this one with the odd dynamic pressure plot: Quote Link to comment Share on other sites More sharing options...
russm Posted February 20, 2021 Share Posted February 20, 2021 (edited) Hey @Arrowstar, some LVD-n00b questions/suggestions/feature requests: Is it possible to import/export LVD cases to anything other than .mat, or to versions of .mat that other things can read or write? a JSON dump? Octave? (Octave errors out when trying to load an LVD case file .mat, I'm guessing it can't handle some feature used in the ones you're creating) Given the increased detail in LVD, it'd be really nice to be able to eg. import part info for vehicle specification, or copy parts of a flight from one case to another without having to click and type it all in the GUI. It would also solve my other pain points below Is there a way to find which optimisation variables are at/near their limits? The bar chart in the optimiser shows this, but I see no way to easily work out "variable Y is the event duration termination condition for event X". Is it possible to disable the automatic propagation after editing an event? When trying to find variables at their limits having to wait a few seconds after closing one event before being able to open the next is a right pain. Is there (or can there be) a "duplicate event" control? When adding a bunch of identical events like initial pitch profile ones, it'd be nice to not have to click and type through a bunch of GUI windows and make sure they're all done right instead of doing one and then just duplicating a bunch more. But yeah, LVD looks pretty good. Thanks for the cool tool! Edit: OK, scipy.io will happily read those case files, but just gives me a MatlabOpaque and a giant array of uint8 which isn't entirely helpful. I'll have a poke around and see if I can turn this into something I can work with. But if Matlab gives you an easy way to export/import the workspace data as JSON or some other portable structured form instead that'd be nice. (fwiw I wouldn't expect you to support messing around inside case files in any way, but since you don't break them from release to release I'm assuming the internal data is at least stable ) Edited February 20, 2021 by russm Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 20, 2021 Author Share Posted February 20, 2021 16 hours ago, Drew Kerman said: @Arrowstar just realized I heard back from you on all my recent postings except this one with the odd dynamic pressure plot: Thanks for the reminder! At this point it'll be next week, but I'll look into it. 10 hours ago, russm said: Hey @Arrowstar, some LVD-n00b questions/suggestions/feature requests: Is it possible to import/export LVD cases to anything other than .mat, or to versions of .mat that other things can read or write? a JSON dump? Octave? (Octave errors out when trying to load an LVD case file .mat, I'm guessing it can't handle some feature used in the ones you're creating) Given the increased detail in LVD, it'd be really nice to be able to eg. import part info for vehicle specification, or copy parts of a flight from one case to another without having to click and type it all in the GUI. It would also solve my other pain points below Is there a way to find which optimisation variables are at/near their limits? The bar chart in the optimiser shows this, but I see no way to easily work out "variable Y is the event duration termination condition for event X". Is it possible to disable the automatic propagation after editing an event? When trying to find variables at their limits having to wait a few seconds after closing one event before being able to open the next is a right pain. Is there (or can there be) a "duplicate event" control? When adding a bunch of identical events like initial pitch profile ones, it'd be nice to not have to click and type through a bunch of GUI windows and make sure they're all done right instead of doing one and then just duplicating a bunch more. It is not, sadly. LVD case files are basically made up of objects instatiated from user-defined classes, and there's no way to export those in a reasonable manner to anything other than a binary format like MAT. This is also why you're running into issues with trying to read the file externally: it's basically just a bunch of pointers with some data here and there that MATLAB can understand with the help of the class definitions (which you don't have). You're not going to be able to open LVD MAT in Octave or Scipy or anything like that. Yes, there is a warning in the warning/alerts area that tells you if variables are near their bounds. Yes, this option is under the settings menu in the main LVD UI. I've never considered this, but it's theoretically possible. The difficulty lies in copying the miriad of underlying objects that make up the event, and that could be pretty tedious. I'll consider it but no promises. Quote Link to comment Share on other sites More sharing options...
russm Posted February 20, 2021 Share Posted February 20, 2021 3 hours ago, Arrowstar said: I've never considered this, but it's theoretically possible. The difficulty lies in copying the miriad of underlying objects that make up the event, and that could be pretty tedious. I'll consider it but no promises. Ah, OK so Matlab doesn't provide a deep copy. There appears to be a workaround if you're willing to use undocumented functions. If that doesn't work in this app or you'd rather not colour outside Matlab's lines then give it a miss - doing a deep copy manually is a recipe for the functionality to break in strange ways the next time you extend one of those objects and forget to update the copier. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted February 20, 2021 Share Posted February 20, 2021 5 hours ago, Arrowstar said: At this point it'll be next week, but I'll look into it. cool thx, no rush at all just making sure it was still on your radar 5 hours ago, Arrowstar said: Yes, there is a warning in the warning/alerts area that tells you if variables are near their bounds. @russm a bit of extra info that may not be obvious: you need to hover your mouse cursor over the warning to get the detailed info as to which events are causing bounds issues Also keep in mind that when you make requests for things to lighten the workload on us end-users (which I agree is nice, I myself have requested things like the ability to export/import ground stations) you're taking away already limited spare time for development of new features, as both are only coming from one person Quote Link to comment Share on other sites More sharing options...
russm Posted February 21, 2021 Share Posted February 21, 2021 (edited) 45 minutes ago, Drew Kerman said: @russm a bit of extra info that may not be obvious: you need to hover your mouse cursor over the warning to get the detailed info as to which events are causing bounds issues Oh, right, that's the bit I was missing. Cheers! 45 minutes ago, Drew Kerman said: Also keep in mind that when you make requests for things to lighten the workload on us end-users (which I agree is nice, I myself have requested things like the ability to export/import ground stations) you're taking away already limited spare time for development of new features, as both are only coming from one person For sure, I get this 100% - I live and work in the open source software world where volunteer time and energy is one of the limiting resources for a lot of things. I hope I'm not coming across as "this is bad, you need to do $things to make it good". Any suggestions or requests I make are offered to @Arrowstar in the absolute knowledge that they're to do with as he pleases, and if that's deciding that they're not something he wants to put any effort into then that's absolutely fine and his call to make. And where possible I try to reduce the effort required to implement any request I make, eg once I understood that the problem with duplicating events is that it requires a deep copy of the object graph and Matlab doesn't have a supported way to do that, I found a (possible) workaround. I don't know Matlab so I'm not in a position to evaluate how feasible or desirable that workaround is, so if that makes the feature easy/trivial to implement then that's good, and if @Arrowstar decides he doesn't want to do it for whatever reason then that's absolutely fine too. Edited February 21, 2021 by russm Quote Link to comment Share on other sites More sharing options...
dozer Posted February 21, 2021 Share Posted February 21, 2021 Hi! I'm getting back into KSP after a long break, and now I'm trying to learn some of the new stuff in KSPTOT. I tried to follow the LVD guide, but I need a break from that as I'm doing something wrong somewhere. I figured it might be better to do a very simple test as follows. Minimum rocket to get to orbit, one stage, put that into LVD and try to get to orbit. It's getting close, but I'm confused with the objectives and constraints. So finally, we arrive at my question. Do any of you have a KSPTOT LVD savefile you can share that does this, including optimization constraints? That way I can have a look at a working example. Something that launches and gets to a 100km orbit, 90 hdg, 0 inc. Thank you Arrowstar for a fantastic tool! Quote Link to comment Share on other sites More sharing options...
Tacombel Posted February 22, 2021 Share Posted February 22, 2021 (edited) Something new that I don't understand I am planning a mission to Kerbol and back. No problem with the first leg, were I achieve a Pe of 180000Km. But when planning the return, the final state doesn't change. On the left is the state after coast to Sun periapsis, event 4. But it is the same that the Final Spacecraft State. I even added some prograde dV at event 6, but nothing changes. Edit: I edited event number 5 for an initial solution of 100 and started working, changing the final state and optimizing. Edited February 22, 2021 by Tacombel Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 23, 2021 Author Share Posted February 23, 2021 On 2/21/2021 at 9:55 AM, dozer said: Hi! I'm getting back into KSP after a long break, and now I'm trying to learn some of the new stuff in KSPTOT. I tried to follow the LVD guide, but I need a break from that as I'm doing something wrong somewhere. I figured it might be better to do a very simple test as follows. Minimum rocket to get to orbit, one stage, put that into LVD and try to get to orbit. It's getting close, but I'm confused with the objectives and constraints. So finally, we arrive at my question. Do any of you have a KSPTOT LVD savefile you can share that does this, including optimization constraints? That way I can have a look at a working example. Something that launches and gets to a 100km orbit, 90 hdg, 0 inc. Thank you Arrowstar for a fantastic tool! Check out the "lvdExample_TwoStageToOrbit.mat" example that's included with the main KSPTOT download. It's not a single stage to orbit like you're asking, but I think it's close enough to illustrate what you need. Let me know if you have any questions with it. 9 hours ago, Tacombel said: Something new that I don't understand I am planning a mission to Kerbol and back. No problem with the first leg, were I achieve a Pe of 180000Km. But when planning the return, the final state doesn't change. On the left is the state after coast to Sun periapsis, event 4. But it is the same that the Final Spacecraft State. I even added some prograde dV at event 6, but nothing changes. Edit: I edited event number 5 for an initial solution of 100 and started working, changing the final state and optimizing. Can I see the MAT file? Quote Link to comment Share on other sites More sharing options...
Tacombel Posted February 23, 2021 Share Posted February 23, 2021 14 hours ago, Arrowstar said: Check out the "lvdExample_TwoStageToOrbit.mat" example that's included with the main KSPTOT download. It's not a single stage to orbit like you're asking, but I think it's close enough to illustrate what you need. Let me know if you have any questions with it. Can I see the MAT file? https://drive.google.com/file/d/1a7PTbGqu_3edejRp2rpculgL7TQgGy1b/view?usp=sharing I thought that it was working when I changed the initial value of the True anomaly to 100, but when I tried to optimize it, it hangs up. I suppose that it is because now I see that probably there is no solution, but it just starts, without iterating, without errors. Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted February 23, 2021 Author Share Posted February 23, 2021 (edited) 35 minutes ago, Tacombel said: https://drive.google.com/file/d/1a7PTbGqu_3edejRp2rpculgL7TQgGy1b/view?usp=sharing I thought that it was working when I changed the initial value of the True anomaly to 100, but when I tried to optimize it, it hangs up. I suppose that it is because now I see that probably there is no solution, but it just starts, without iterating, without errors. Okay. And can you describe for me what you wanted to do, what actually happened, and how I can reproduce the issue? EDIT: I couldn't reproduce any hanging while optimizing, but it did take a while because the optimizer step size got pretty small in the last iteration. This is probably because the constraint values aren't well scaled, which is sort of a flaw in the way MA is set up. I might encourage you to go give Launch Vehicle Designer a try. Despite its name, it's really an all-around better spacecraft mission design tool, and can help you avoid some of these issues. Edited February 23, 2021 by Arrowstar Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.