How to extract raw data of ode23 or dde23 simulation?
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Mirlan Karimov
      
 el 16 de En. de 2019
  
    
    
    
    
    Respondida: Steven Lord
    
      
 el 17 de En. de 2019
            option=odeset('RelTol', 1e-4, 'AbsTol', 1e-4);
sol = dde23(@syst,[tau],@hystory,[0 2000],option);
figure(1);plot(sol.x,sol.y(1,:)); hold on
xlabel('time t');
ylabel('Displacement [rad]'); 
I have something like this. Basically, sol.y(1,:) contains displacement values at each sampled time instant. I want to put a condition that if sol.y(1,:) exceeds certain value during the simulation then the system is diverging, otherwise converging. But when I write sol.y(1,:) in the command line MATLAB says: "unknown function" 
1 comentario
  Jan
      
      
 el 17 de En. de 2019
				The question is not clear yet. Does the posted code exist inside a function? Then export the variable sol as output, if you really need it in the command window. Instead of working inside the command window, you could write the code inside the function.
Respuesta aceptada
  Steven Lord
    
      
 el 17 de En. de 2019
        If you want to stop the solution process once one of the components exceeds a certain value, use an Events function (see the Event location section of that documentation page.)
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


